-
Notifications
You must be signed in to change notification settings - Fork 119
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
[JENKINS-17680] Upgrade configurations from version 1.25 #23
Conversation
Jenkins » copyartifact-plugin #50 UNSTABLE |
Thank you for a pull request! Please check this document for how the Jenkins project handles pull requests |
I could not reproduce the test failure. |
|
||
boolean isUpgraded = false; | ||
for (Project<?,?> project: Jenkins.getInstance().getAllItems(Project.class)) { | ||
for (CopyArtifact target: Util.filter(project.getBuilders(), CopyArtifact.class)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will not work for a MatrixProject
. Use getCopiers
instead. (Which reminds me why the call to upgradeIfNecessary
will still be necessary from perform
: in case the build step is part of an AbstractProject
which is neither a Project
nor a MatrixProject
.)
Jenkins » copyartifact-plugin #52 SUCCESS |
@jglick Thank you for your reviewing. I updated the request.
And I added a test I made so many changes that commit logs are dirty. |
((MatrixProject)project).getBuildersList() : null); | ||
if (list == null) return Collections.emptyList(); | ||
List<CopyArtifact> copiers = list.getAll(CopyArtifact.class); | ||
List<CopyArtifact> copiers = CopyArtifact.getCopiers(project); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Existing getCopiers
is CopyArtifact$ListenerImpl.getCopiers
.
I extracted partially as CopyArtifact.getCopiers
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense, though to reduce confusion it would be wise to pick different names for the two methods.
Changes in testProjectNameSplit.zip:
new file testWrappedCopierProjectNameSplit.zip:
|
assertFalse(configXml, configXml.contains("<projectName>")); | ||
// When a project is specified with a variable, it is split improperly. | ||
assertTrue(configXml, configXml.contains("<project>matrix</project>")); | ||
assertTrue(configXml, configXml.contains("<parameters>which=${which}</parameters>")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see no need to rebase this way. Who cares how many commits it took so long as the end result is right? |
@jglick Thanks for your reviewing. |
[JENKINS-17680] Upgrade configurations from version 1.25
Jenkins » copyartifact-plugin #55 UNSTABLE |
Hmmm.... Why this failure is reproduced? |
It succeeded in the following test...so seems no problem. |
Thank you. |
Upgrading CopyArtfifact from 1.25 or earlier to 1.26 or later causes job names to copy from get empty in job configuration pages.
Running a build upgrades the configuration, but the configuration breaks if one opens the configuration page and save it before running a build.
With this patch, configurations are upgraded when they are loaded.
This works as following:
Points are: