[bug-hunter] notify-package-docs-failure can skip commenting on the triggering PR when a commit belongs to multiple PRs
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
Research direction
Start with .github/workflows/notify-package-docs-failure.yml:42-46 and compare its commit-to-PR selection with the PR_NUMBER written in .github/workflows/validate-package-docs.yml:86. Run the minimal reproduction and failing assertion from the issue; done means the triggering PR is recognized when its number appears anywhere in the commit’s PR list.
Written by the indexing model from the issue text.
Description
Impact
When package docs validation fails, the notification workflow can silently skip posting a comment on the triggering PR if the same head_sha is associated with multiple PRs. This hides actionable failure feedback from maintainers/reviewers and weakens the intended PR gate UX.
Reproduction Steps
- Observe the workflow logic in
.github/workflows/notify-package-docs-failure.yml:- It reads the triggering PR number from the artifact (
PR_NUMBER). - It fetches PRs for the commit SHA and selects only the first one:
--jq '.[0].number'. - It exits early when
PR_NUMBER != ACTUAL_PR.
- It reads the triggering PR number from the artifact (
- Run this minimal reproduction script:
python - <<'PY'
import json
def should_comment(pr_number, pulls_json):
actual_pr = str(json.loads(pulls_json)[0]["number"]) if json.loads(pulls_json) else ""
return pr_number == actual_pr, actual_pr
# Repro: same HEAD SHA associated with multiple PRs; artifact points to triggering PR=42
pr_number = "42"
pulls = '[{"number": 17}, {"number": 42}]'
comment, actual = should_comment(pr_number, pulls)
print(f"artifact_pr={pr_number}")
print(f"api_pulls={pulls}")
print(f"selected_actual_pr={actual}")
print(f"comment_posted={comment}")
if not comment:
print("BUG: workflow would exit early and skip commenting on the triggering PR")
PY
Expected vs Actual
Expected: If the artifact PR number is present in the commit→PR list, the workflow should comment on that triggering PR.
Actual: The workflow uses only the first PR from the list (.[0].number), so it exits early when ordering does not match the artifact PR. Reproduction output:
artifact_pr=42
api_pulls=[{"number": 17}, {"number": 42}]
selected_actual_pr=17
comment_posted=False
BUG: workflow would exit early and skip commenting on the triggering PR
Failing Test
import json
def should_comment(pr_number, pulls_json):
actual_pr = str(json.loads(pulls_json)[0]["number"]) if json.loads(pulls_json) else ""
return pr_number == actual_pr
assert should_comment("42", '[{"number": 17}, {"number": 42}]')
The assertion fails because only the first PR is considered.
Evidence
.github/workflows/notify-package-docs-failure.yml:42-46ACTUAL_PR=$(gh api "repos/\$\{REPO}/commits/\$\{HEAD_SHA}/pulls" --jq '.[0].number' ...)if [ "$PR_NUMBER" != "$ACTUAL_PR" ]; then ... exit 0
.github/workflows/validate-package-docs.yml:86- The artifact explicitly stores the triggering PR number (
echo "\$\{PR_NUMBER}" > .../pr_number).
- The artifact explicitly stores the triggering PR number (
This mismatch in selection strategy makes notification delivery depend on API ordering rather than the known triggering PR.
[!NOTE]
🔒 Integrity filtering filtered 6 items
Integrity filtering activated and filtered the following items during workflow execution.
This happens when a tool call accesses a resource that does not meet the required integrity or secrecy level of the workflow.
- issue:elastic/integrations#unknown (
search_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".)- issue:elastic/integrations#17857 (
issue_read: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".)- issue:elastic/integrations#17875 (
issue_read: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".)- issue:elastic/integrations#18099 (
issue_read: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".)- issue:elastic/integrations#18068 (
issue_read: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".)- issue:elastic/integrations#18180 (
issue_read: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".)
What is this? | From workflow: Bug Hunter
Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.
- expires on Apr 9, 2026, 11:29 AM UTC
- Dominant language
- Handlebars
- Stars
- 334
- Forks
- 652
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 241
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from elastic/integrations
-
automation flaky-test Integration:kafka_input_otel Team:obs-ds-intake-services
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
elastic/integrations#21427 ·
-
automation flaky-test Integration:mysql_input_otel Team:Obs-InfraObs
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
elastic/integrations#21426 ·
-
automation flaky-test Integration:jaeger_input_otel Team:obs-ds-intake-services
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
elastic/integrations#21418 ·
-
automation flaky-test Integration:jaeger_input_otel Team:obs-ds-intake-services
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
elastic/integrations#21413 ·
-
automation flaky-test Integration:googlecloudmonitor_input_otel Team:Obs-InfraObs
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
elastic/integrations#21350 ·
All issues in elastic/integrations
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 84/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
sympozium-ai/sympozium#627 ·
-
repo:raw-data
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
hotosm/raw-data-api#316 · 1 comment ·
-
agentic-workflows cascade-suspected
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
willow
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
openedx/openedx-authz#460 ·