-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
small ultility that helps team to get all names/ids they own. #20495
base: master
Are you sure you want to change the base?
Conversation
.github/taskIdbyowner.py
Outdated
import json | ||
|
||
codeowners_file_path = '/workspaces/azure-pipelines-tasks/.github/CODEOWNERS' | ||
team_name = '@microsoft/azure-artifacts-packages' |
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.
It would be nice to take this from the command line
.github/taskIdbyowner.py
Outdated
import os | ||
import json | ||
|
||
codeowners_file_path = '/workspaces/azure-pipelines-tasks/.github/CODEOWNERS' |
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.
It would be better to not check in paths from your local machine. There are some nuances to it, but from pathlib import Path
and Path(__file__).parent / 'CODEOWNERS'
should get you close enough to what you need
.github/taskIdbyowner.py
Outdated
return tasks | ||
|
||
def extract_task_id(task_path): | ||
task_json_path = os.path.join(task_path, 'task.json') |
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.
Because these paths are relative, you're making an assumption here that the script is being run from the root of the repository. It would be better to join the root of the repository, then the task_path, then task.json
just add a taskidowner.py script to extract all task names/ids owned by a team.