-
Notifications
You must be signed in to change notification settings - Fork 97
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
Build with empty ParametersAction & copying of all build actions #40
base: master
Are you sure you want to change the base?
Conversation
private void fillOtherBuildActions(Run build, List<Action> actions) { | ||
for (Action a: build.getActions()) { | ||
if (!(a instanceof CauseAction) && !(a instanceof ParametersAction)) { | ||
actions.add(a); |
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.
It's really unsafe, because there are many plugins contributing actions as metadata.
Such copying may potentially cause a duplication of data with errorneous results in plugins
@goganchic So I would recommend creating an extension point, which would allow managing such action propagation. Then you will be able to implement it in plugins like Git plugin |
thanks, I'll try. Can you give me a bit more information information what do you mean? Should I do new extension point in Jenkins? Or may be I need to implement plugin which will depend on git plugin and rebuild plugin and which will add some parameters before rebuild? |
Extension in the Jenkins core may be usable, but it requires much more design. It also may require bumping of the plugins to newest core versions, which does not seem to be a good idea till 2.0 LTS gets stabilized. I would rather implement a |
@oleg-nenashev I have implemented your suggestion in this PR |
370af40
to
316c049
Compare
Hello everyone. I have such problem with jenkins: I've set up jenkins not-paramererized project to build stash repository. For every new commit stash sends notification to jenkins (url git/notifyCommit which belongs to git plugin). Sometimes build fails and I want to rebuild it with rebuild-plugin. I want to rebuild particular commit, not the last one, but when I click "Rebuild" button jenkins rebuilds last commit. I looked through the code of rebuild-plugin and git-plugin and found that rebuild-plugin copies only ParametersAction-s properties of build and git-plugin stores information about git commit in RevisionParameterAction which is not successor of ParametersAction. That is why jenkins rebuilds wrong commit. I've created fix for rebuild-plugin but I'm not sure that it is right solution. Should I fix git-plugin instead? I mean make RevisionParameterAction a successor of ParametersAction or make a checkbox "add revistion as a build parameter"? Or may be I need new plugin? What do you think which solution will be correct?
Second part of PR is about build with empty parameters attributes. Sometimes I have builds in non-parameterized project in which ParametersAction field exists but it contains no fields, so rebuild-plugin tries to rebuild it and throws an exception.