Skip to content

Commit

Permalink
Remove deprecated Plugin-GitHash (#653)
Browse files Browse the repository at this point in the history
  • Loading branch information
basil authored Aug 28, 2024
1 parent 43ee83d commit 9d48689
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/it/metadata-it/verify.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ try (JarFile j1 = new JarFile(p1)) {
assert attributes.getValue('Plugin-Version').startsWith('1.0-SNAPSHOT')
assert attributes.getValue('Url').equals('https://plugins.jenkins.io/plugin1/')
assert attributes.getValue('Plugin-ScmConnection').equals('scm:git:https://github.com/jenkinsci/maven-hpi-plugin.git')
def matcher = attributes.getValue('Plugin-GitHash') =~ pattern
def matcher = attributes.getValue('Implementation-Build') =~ pattern
assert matcher.matches()
}

Expand Down Expand Up @@ -68,7 +68,7 @@ try (JarFile j2 = new JarFile(p2)) {
assert attributes.getValue('Plugin-Version').startsWith('1.0-SNAPSHOT')
assert attributes.getValue('Url').equals('https://plugins.jenkins.io/multimodule-it-plugin2/')
assert attributes.getValue('Plugin-ScmConnection').equals('scm:git:https://github.com/jenkinsci/maven-hpi-plugin.git')
def matcher = attributes.getValue('Plugin-GitHash') =~ pattern
def matcher = attributes.getValue('Implementation-Build') =~ pattern
assert matcher.matches()
}

Expand Down
2 changes: 1 addition & 1 deletion src/it/verify-it/verify.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Files.newInputStream(new File(basedir, 'target/verify-it/META-INF/MANIFEST.MF').
assert manifest.getMainAttributes().getValue('Plugin-ScmConnection').equals('scm:git:https://github.com/jenkinsci/verify-it-plugin.git')
assert manifest.getMainAttributes().getValue('Plugin-ScmTag').equals('HEAD')
assert manifest.getMainAttributes().getValue('Plugin-ScmUrl').equals('https://github.com/jenkinsci/verify-it-plugin')
def matcher = manifest.getMainAttributes().getValue('Plugin-GitHash') =~ pattern
def matcher = manifest.getMainAttributes().getValue('Implementation-Build') =~ pattern
assert matcher.matches()
assert manifest.getMainAttributes().getValue('Plugin-Version').startsWith('1.0-SNAPSHOT')
assert manifest.getMainAttributes().getValue('Short-Name').equals('verify-it')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,10 +254,7 @@ protected void setAttributes(Manifest.ExistingSection mainSection)
mainSection, "Plugin-ScmConnection", project.getScm().getConnection());
addAttributeIfNotNull(mainSection, "Plugin-ScmTag", project.getScm().getTag());
addAttributeIfNotNull(mainSection, "Plugin-ScmUrl", project.getScm().getUrl());
String gitHash = getGitHeadSha1();
// Deprecated: Use "Implementation-Build" for consistency with core and core components
addAttributeIfNotNull(mainSection, "Plugin-GitHash", gitHash);
addAttributeIfNotNull(mainSection, "Implementation-Build", gitHash);
addAttributeIfNotNull(mainSection, "Implementation-Build", getGitHeadSha1());
}

/**
Expand Down

0 comments on commit 9d48689

Please sign in to comment.