-
Notifications
You must be signed in to change notification settings - Fork 17
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: Ensure exemption list of ecosystem is not overwritten #216
Conversation
@hkadakia thank you for catching this. Would you be willing to add a test? I see your manual testing. Thank you for that. Gave great context. |
Sure. I'll work on it as soon as I can. |
@jmeridth Added the unit test. In order to ensure we correctly test/exercise the code, moved the copy from the calling function to within the function. Please let me know if any more changes. |
@hkadakia some linting errors. once fixed I'm good with merging this. Thank you very much for the contribution including tests. |
Wow! Big learning opportunity for me here. Thanks for finding and fixing this. I'm adding "overwriting env data when passing and returning to functions" to my personal code review checklist as I think this is something I could easily do again if I'm not careful about it. |
Pull Request
Proposed Changes
Currently we pass in the env variable directly when building a dependabot config file. When iterating through multiple repos, there is a possibility that if one of the previous repos has an existing dependabot config, we land up adding those to the exemption list in order to not add that config again to the dependabot.yml file. We land up using the same exempt_ecosystem for all the foll. repos resulting in skipping of creating that dependabot.yml.
This fix always passes in a copy of the original
exempt_ecosystems
environment variable ensuring the original data is not over written.In the example above, the first repo
hello-gh-actions
already has a dependabot.yml file with gomod, docker & github-actions package manager. Thetest
repo on the other hand does not have anydependabot.yml
file and the expectation is for evergreen to create a pull request but as you see from the example it assumes the same ecosystems are added to the exempt list and skips adding the pull request.Below is my evergreen.yml config:
Readiness Checklist
Author/Contributor
make lint
and fix any issues that you have introducedmake test
and ensure you have test coverage for the lines you are introducing@jeffrey-luszcz
Reviewer
fix
,documentation
,enhancement
,infrastructure
,maintenance
orbreaking