Skip to content

fix: backport author association policy and align checks - #854

Open
joshtrichards wants to merge 2 commits into
masterfrom
jtr/fix-align-update-policy-paths
Open

fix: backport author association policy and align checks#854
joshtrichards wants to merge 2 commits into
masterfrom
jtr/fix-align-update-policy-paths

Conversation

@joshtrichards

@joshtrichards joshtrichards commented Jul 26, 2026

Copy link
Copy Markdown
Member

Aligns backport authorization across live comment handling and post-merge request scanning.

  • Allows backport requests from OWNER, MEMBER, COLLABORATOR, and CONTRIBUTOR.
  • Rejects FIRST_TIMER, FIRST_TIME_CONTRIBUTOR, NONE, missing, and unknown associations.
  • Centralizes the policy in githubUtils.ts so both processing paths use the same check.
  • Updates logging to accurately describe unauthorized requests; similarly updates misleading comments.

Policy change: replaces the permissive "anything except NONE" check -- including first-time contributors and any future association values that get created -- with an explicit allowlist for repository maintainers, collaborators, and established contributors.

This is a minor policy change in the scheme of things, as it better aligns with the previously documented policy (by the inline comments) + seems rational/reasonable (IMO) + tightens security slightly + is more future proof.

🤖 AI (if applicable)

  • The content of this PR was partly or fully generated using AI

Central helper that can be used by both the `issue_comment.created` and `pull_request.closed` handlers.

Updates policy from !== NONE to a more explicitly policy.

Adjust policy that was previously >non-collaborators despite the old code comment.

Assisted-by: Copilot:GPT-5.6

Signed-off-by: Josh <josh.t.richards@gmail.com>
Enforce backport author association policy using new central helper.

As a result also uses same new policy.

Signed-off-by: Josh <josh.t.richards@gmail.com>
@joshtrichards
joshtrichards requested review from skjnldsv and susnux July 26, 2026 14:28
@joshtrichards joshtrichards added enhancement New feature or request 3. to review labels Jul 26, 2026
@codecov

codecov Bot commented Jul 26, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 6 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/githubUtils.ts 0.00% 4 Missing ⚠️
src/index.ts 0.00% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants