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

fix: skip repo if no package manager found #270

Conversation

ricardojdsilva87
Copy link
Contributor

@ricardojdsilva87 ricardojdsilva87 commented Nov 18, 2024

Pull Request

Proposed Changes

  • Fixes a bug introduced on this PR where if a repository did not had any package manager detected, the script continued and tried to modify an object that did not existed. The continue notation breaks the cycle to go to the next package manager.
  • Makes this link more permanent referenced on this comment
  • The following logic worked only if a REPOSITORY was set , not working with the ORGANIZATION configuration. Now a file always needs to exist locally, either on the repository where the action would run or locally on the computer, triggering an error if it does not exist and the DEPENDABOT_CONFIG_FILE is set
  • Added detection for gradle and devcontainers package managers
  • Needed tests were added
---------- coverage: platform darwin, python 3.13.0-final-0 ----------
Name                 Stmts   Miss  Cover   Missing
--------------------------------------------------
auth.py                 28      0   100%
dependabot_file.py      90      0   100%
env.py                 134      4    97%   46-47, 167-168
evergreen.py           141      3    98%   311-312, 365
--------------------------------------------------
TOTAL                  393      7    98%

Required test coverage of 80% reached. Total coverage: 98.22%

Readiness Checklist

Author/Contributor

  • If documentation is needed for this change, has that been included in this pull request
  • run make lint and fix any issues that you have introduced
  • run make test and ensure you have test coverage for the lines you are introducing
  • If publishing new data to the public (scorecards, security scan results, code quality results, live dashboards, etc.), please request review from @jeffrey-luszcz

Reviewer

  • Label as either fix, documentation, enhancement, infrastructure, maintenance or breaking

@github-actions github-actions bot added the fix label Nov 18, 2024
@ricardojdsilva87 ricardojdsilva87 changed the title Fix/skip repo if no package manager found fix: skip repo if no package manager found Nov 18, 2024
@ricardojdsilva87
Copy link
Contributor Author

@jmeridth I have found yet another bug, needed to add these lines:
https://github.com/github/evergreen/pull/270/files#diff-9c1e512a78997d7d924506ea0d4abe83e23c5d35c7df780a0ec6406fd3e3650eR57-R58

The code would break in the following conditions:

  • A dependabot file already existed in the repository with no registries key configured
  • The dependabot config file exists with the needed configuration to be added

The code would break because there was no registries key found on the dependabot yaml file.

Another question. I see that this PR is starting to be messy... Should I open a separate PR just for this fix and another for the changes to be added included also here?

Thanks!

jmeridth
jmeridth previously approved these changes Dec 2, 2024
@jmeridth jmeridth dismissed their stale review December 2, 2024 14:35

conflict needs to be fixed first

@jmeridth
Copy link
Member

jmeridth commented Dec 2, 2024

@jmeridth I have found yet another bug, needed to add these lines: https://github.com/github/evergreen/pull/270/files#diff-9c1e512a78997d7d924506ea0d4abe83e23c5d35c7df780a0ec6406fd3e3650eR57-R58

The code would break in the following conditions:

  • A dependabot file already existed in the repository with no registries key configured
  • The dependabot config file exists with the needed configuration to be added

The code would break because there was no registries key found on the dependabot yaml file.

Another question. I see that this PR is starting to be messy... Should I open a separate PR just for this fix and another for the changes to be added included also here?

Thanks!

@ricardojdsilva87 I'm good with the additional change. Please fix conflict and then we can approve, merge and release.

@jmeridth jmeridth merged commit b599bcb into github:main Dec 3, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants