-
Notifications
You must be signed in to change notification settings - Fork 618
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
Building all merge requests at a specific time #868
Comments
@eriknellessen first, FYI there is currently a bug that breaks the setting of "Rebuild open merge requests" to "never. See #705. Second, without the webhook JSON from GitLab, the plugin has no way to set any of the env vars for source and target branch, etc. So I'm not really sure how you would make this work. Maybe use a Pipeline Multibranch build, so all your branches are automatically detected, and schedule that nightly. But you would have to assume their target branch to merge into was always master, and you would be building branches that didn't yet have MRs. It's probably not ideal. Anyway, this plugin is focused on supporting triggering and build status reporting back to GitLab, neither of which is really encompassed by your request, so I will close this. |
@omehegan thank you very much for your answer! I can confirm that the plugin did not set the environment variables. Since it was not triggered by the Gitlab webhook, it did not have the information present. For everyone in the future coming along this issue: We found the following workaround to get our nightly merge requests build:
This worked for us, even if the webhook JSON data was static and the master branch changed. |
@eriknellessen https://github.com/jenkinsci/gitlab-plugin#parameter-configuration might be a simpler solution than your mock webhook replay. Just create parameters with appropriate default values for your job. |
@omehegan thanks for the hint. If I understand the parameter configuration correctly, you can configure variables like gitlabSourceBranch, gitlabTargetBranch etc. This way I could manually create jobs that will build merge requests and I could then just schedule these for any time I like. Anyhow I think I would have to create one for every merge request. Is this correct? My webhook replay workaround builds all merge requests at any time I like without any manual work. |
@eriknellessen yes that is probably correct, if you are using your webhook replay logic to trigger a bunch of builds, that approach probably makes sense. |
Issue
Context
Problem description
Describe your problem in a meaningful way:
what were you doing (simple push, merge request, MR with fork, ...)
We have a merge request pipeline that builds all of our merge requests. It works fine. When a merge request is created, or a push is done to the source or target branch, the pipeline is triggered and builds the respective merge request. We also configured triggering via Gitlab merge request comments. This is also working fine.
Now for performance reasons, we would not like to build on the pushes, but we would like to have a nightly build. Triggering via writing a comment shall still work, so we can trigger builds when necessary.
We deactivated the push trigger, i.e. we configured "Rebuild open Merge Requests" to "Never". We configured the timer trigger to something like "0 0 * * 1-5" to get a nightly build.
what was expected
All merge requests are built at the time configured (i.e. ad midnight).
what occurred finally
Only one job was started instead of one job for every merge request. The job failed because none of the environment variables were set.
Is there a way to build all merge requests at a specific time?
Thanks in advance for any kind of help!
The text was updated successfully, but these errors were encountered: