-
Notifications
You must be signed in to change notification settings - Fork 619
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
Don't check LastCommitNotYetBuild on Approve MR action #664
Conversation
@omehegan can you let me know if this change is going in the right direction? |
Another approach would be to add a separate option "Approved Merge Request Events" like the "Opened Merge Request Events" and "Accepted Merge Request Events". However this would require a change to the flow described above to split off the approved-only part into a separate job. |
@jakub-bochenski This seems like a good improvement. Out of curiosity, what are you checking in your logic about whether the MR is approved? The gitlabActionType variable? Have you already tested this change? @mreichel or @Argelbargel do you have any comments on this? The actual diff is small, but @jakub-bochenski is right that the conditional statement here is pretty complex. I don't know if it can be simplified or if it would be worth trying. |
This change would be a good addition to make it possible to e.g. create release-builds after approval or something similar. i think there should be an option to disable building on/after approval for those use-cases where you just want to check whether everything is okay before approving a merge-request. As for the conditions compexity: the additional check does not make it that worse - for a start i would refactor the checks into their own method (shouldBuild() or something) and leave it at that... |
@omehegan actually I haven't thought of that. What we do now is we only grab the MR id from environment variable and then use Gitlab API for everything else. This makes testing outside of Jenkins easier. Your approach has the advantage of being faster and more atomic. PS. The value of |
I tested it today and it's broken :( I'm seeing the hook is received in the log, but then nothing not even the "Last commit in Merge Request has already been built in build". I will investigate this tomorrow
|
3550dde
to
03c7fa8
Compare
@omehegan this works after all: turns out we had a secret mismatch between the job config and gitlab trigger
|
I think I will rewrite this to have a separate trigger option like it was done in #508 |
e059799
to
bb4c6a8
Compare
efe2bf5
to
ed47391
Compare
ed47391
to
1aadd46
Compare
@jakub-bochenski can you resolve merge conflicts? Then ping @Argelbargel or @mreichel for review, I unfortunately won't have much time for the plugin for the next couple of weeks. |
@Argelbargel or @mreichel please review |
@jakub-bochenski: do your changes cause the test-failures or is this "just" a flickering test? |
@Argelbargel looks random Actually master is red since f8c9cbd |
It is red since f8c9cbd because of failing dependency check (@Argelbargel shouldn't we get rid of the dependency check? It does not work properly and confuses everyone). The tests fail since 4d50561, I will look into it. |
@mreichel: do you mean the check running when pushing to a pr? yes please! |
@Argelbargel the build is now green, can I get a review please? |
Last build failed because of some problems with Jenkins Azure host |
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 think the changes are okay
@Argelbargel or @mreichel can you merge this? |
Expose cancelBuildsOnUpdate to dsl
Related to #659
I think it makes sense to re-trigger builds on approve even if they were already built.
We have builds that will only do certain actions for approved MRs.
Without this the build would run before the MR was approved and would never execute the approved-only actions.