Page MenuHomeSoftware Heritage

jobs/tools: Add setup-gitlab-webhooks job
ClosedPublic

Authored by anlambert on Dec 23 2022, 6:49 PM.

Details

Summary

This job is responsible to setup the webhooks on swh GitLab repositories
enabling to trigger Jenkins builds when pushing changes or creating merge
requests.

It parses Jenkins jobs builder YAML configuration to get the name of the
repos with CI setup and set webhook URLs in GitLab projects through HTTP
requests to the GitLab REST API.

It is triggered at the end of the swh-jenkins-jobs-builder job after jobs
have been reconfigured.

Depends on D8982

Diff Detail

Repository
rCJSWH Jenkins jobs
Branch
setup-gitlab-webhooks-job
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 33392
Build 52342: arc lint + arc unit

Event Timeline

ardumont added a subscriber: ardumont.
ardumont added inline comments.
jobs/tools/setup-gitlab-webhooks.groovy.j2
79

why is it a POST for jenkins job? (vs. PUT for the previous ones)

This revision is now accepted and ready to land.Jan 2 2023, 2:30 PM
jobs/tools/setup-gitlab-webhooks.groovy.j2
79

PUT is for updating the webhook, POST for creating it.

jobs/tools/setup-gitlab-webhooks.groovy.j2
79

yes, i got that.
But after the first run on swh-jenkins-job, won't that clash?

jobs/tools/setup-gitlab-webhooks.groovy.j2
79

Nope, as the GitLab API URL is not the same.

jobs/tools/setup-gitlab-webhooks.groovy.j2
79

great, thx.