Document dependency updates via renovate gitlab-bot
What does this MR do?
As part of Replace sast-analyzer-deps-bot with renovate (gitlab-org/gitlab#557439), we are deprecating SASTBot in favor of Renovate for managing SAST analyzer dependencies.
This MR updates Semgrep with scripts required for Renovate.
Todo
-
Once CI Template MR is merged, update ref to master
Overview of changes
This work spans several repos:
-
Changelog Parser (MR1, MR2):
- Added an
updatecommand to inject{{MERGE_REQUEST_ID}}placeholders intoCHANGELOG.md
- Added an
-
Renovate gitlab bot (MR):
- Added the Semgrep config to trigger dependency updates
- Defined
postUpgradeTasksto rundownload-changelog-parser.shand theupdatecommand
-
Semgrep (This MR):
- Added
download-changelog-parser.shto download thechangelog-parserbinary - Added the
update-changelog.ymlCI template
- Added
-
CI Templates (MR):
- Added
update-changelog.ymlcontaining theupdate changelog mridjob - This job replaces
{{MERGE_REQUEST_ID}}in the changelog with the actual MR ID
- Added
Renovate flow:
- In Renovate's pipeline's semgrep job
- Creates a branch (
renovate/all-dependencies)in the gitlab-renovate-forks/semgrep and opens an MR against semgrep. - The
postUpgradeTaskwill:- Download the
changelog-parserbinary withdownload-changelog-parser.shscript - Run the
updatecommand to add dependency details and{{MERGE_REQUEST_ID}}placeholders inCHANGELOG.md
- Download the
- Creates a branch (
- In gitlab-renovate-forks/semgrep pipeline
update changelog mridjob- Replaces
{{MERGE_REQUEST_ID}}with actual MR ID - This job runs in gitlab-renovate-forks/semgrep repo and makes a
merge request apicall to semgrep to retrieve the MR ID.
- Replaces
Verification
- Delete any existing
renovate/all-dependenciesbranch in gitlab-renovate-forks/semgrep.- This will close any existing renovate MRs and allow us to simulate the full Renovate dependency update flow.
-
Rerun this job from the renovate-gitlab-bot MR where I've
- Disabled dry run to trigger a full renovate job
- Temporarily removed all other projects
- This creates the
renovate/all-dependenciesbranch and an MR in semgrep- It initially adds
{{MERGE_REQUEST_ID}}placeholders inCHANGELOG.md - Once
update changelog mridruns successfully, the{{MERGE_REQUEST_ID}}placeholders are replaced with the actual MR ID. - Currently 3 pipelines are triggered due to a workaround for forked MRs targeting non default branches.
- I've temporarily targeted the
smtan/configure-renovatebranch to validate this flow - Once we target the
mainbranch, only a single pipeline will run (example CS MR)
- I've temporarily targeted the
- It initially adds
What are the relevant issue numbers?
Replace sast-analyzer-deps-bot with renovate (gitlab-org/gitlab#557439)
Does this MR meet the acceptance criteria?
-
Changelog entry added -
Documentation created/updated for GitLab EE, if necessary -
Documentation created/updated for this project, if necessary -
Documentation reviewed by technical writer or follow-up review issue created -
Tests updated/added for this feature/bug -
Job definition updated, if necessary -
Conforms to the code review guidelines -
Conforms to the Go guidelines -
Security reports checked/validated by reviewer
Edited by Shao Ming Tan