X Tutup
Skip to content

Initial const before it is referenced#11582

Merged
cdrini merged 1 commit intomasterfrom
fix-pr-assignment-script
Dec 11, 2025
Merged

Initial const before it is referenced#11582
cdrini merged 1 commit intomasterfrom
fix-pr-assignment-script

Conversation

@jimchamp
Copy link
Collaborator

Closes #11580

Initializes the CLOSES_REGEX declaration before the main() call in our PR auto-assigner script.

Technical

Testing

Screenshot

Stakeholders

Copilot AI review requested due to automatic review settings December 11, 2025 17:43
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a reference-before-initialization issue by moving the CLOSES_REGEX constant declaration to before the main() function call. The constant was previously defined after all function declarations but was being used inside findLinkedIssue(), which is called by main() at the top level.

Key Changes:

  • Moved CLOSES_REGEX constant from line 118 (after function declarations) to line 22 (before the main() call)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Collaborator

@cdrini cdrini left a comment

Choose a reason for hiding this comment

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

Good catch, what a subtle bug! Lgtm. Not testing, but the logic seems reasonable.

@cdrini cdrini merged commit 00b7654 into master Dec 11, 2025
13 of 14 checks passed
@cdrini cdrini deleted the fix-pr-assignment-script branch December 11, 2025 17:51
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.

CI Failure: ReferenceError: Cannot access 'CLOSES_REGEX' before initialization in new_pr_labeler.mjs

3 participants

X Tutup