-
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
feat: filter repos by team ownership #242
Conversation
Signed-off-by: Zack Koppert <[email protected]>
Signed-off-by: Zack Koppert <[email protected]>
env.py
Outdated
raise ValueError( | ||
"REPOSITORY environment variable was not set correctly. Please set it to a comma separated list of repositories in the format org/repo" | ||
"TEAM_NAME environment variable cannot be used with ORGANIZATION or REPOSITORY" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought organization was required when using TEAM_NAME
?
Also maybe add check if TEAM-NAME is used then ORGANIZATION is also set?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch! I totally got that messed up on the wording. Fixing...
I originally had in here to check if TEAM-NAME is used then ORGANIZATION is also set but the code was unreachable because we already check for ORGANIZATION or REPOSITORY, and then for TEAM_NAME and not REPOSITORY, so by deduction we've confirmed ORGANIZATION is present. By unreachable code, I mean to say I couldn't write a test that hit it because of the check for org first. If you think I should rewrite the order of the checks so its clear that case is covered, I'm happy to do that. At the time I just elected to remove unreachable code but that isn't as readable/clear.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good point re: unreachable code. I'm a fan of explicit over implicit. Not a blocker though.
Co-authored-by: Jason Meridth <[email protected]>
Signed-off-by: Zack Koppert <[email protected]>
Pull Request
fixes #74
This pull request adds a feature to support specifying a team in addition to an organization. This enables users to run the action on all the repositories owned by a team instead of having to keep that list up to date with the team ownership data already in GitHub. The most important changes include updating the
README.md
to reflect the newTEAM_NAME
parameter, modifying theenv.py
andevergreen.py
files to handle the new parameter, and adding tests intest_env.py
to ensure the new functionality works as expected.Proposed Changes
Documentation Updates:
README.md
: AddedTEAM_NAME
parameter to describe how to configure the action for a specific team within an organization. [1] [2] [3]Code Enhancements:
env.py
: Updatedget_env_vars
function to includeteam_name
parameter and added validation to ensureTEAM_NAME
is not used withORGANIZATION
orREPOSITORY
. [1] [2] [3] [4]evergreen.py
: Modified the main function andget_repos_iterator
to handle repositories based on theTEAM_NAME
parameter. [1] [2] [3] [4]Testing:
test_env.py
: Added new tests to verify the correct behavior whenTEAM_NAME
is set and to ensure errors are raised whenTEAM_NAME
is used withoutORGANIZATION
or withREPOSITORY
. [1] [2] [3] [4] [5] [6]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