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.
* 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
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
* 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>