Skip to content

fix: Log org / repository context when unable to match labels#4761

Merged
npalm merged 2 commits intogithub-aws-runners:mainfrom
globalchubby:fix/issue-4760
Sep 18, 2025
Merged

fix: Log org / repository context when unable to match labels#4761
npalm merged 2 commits intogithub-aws-runners:mainfrom
globalchubby:fix/issue-4760

Conversation

@globalchubby
Copy link
Copy Markdown
Contributor

Fixes #4760.

Also some code hygiene: use early continue to minimize nesting and a large if block.

@globalchubby globalchubby requested a review from a team as a code owner September 12, 2025 08:09
@globalchubby globalchubby changed the title fix(webhook): Add org / repository context when unable to match labels Fix #4760: Add org / repository context when unable to match labels Sep 12, 2025
@globalchubby globalchubby changed the title Fix #4760: Add org / repository context when unable to match labels fix: Add org / repository context when unable to match labels Sep 12, 2025
Comment thread lambdas/functions/webhook/src/runners/dispatch.ts Outdated
Refactors the workflow job dispatch logic to handle non-'queued' actions
first, returning early with a 201 status. Updates the sorting and
dispatching logic for matcherConfig, and improves warning messages for
unaccepted runner labels by including the repository name. This ensures
jobs are only dispatched when appropriate and provides clearer logging.
@globalchubby globalchubby changed the title fix: Add org / repository context when unable to match labels fix: Log org / repository context when unable to match labels Sep 14, 2025
@npalm npalm requested a review from Copilot September 15, 2025 16:03
Copy link
Copy Markdown
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 improves logging context when GitHub webhook events contain runner labels that don't match any configured runners. The fix adds organization and repository information to error messages to help with debugging.

  • Adds repository context (body.repository.full_name) to error messages when labels are not accepted
  • Refactors conditional logic using early return pattern to reduce nesting
  • Consolidates error message creation to avoid duplication

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread lambdas/functions/webhook/src/runners/dispatch.ts
@globalchubby
Copy link
Copy Markdown
Contributor Author

@npalm Friendly ping? It's been a week and I think this PR is fairly simple / straightforward.

Copy link
Copy Markdown
Member

@npalm npalm left a comment

Choose a reason for hiding this comment

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

@yangmillstheory thx, looks good and checked.

@npalm npalm merged commit e214177 into github-aws-runners:main Sep 18, 2025
6 checks passed
npalm pushed a commit that referenced this pull request Sep 18, 2025
🤖 I have created a release *beep* *boop*
---


##
[6.7.8](v6.7.7...v6.7.8)
(2025-09-18)


### Bug Fixes

* **dispatcher:** Log org / repository context when unable to match
labels
([#4761](#4761))
([e214177](e214177))
@yangmillstheory
* **lambda:** bump axios from 1.12.1 to 1.12.2 in /lambdas
([#4772](#4772))
([4d0ad0a](4d0ad0a))
* **lambda:** bump axios from 1.8.4 to 1.12.0 in /lambdas
([#4763](#4763))
([bbf1bd8](bbf1bd8))
* **lambda:** bump the aws group in /lambdas with 7 updates
([#4769](#4769))
([7f30dca](7f30dca))
* **lambda:** bump the aws-powertools group in /lambdas with 4 updates
([#4770](#4770))
([dbb6888](dbb6888))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: runners-releaser[bot] <194412594+runners-releaser[bot]@users.noreply.github.com>
LudovicTOURMAN pushed a commit to doctolib-lab/terraform-aws-github-runner that referenced this pull request Apr 7, 2026
…bels (github-aws-runners#4761)

Fixes
github-aws-runners#4760.

Also some code hygiene: use early continue to minimize nesting and a
large `if` block.
LudovicTOURMAN pushed a commit to doctolib-lab/terraform-aws-github-runner that referenced this pull request Apr 7, 2026
🤖 I have created a release *beep* *boop*
---


##
[6.7.8](github-aws-runners/terraform-aws-github-runner@v6.7.7...v6.7.8)
(2025-09-18)


### Bug Fixes

* **dispatcher:** Log org / repository context when unable to match
labels
([github-aws-runners#4761](github-aws-runners#4761))
([e214177](github-aws-runners@e214177))
@yangmillstheory
* **lambda:** bump axios from 1.12.1 to 1.12.2 in /lambdas
([github-aws-runners#4772](github-aws-runners#4772))
([4d0ad0a](github-aws-runners@4d0ad0a))
* **lambda:** bump axios from 1.8.4 to 1.12.0 in /lambdas
([github-aws-runners#4763](github-aws-runners#4763))
([bbf1bd8](github-aws-runners@bbf1bd8))
* **lambda:** bump the aws group in /lambdas with 7 updates
([github-aws-runners#4769](github-aws-runners#4769))
([7f30dca](github-aws-runners@7f30dca))
* **lambda:** bump the aws-powertools group in /lambdas with 4 updates
([github-aws-runners#4770](github-aws-runners#4770))
([dbb6888](github-aws-runners@dbb6888))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: runners-releaser[bot] <194412594+runners-releaser[bot]@users.noreply.github.com>
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.

Add more context when workflow_job event isn't accepted due to label mismatch

3 participants