Allow running marge-bot in CI pipelines or as a single CLI job #289
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR allows running marge-bot as a single job rather than looping indefinitely, so it can be managed via CI pipeline schedules instead of deploying it to your infrastructure.
See also renovate-bot's approach for something similar. https://docs.renovatebot.com/self-hosting/#gitlab-cicd-pipeline
I've added this as a simple flag since I wanted to keep codebase change to a minimum, although I was initially considering another
console_scripts
entrypoint. But I didn't want to change your approach to deployment too much (see also #288) so I hope this is fine.I also considered auto-detecting/defaulting to the
GITLAB_CI
andCI_SERVER_URL
(forgitlab_url
) env vars if marge detects it's in a CI environment, to get a bit closer to zero-config. But I also didn't want to break the existing response to required args. It's tempting though, let me know if you'd accept that :)For an example run, see https://gitlab.com/nejch1/test-marge-bot-as-ci-service/-/jobs/1029017409.