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

small ultility that helps team to get all names/ids they own. #20495

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

tintse-thxsky-MSFT
Copy link
Contributor

@tintse-thxsky-MSFT tintse-thxsky-MSFT commented Oct 1, 2024

just add a taskidowner.py script to extract all task names/ids owned by a team.

@tintse-thxsky-MSFT tintse-thxsky-MSFT enabled auto-merge (squash) October 1, 2024 21:29
@tintse-thxsky-MSFT
Copy link
Contributor Author

this is the output for azure-artifacts-packages team

image

import json

codeowners_file_path = '/workspaces/azure-pipelines-tasks/.github/CODEOWNERS'
team_name = '@microsoft/azure-artifacts-packages'
Copy link
Member

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

import os
import json

codeowners_file_path = '/workspaces/azure-pipelines-tasks/.github/CODEOWNERS'
Copy link
Member

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

return tasks

def extract_task_id(task_path):
task_json_path = os.path.join(task_path, 'task.json')
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants