-
Notifications
You must be signed in to change notification settings - Fork 0
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
Weekly Auto-PR via Dependabot for updating dependancies #52
Comments
This comment was marked as resolved.
This comment was marked as resolved.
Dependabot Configuration ReportConfiguration Overview The current Dependabot configuration is designed to manage dependency updates for both pip and npm ecosystems. The configuration is structured as follows: version: 2
updates:
- package-ecosystem: "pip"
directory: "/requirements"
versioning-strategy: "auto"
open-pull-requests-limit: 20
schedule:
interval: "weekly"
groups:
pypi-dependencies:
patterns:
- "*"
update-types:
- "minor"
- "patch"
- package-ecosystem: "npm"
directory: "/"
versioning-strategy: "auto"
open-pull-requests-limit: 20
schedule:
interval: "weekly"
groups:
npm-dependencies:
patterns:
- "*"
update-types:
- "minor"
- "patch" Observed Behavior Despite the configuration, Dependabot is not grouping all updates into a single pull request (PR) for each ecosystem. Instead, it is creating multiple PRs, including individual PRs for some dependencies. For example, for the npm ecosystem, the following PRs were observed:
Analysis The observed behavior can be attributed to several factors:
Python requirements The same way Python requirements should have been parsed and grouped in a single PR but the current requirements couldn't be parsed with dependabot. https://github.com/sam-bertin/test-dependabot/network/updates/869830707 |
Experimentationversion: 2
updates:
- package-ecosystem: "npm"
directory: "/"
versioning-strategy: "auto"
open-pull-requests-limit: 60
schedule:
interval: "weekly"
groups:
npm-dependencies:
patterns:
- "*"
update-types:
- "minor"
- "patch" Changes
Results There were 38 npm security alerts with the following severity levels It resulted in 8 pull requests : Analysis
After merging the pull requests it suggested there was 17 npm security alerts. When relaunching the pipeline with : version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
versioning-strategy: "auto"
open-pull-requests-limit: 1
schedule:
interval: "weekly"
groups:
npm-dependencies:
patterns:
- "*"
update-types:
- "minor"
- "patch" It did not address any of the 17 security issues that were left and finished the job without errors. |
Experimentation- package-ecosystem: "pip"
directory: "/requirements"
versioning-strategy: "auto"
open-pull-requests-limit: 10
schedule:
interval: "weekly"
groups:
pypi-dev:
patterns:
- "dev.txt"
update-types:
- "minor"
- "patch"
pypi-staging:
patterns:
- "staging.txt"
update-types:
- "minor"
- "patch"
pypi-prod:
patterns:
- "production.txt"
update-types:
- "minor"
- "patch"
pypi-test:
patterns:
- "test.txt"
update-types:
- "minor"
- "patch"
pypi-ci:
patterns:
- "ci.txt"
update-types:
- "minor"
- "patch"
pypi-base:
patterns:
- "base.txt"
update-types:
- "minor"
- "patch" I decoupled the dependency files for python to figure out whether or not one file was causing the parsing problem. This did not help, job still fails without much detail : https://github.com/sam-bertin/test-dependabot/actions/runs/10404169142/job/28812078285 Here the example where I tried to only parse python deps from ONLY the requirements/base.txt: version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
versioning-strategy: "auto"
open-pull-requests-limit: 1
schedule:
interval: "weekly"
groups:
npm-dependencies:
patterns:
- "*"
update-types:
- "minor"
- "patch"
- package-ecosystem: "pip"
directory: "/requirements"
versioning-strategy: "auto"
open-pull-requests-limit: 1
schedule:
interval: "weekly"
groups:
pypi-dependencies:
patterns:
- "base.txt"
update-types:
- "minor"
- "patch" This still sends us error and cannot parse the dependencies.
It seems weird to me that the ci.txt file is mentioned when I specified base.txt in the I have tried to strip up the case on maximum with only one - package-ecosystem: "pip"
directory: "/requirements/dependabot"
versioning-strategy: "auto"
open-pull-requests-limit: 1
schedule:
interval: "weekly"
groups:
pypi-dependencies:
patterns:
- "requirements.txt"
update-types:
- "minor"
- "patch" So it's not totally broken. |
Possibly linked issue |
@alextreme this config is giving me the best results so far : version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
versioning-strategy: "auto"
open-pull-requests-limit: 1
schedule:
interval: "weekly"
groups:
npm-dependencies:
patterns:
- "*"
update-types:
- "minor"
- "patch"
- package-ecosystem: "pip"
directory: "/"
versioning-strategy: "auto"
open-pull-requests-limit: 1
schedule:
interval: "weekly"
groups:
pypi-dependencies:
patterns:
- "*"
exclude-patterns:
- "ci.txt"
update-types:
- "minor"
- "patch" Results observed I have prepared this documentation to set it up :Dependabot Configuration DocumentationIntroduction Dependabot is a tool that helps keep your dependencies up-to-date by automatically creating pull requests for updates. This documentation explains our Dependabot configuration, how it works, and how to set it up. Configuration Overview Our repository is set up with the following Dependabot configuration: version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
versioning-strategy: "auto"
open-pull-requests-limit: 1
schedule:
interval: "weekly"
groups:
npm-dependencies:
patterns:
- "*"
update-types:
- "minor"
- "patch"
- package-ecosystem: "pip"
directory: "/"
versioning-strategy: "auto"
open-pull-requests-limit: 1
schedule:
interval: "weekly"
groups:
pypi-dependencies:
patterns:
- "*"
exclude-patterns:
- "ci.txt"
update-types:
- "minor"
- "patch" What It Does for You
How to Set It Up
Important Notes
If you have any questions or need further assistance, please reach out. |
Great, thanks Samuel! We'll discuss it with Team Bron on tuesday |
It's probably a hot take but I feel like the way github handles security updates is bit of unpredictable and therefore painful to maintain. |
To bring into this discussion: my main concert is that dependabot does not seem to respect our custom |
Samuel and I discussed exactly this, we may have to go for a bin/update_dependancies.sh script and do this ourselves instead of doing this via dependabot. We'll discuss the various approaches and try this out on one or two repositories to see what works |
in case you didn't know: edit: and now I will unsubscribe from this issue :-) |
Refinement: We still need to see how this behaviour with our pip-compile tooling (see sergeis comment above) but lets try it out for Objects API. |
Lets evaluate its behaviour in the next refinmenent |
Refinement: We're checking if #44 covers our needs first before picking up this ticket. |
Thema / Theme
Other
Omschrijving / Description
Discussed with @sergei-maertens . Most of our Maykin / Team Bron repositories make use of the dependabot alerts, however we disable the default PR-creating feature of dependabot because you get 1 PR per security update which drives everyone insane.
I'd like to try out configuring Dependabot in a smarter way, namely to auto-create on a weekly basis a single PR to update all pypi dependancies in one go. This seems possible via the groups mechanism:
https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#groups
Example 3 shows how this can be done on a weekly basis for npm:
https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#example-3
This should reduce the amount of noise and help us out into autopatching of dependancies with security advisories. Maybe updates should be limited to minor+patch versions to avoid automatically taking major version upgrades into this PR.
The same could also be done for npm dependancies if applicable. Please experiment with configuring dependabot via the yml file
Toegevoegde waarde / Added value
No response
Aanvullende opmerkingen / Additional context
No response
The text was updated successfully, but these errors were encountered: