Renovate at GitLab: Current Implementation Documentation
Overview
Section titled “Overview”Renovate is a dependency update tool used at GitLab to automate the process of keeping dependencies up-to-date. This document outlines the current implementation, configurations, and workflows of Renovate within the GitLab infrastructure.
Current Implementation Approach
Section titled “Current Implementation Approach”GitLab uses common-ci-tasks as the
single, standard approach for running Renovate across projects.
Repository: https://gitlab.com/gitlab-com/gl-infra/common-ci-tasks
Key Characteristics:
- Per-project CI job implementation
- Requires CI include and
renovate.jsonconfiguration. This can be generated for you using ourcommon-template-copiertemplate. - Uses custom container image with specific tooling installed
- Onboarding is driven by
infra-mgmt, which enables thecommon_ci_tasksstanza for a project (in combination with thecommon-template-copiertemplate)
Focus Areas:
- Security and isolation by running one job per project
- Custom tooling baked into the image to generate/update templates and non-standard files
Documentation:
Adding dependencies
Section titled “Adding dependencies”To configure Renovate Bot for a given project, follow the Automated Project Setup documentation in common-ci-tasks.
Related Resources
Section titled “Related Resources”- Renovate official documentation
- GitLab Renovate epic
- Consolidation issue
(closed) — record of the decision to standardize on
common-ci-tasksand retire the global Renovate runner
Best Practices
Section titled “Best Practices”Renovate best practices are documented in the common-ci-tasks project.
Troubleshooting
Section titled “Troubleshooting”Dependency not being picked up
Section titled “Dependency not being picked up”If you configured a dependency and it isn’t getting picked up by Renovate check the output of the latest scheduled pipeline job on the project in question.
If you need further debug data, check the renovate-log.ndjson file on the CI
job’s artifacts and grep for the project’s name.
Testing out Renovate changes
Section titled “Testing out Renovate changes”If you suspect your renovate.json may need adjustments, you can try them out
before merging them the following way:
npm install -g renovate- From a local copy of the project you’re testing against, do one of the following:
For a quick test of dependency logic, use:
LOG_LEVEL=DEBUG RENOVATE_PLATFORM=gitlab RENOVATE_TOKEN="${GITLAB_TOKEN}" renovate --platform=local --include-paths "some/path/to/test/**"If you need to check the logic behind branch creation and opening MRs, use:
RENOVATE_REPOSITORIES=some/repo/to/test RENOVATE_BASE_BRANCH_PATTERNS=some-branch-to-test \LOG_LEVEL=DEBUG RENOVATE_PLATFORM=gitlab RENOVATE_TOKEN="${GITLAB_TOKEN}" renovate --dry-run=full --include-paths "some/path/to/test/**" \--branch-prefix-old "test/" --branch-prefix="test/" --use-base-branch-config=merge --autodiscover=false