Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove deprecated Plugin-GitHash #653

Merged
merged 3 commits into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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