Skip to content
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

CI: add dependabot.yml to auto-update dependencies #236

Merged
merged 1 commit into from
Jan 26, 2023

Conversation

aciba90
Copy link
Collaborator

@aciba90 aciba90 commented Jan 24, 2023

GH actions and lint requirements will be try to be updated in autogenerated PRs.

GH actions and lint requirements will be try to be
updated in autogenerated PRs.
@@ -0,0 +1,13 @@
version: 2
updates:
- package-ecosystem: "pip"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This part will basically mimic the tip targets in Jenkins by creating a PR with updated dependencies and the added benefit of:

  1. If the build passes, we can straight merge those PRs.
  2. If it does not, we see that some style needs to be fixed.

If we try and like this approach, then we could remove the tip jobs in Jenkins.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is false, because tip targets check against the last version of python.

Copy link
Collaborator

@paride paride Jan 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this approach, but I can't find documentation on which requirement files dependabot will update, at least not in [1]. Will it update dev/requirements.txt and test-requirements.txt? Do you happen to have a reference for this?

[1] https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAICT, at the moment one only can specify the directory to search the manifest files and dependabot will discover them there. That's why I put the file under dev/ and configure it in line 4.

I found some discussions explaining that behavior as for example: dependabot/dependabot-core#3940 (comment)

The source code is here: https://github.com/dependabot/dependabot-core/blob/main/python/helpers/lib/parser.py

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found it, apparently it probes **/.txt:

    requirement_files = glob.glob(os.path.join(directory, '*.txt')) \
        + glob.glob(os.path.join(directory, '**', '*.txt'))

Thanks for digging it up!

@aciba90 aciba90 requested a review from paride January 24, 2023 11:10
@aciba90 aciba90 marked this pull request as draft January 24, 2023 11:13
Copy link
Collaborator

@paride paride left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@paride
Copy link
Collaborator

paride commented Jan 24, 2023

@aciba90 is this actually still a draft?

@aciba90 aciba90 marked this pull request as ready for review January 25, 2023 10:00
@aciba90
Copy link
Collaborator Author

aciba90 commented Jan 25, 2023

@aciba90 is this actually still a draft?

Ready! Thanks, @paride for the review. I wanted to make sure that the default configuration does not auto-merge PRs or anything weird. Checked and it looks safe: https://docs.github.com/en/code-security/dependabot/working-with-dependabot/managing-pull-requests-for-dependency-updates

I am going to ping other as reviewers.

Copy link
Member

@TheRealFalcon TheRealFalcon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@aciba90 aciba90 merged commit 4bffb31 into canonical:main Jan 26, 2023
@aciba90 aciba90 deleted the dependabot branch January 26, 2023 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants