Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 18 additions & 10 deletions .github/workflows/assigner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,32 @@ jobs:
if: github.event.pull_request.draft == false
runs-on: ubuntu-24.04
permissions:
pull-requests: write # to add assignees to pull requests
issues: write # to add assignees to issues

steps:
- name: Check out source code
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
fetch-depth: 0
persist-credentials: false

- name: Set up Python
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
uses: zephyrproject-rtos/action-python-env@ace91a63fd503cd618ff1eb83fbcf302dabd7d44 # main
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it intentional to have this here? I see a dedicated PR for it

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

without this, codeql will complain.

with:
python-version: 3.12
cache: pip
cache-dependency-path: scripts/requirements-actions.txt

- name: Install Python packages
- name: Fetch west.yml from pull request
run: |
git fetch origin pull/${{ github.event.pull_request.number }}/head
git show FETCH_HEAD:west.yml > pr_west.yml

- name: west setup
if: >
github.event_name == 'pull_request_target'
run: |
pip install -r scripts/requirements-actions.txt --require-hashes
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
west init -l . || true

- name: Run assignment script
env:
Expand All @@ -51,14 +60,13 @@ jobs:
FLAGS+=" -r ${{ github.event.repository.name }}"
FLAGS+=" -M MAINTAINERS.yml"
if [ "${{ github.event_name }}" = "pull_request_target" ]; then
FLAGS+=" -P ${{ github.event.pull_request.number }}"
FLAGS+=" -P ${{ github.event.pull_request.number }} --updated-manifest pr_west.yml"
elif [ "${{ github.event_name }}" = "issues" ]; then
FLAGS+=" -I ${{ github.event.issue.number }}"
FLAGS+=" -I ${{ github.event.issue.number }}"
elif [ "${{ github.event_name }}" = "schedule" ]; then
FLAGS+=" --modules"
FLAGS+=" --modules"
else
echo "Unknown event: ${{ github.event_name }}"
exit 1
fi

python3 scripts/set_assignees.py $FLAGS
8 changes: 0 additions & 8 deletions .ruff-excludes.toml
Original file line number Diff line number Diff line change
Expand Up @@ -715,14 +715,6 @@
"UP007", # https://docs.astral.sh/ruff/rules/non-pep604-annotation-union
"UP035", # https://docs.astral.sh/ruff/rules/deprecated-import
]
"./scripts/set_assignees.py" = [
"E402", # https://docs.astral.sh/ruff/rules/module-import-not-at-top-of-file
"E501", # https://docs.astral.sh/ruff/rules/line-too-long
"E741", # https://docs.astral.sh/ruff/rules/ambiguous-variable-name
"F541", # https://docs.astral.sh/ruff/rules/f-string-missing-placeholders
"I001", # https://docs.astral.sh/ruff/rules/unsorted-imports
"SIM113", # https://docs.astral.sh/ruff/rules/enumerate-for-loop
]
"./scripts/snippets.py" = [
"I001", # https://docs.astral.sh/ruff/rules/unsorted-imports
"UP006", # https://docs.astral.sh/ruff/rules/non-pep585-annotation
Expand Down
26 changes: 26 additions & 0 deletions scripts/get_maintainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,18 @@ def _parse_args():
nargs="?",
help="List all areas maintained by maintainer.")


area_parser = subparsers.add_parser(
"area",
help="List area(s) by name")
area_parser.add_argument(
"name",
metavar="AREA",
nargs="?",
help="List all areas with the given name.")

area_parser.set_defaults(cmd_fn=Maintainers._area_cmd)

# New arguments for filtering
areas_parser.add_argument(
"--without-maintainers",
Expand Down Expand Up @@ -220,6 +232,12 @@ def __init__(self, filename=None):

self.areas[area_name] = area

def name2areas(self, name):
"""
Returns a list of Area instances for the areas that match 'name'.
"""
return [area for area in self.areas.values() if area.name == name]

def path2areas(self, path):
"""
Returns a list of Area instances for the areas that contain 'path',
Expand Down Expand Up @@ -262,6 +280,14 @@ def __repr__(self):
# Command-line subcommands
#

def _area_cmd(self, args):
# 'area' subcommand implementation

res = set()
areas = self.name2areas(args.name)
res.update(areas)
_print_areas(res)

def _path_cmd(self, args):
# 'path' subcommand implementation

Expand Down
Loading
Loading