24 Commits

Author SHA1 Message Date
Maxwell G
c671fca04c pr_labeler: fix error in pyproject.toml (#2432)
The correct key-name is `build-backend`, not `backend`.
2025-03-05 10:02:16 -06:00
Don Naro
8c0f92fcdc Matrix not matrix (#2000) 2024-10-10 19:30:44 +01:00
Don Naro
d69846789b update docs team info page (#1996)
* update docs team info page

* Update hacking/pr_labeler/pr_labeler/data/docs_team_info.md

Co-authored-by: Sandra McCann <samccann@redhat.com>

---------

Co-authored-by: Sandra McCann <samccann@redhat.com>
2024-10-10 13:59:07 -04:00
Maxwell G
7138e42716 pr_labeler: re-architect triager script (#1882)
This commit reorganizes the issue/PR triager script and updates the
workflow to run more efficiently.

- Make the script a proper Python package instead of an unwieldy single
  file
- Use locked dependencies and UV to decrease workflow runtime to under
  10 seconds.
2024-09-17 14:07:31 -05:00
Maxwell G
763815d1ad pr_labeler: refactor new_contributor_welcome code (#990)
* pr_labeler: add GlobalArgs.full_repo property

* pr_labeler: refactor new_contributor_welcome code

As of https://github.com/ansible/ansible-documentation/issues/69, the
pr_labeler responds with a welcome message when an issue or PR is opened
by a new contributor. It turns out this never actually worked properly.

The previous method that relied on Github's `author_association` flag
did not work with the app token that the pr_labeler uses. This refactors
the code to figure out whether a user is a new contributor by
searching the list of issues and PRs.

Fixes: https://github.com/ansible/ansible-documentation/issues/204

* pr_labeler: address potential race condition
2024-01-10 13:27:28 -06:00
Maxwell G
95ece7e9d6 pr_labeler: improve porting_guide_changes template wording
Co-authored-by: Sandra McCann <samccann@redhat.com>
2023-10-18 17:14:13 +00:00
Maxwell G
746662c255 pr_labeler: exempt bots from porting_guide check
For example, patchback is not a release manager, but we still want it to
backport Porting Guide PRs.
2023-10-18 17:14:13 +00:00
Maxwell G
dddfd7eb55 pr_labeler: use @release-management-wg team for porting_guide check
Instead of hardcoding the list of release managers, we can use the
Github API to retrieve the members of the
`@ansible/release-management-wg` team.
2023-10-18 17:13:17 +00:00
Maxwell G
d2e6625e8b pr_labeler: add warning for porting_guides changes
This adds a warning message when PRs are created that edit
porting_guides by someone outside of the Release Management WG. These
files are automatically generated during the ansible release process and
should not be modified.

Fixes: https://github.com/ansible/ansible-documentation/issues/503
2023-10-18 17:13:17 +00:00
Maxwell G
44ffe0f210 pr_labeler: add --force-process-closed flag 2023-10-18 17:13:17 +00:00
Maxwell G
5730ba9a01 pr_labeler: improve create_boilerplate_comment logging 2023-10-18 17:13:17 +00:00
Maxwell G
e43d253f6c pr_labeler: stop adding new_triage labels to new PRs (#643)
Fixes: https://github.com/ansible/ansible-documentation/issues/628
2023-10-18 12:12:25 -05:00
Maxwell G
cad44e79ca pr_labeler: change link to the DAWGs meeting agenda (#497)
The agenda is now housed on the Ansible Community forum.

Fixes: https://github.com/ansible/ansible-documentation/issues/411
2023-10-04 09:29:07 -05:00
Maxwell G
72f4983406 pr_labeler: allow setting custom repo via CLI (#354)
This makes testing on a different repo easier.
2023-09-09 09:00:23 -05:00
Maxwell G
9e32d15f29 pr_labeler: add nag comment for issues and PRs without description (#353)
* pr_labeler: add issue member to IssueLabelerCtx

Pull requests also support the Github issue API. This allows more easily
writing code that works with both issues and pull requests without extra
conditionals.

* pr_labeler: add dependency on jinja2

* pr_labeler: comment on PRs/issues w/o descriptions

This change adds a job to pr_labeler to leave a comment on PRs and
issues without body text.

It also includes necessary plumbing for rendering jinja2 templates and
idempotently leaving comments on issues.

Fixes: https://github.com/ansible/ansible-documentation/issues/333

* pr_labeler: improve nag comment wording

Co-authored-by: Don Naro <dnaro@redhat.com>

---------

Co-authored-by: Don Naro <dnaro@redhat.com>
2023-09-05 14:28:24 -05:00
Maxwell G
feabfb631b labeler: retrieve author_association from event data
The Github Actions API token apparently doesn't have sufficient ACLs to
retrieve this from the API.

Fixes: https://github.com/ansible/ansible-documentation/issues/204
2023-07-31 14:52:56 +01:00
Maxwell G
1f1252d356 labeler: pass Github Action event data to script
This way, the script can take action based on specific events when that
data is available.
2023-07-31 14:52:56 +01:00
Maxwell G
47a86baeb4 labeler: make LabelerCtx un-frozen
This is needed so that the dataclass can have dict and other mutable
types as fields.
2023-07-31 14:52:56 +01:00
Maxwell G
b2ffdfc84f labeler: remove global get_previously_labeled()
Using a @cached_property that's tied to the class instance makes more
sense than a global cache.
2023-07-31 14:52:56 +01:00
Maxwell G
5c48149561 labeler: fix log() type annotations (#165)
print() coerces any object to a str.
2023-07-25 12:15:45 -05:00
Maxwell G
dd27494b8f labeler: add --authed-dry-run flag
Some data such as author_association is only available to authenticated API
users. This helps with testing.
2023-07-25 11:41:17 -05:00
Maxwell G
5c2125dffa labeler: improve logging 2023-07-25 11:41:17 -05:00
Maxwell G
0bb954b18e labeler: welcome new contributors
Fixes: https://github.com/ansible/ansible-documentation/issues/69
2023-07-25 11:41:17 -05:00
Maxwell G
0c56c51999 Add Github Action to label issues and PRs (#118) 2023-07-25 11:20:26 -04:00