Skip to content

[ci] Add failure notification for package docs validation#18034

Merged
theletterf merged 5 commits intomainfrom
ci/docs-validation-notify
Mar 25, 2026
Merged

[ci] Add failure notification for package docs validation#18034
theletterf merged 5 commits intomainfrom
ci/docs-validation-notify

Conversation

@theletterf
Copy link
Copy Markdown
Member

@theletterf theletterf commented Mar 25, 2026

Summary

  • Adds a notification workflow (notify-package-docs-failure.yml) that comments on PRs when docs-builder validation finds errors, mentioning @elastic/ingest-docs
  • The validation check remains non-blocking (continue-on-error: true) to avoid false blocking on unknown edge cases

How it works

  1. The existing validate-package-docs.yml workflow runs docs-builder against changed package docs
  2. If docs-builder exits non-zero, it uploads a docs-validation-failed artifact containing the PR number
  3. A separate workflow_run-triggered workflow (notify-package-docs-failure.yml) downloads the artifact and posts a PR comment
  4. No artifact = no comment (clean builds are silent)
  5. Duplicate comments are avoided — it checks for existing comments before posting

Why workflow_run?

The validation workflow only has contents: read (safe for pull_request from forks). The notification needs pull-requests: write to comment. workflow_run always runs in the base branch context, so it can safely hold write permissions without exposing secrets.

🤖 Generated with Claude Code

- Remove continue-on-error from validate-package-docs so it properly
  blocks PRs with doc issues
- Add a separate workflow_run-triggered workflow that posts a comment
  mentioning @elastic/ingest-docs when validation fails
- The notification workflow uses workflow_run (runs in base branch
  context) so it can safely have pull-requests: write without exposing
  secrets to fork PRs

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@theletterf theletterf requested a review from a team as a code owner March 25, 2026 11:23
The validation step stays non-blocking (continue-on-error: true) but
uploads a "docs-validation-failed" artifact when docs-builder exits
non-zero. The notification workflow downloads this artifact — if it
exists, it posts a PR comment mentioning @elastic/ingest-docs.

This avoids false blocking on unknown edge cases while still surfacing
doc issues to the right team.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@theletterf
Copy link
Copy Markdown
Member Author

+CC @mrodm

Comment thread .github/workflows/notify-package-docs-failure.yml Outdated
Comment thread .github/workflows/notify-package-docs-failure.yml
Comment thread .github/workflows/validate-package-docs.yml Outdated
- Use env var for github.event.pull_request.number instead of inline
  interpolation in shell (validate-package-docs.yml)
- Use env var for github.repository instead of inline interpolation
  in shell (notify-package-docs-failure.yml)
- Use --body-file instead of --body for multi-line comment to avoid
  shell quoting issues

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@theletterf
Copy link
Copy Markdown
Member Author

@mrodm Feedback addressed, please have another look

@theletterf theletterf requested a review from mrodm March 25, 2026 13:38
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@theletterf theletterf self-assigned this Mar 25, 2026
@theletterf theletterf added the ci label Mar 25, 2026
Copy link
Copy Markdown
Collaborator

@mrodm mrodm left a comment

Choose a reason for hiding this comment

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

Thanks! 👍

@theletterf theletterf merged commit add27d4 into main Mar 25, 2026
9 checks passed
@theletterf theletterf deleted the ci/docs-validation-notify branch March 25, 2026 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants