-
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
Sc 19672 create a tool to generate teams from GitHub part3 #3
Sc 19672 create a tool to generate teams from GitHub part3 #3
Conversation
This pull request has been linked to Shortcut Story #19672: Create a tool to generate TEAMS from Github topics. |
…rt2' into sc-19672-create-a-tool-to-generate-teams-from-github-part3
Codecov Report
@@ Coverage Diff @@
## main #3 +/- ##
===========================================
+ Coverage 70.93% 87.54% +16.61%
===========================================
Files 6 7 +1
Lines 258 289 +31
===========================================
+ Hits 183 253 +70
+ Misses 75 36 -39
|
src/scripts/create_teams.py
Outdated
add_teams_to_asset(token, asset, teams_to_update) | ||
else: | ||
if asset.tags and "team" in [t.name for t in asset.tags]: |
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.
if asset.tags and "team" in [t.name for t in asset.tags]: | |
asset_has_teams_tag = asset.tags and "team" in [t.name for t in asset.tags] | |
if asset_has_teams_tag: |
src/scripts/create_teams.py
Outdated
for team in organization.teams: | ||
team_resources = [] | ||
for resource in team.resources: | ||
if resource.type == "github_repo" and resource.name in [asset.asset_name for asset in assets]: |
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.
Please move "github_repo"
to Enum
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.
ok
src/shared/clients/jit.py
Outdated
@@ -109,7 +96,7 @@ def delete_teams(token, team_names): | |||
break | |||
|
|||
if team_id: | |||
url = f"{JIT_API_ENDPOINT}/teams/{team_id}" | |||
url = f"{os.getenv('JIT_API_ENDPOINT', JIT_DEFAULT_API_ENDPOINT)}/teams/{team_id}" |
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.
please move os.getenv('JIT_API_ENDPOINT', JIT_DEFAULT_API_ENDPOINT)
to a small util func
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.
❌ The following Jit checks failed to run:
- static-code-analysis-python-semgrep
#jit_bypass_commit
in this PR to bypass, Jit Admin privileges required.
More info in the Jit platform.
sc-19672
In this PR: