-
Notifications
You must be signed in to change notification settings - Fork 168
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
Add support for running promotions on inheritance projects. #75
Add support for running promotions on inheritance projects. #75
Conversation
if(subdirs!=null) { | ||
loadProcesses(subdirs); | ||
} | ||
private void loadProcesses(File[] subdirs) throws IOException { |
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.
tab/spaces mix
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.
Ok. Thanks.
@J-cztery Thanks for taking an action! the selected approach looks to be valid to me. From what I see the issue in inheritance plugin is not a blocker for this PR. Is it correct? It would be also great to have a functional test verifying the new functionality |
}); | ||
|
||
loadProcesses(subdirs); | ||
} |
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.
Mostly duplicates init()
. Would be great to merge methods somehow
@oleg-nenashev: Thank you for the code review. I will work on your comments next. And yes, this change will make promotions usable without the change to jenkins-inheritance-plugin(but with some nuisances). |
@oleg-nenashev: regarding the test. I struggle to write an unit tests that uses multiple plugins. Any ideas on how to set it up? |
Yeah, I have just tested this fix with 1.5.3 version of inheritance build and the only problem i could find is that when the promotion build is running it is not shown on Promotion Status in either build context or project context. But it is shown in the queue. |
8c7c388
to
63e1bfc
Compare
@J-cztery Would you like to keep the test as a part of this PR? If no, I could merge this commit in order to test the behavior together with other changes. |
@oleg-nenashev : If you would like to create a test then a scenario is :
I do observe some functional issues with inheritance plugin as well but i am trying to kill them one by one. The problem i see with this plugin is that maintainer is not very responsive and the project is pretty much dead;( What are your main concerns regarding the functionality of inheritance plugin?
|
@J-cztery We could also fork the Inheritance project plugin to jenkinsci org if @HedAurabesh wants to handover it. Maybe makes sense to start a thread in jenkinsci-dev and Cc owners there. The plugin is definitely useful, so it it great that somebody works on it. |
@oleg-nenashev : Thanks for the hint. I will try to run tests against newer version of Jenkins. I have adapted one of the tests to use inheritance project but it would make sense(?) to run most of them if not all against FreeStyle project type as well as InheritanceProject. This would require making the unit tests slightly more complex...Do you think it would be worth it? Let's deal with potential fork of inheritance project once this PR is finished. |
@J-cztery For such integrations it also makes sense to create a spot-check in https://github.com/jenkinsci/acceptance-test-harness in order to catch regressions in Jenkins core, but it is optional && can be done after this PR. |
Performed manual spot-check and it seems to work. |
Yeah.. I am still working on the unit tests and realized that @DavidTanner's change will still be needed (slightly modified to keep the binary compatibility as you requested) and i am not sure if i will be able to get unit tests working with inheritance-plugin 1.53. |
1. Add unit tests. 2. Remove assert from PromotionProcess as in InheritanceProject it no longer holds. 3. Try to resolve build from jobName and build number first and if this fails, try others. 4. Implement an extension for inheritance-plugin
f8646cb
to
1b5f7e6
Compare
Ready @oleg-nenashev. |
👍 |
@J-cztery thanks a lot for your efforts! |
Thank you for this pull request! Please check this document for how the Jenkins project handles pull requests. |
Add support for running promotions on inheritance projects.
This pull request contains an implementation of extension point to jenkins-inheritance-project-plugin and some changes to JobPropertyImpl construction to allow for interaction with jenkins-inheritance-project-plugin.
A new constructor has been added that allows reading promotion processes information from the location specified by an existing JobPropertyImpl but makes the JobPropertyImpl instance (and it's promotion processes) independent otherwise.
Initially I wanted to keep this extension separate (as a plugin) but this proved too difficult because of the hermetization of JobPropertyImpl and its insistence on loading promotion processes on construction.
Note that there is a problem in jenkins-inheritance-project-plugin and there is an accompanying fix to jenkins-inheritance-project-plugin plugin. That problem prevents from seeing promotions that are currently running. There might be some problems with getting it merged to mainline, so you might want to use my fork directly https://github.com/J-cztery/jenkins-inheritance-plugin.
This change introduces optional dependency to jenkins-inheritance-project.
It supersedes the following pull requests:
#74
#51 (thanks David Tanner for inspiration).