elastic / elastic/integrations

[bug-hunter] validate-package-docs excludes nested docs paths from validation

Open
#18,068 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Handlebars
Stars
333
Forks
647
Avg merge
3d 4h
Merged PRs (30d)
209

Description

## Impact
Changes to nested package docs such as `packages/(pkg)/docs/knowledge_base/*.md` are not validated by the `Validate Package Docs` workflow. This allows broken docs content to merge without any docs-builder signal, which can surface as broken published/package docs later.

## Reproduction Steps
1. I wrote and ran this minimal repro script:

```bash
#!/usr/bin/env bash
set -euo pipefail

# Reproduce the file-filter logic from validate-package-docs.yml
changed_files=$'packages/tcp/docs/knowledge_base/service_info.md\npackages/tcp/docs/README.md'

echo "Input changed files:"
printf '%s\n' "$changed_files"

echo
# Exact regex used in workflow step "Get changed docs files"
matched=$(printf '%s\n' "$changed_files" | grep '^packages/.*/docs/[^/]*\.md$' || true)

echo "Matched by workflow regex ^packages/.*/docs/[^/]*\\.md$:"
if [[ -n "$matched" ]]; then
printf '%s\n' "$matched"
else
echo "(none)"
fi

echo
if printf '%s\n' "$matched" | grep -q 'knowledge_base/service_info.md'; then
echo "UNEXPECTED: nested docs file matched"
exit 1
else
echo "Observed: nested docs file is excluded from validation input"
fi
```

2. Run it:

```bash
bash /tmp/gh-aw/agent/repro_validate_nested_docs.sh
```

## Expected vs Actual
**Expected:** Nested docs files (for example `packages/tcp/docs/knowledge_base/service_info.md`) should be included for validation.

**Actual:** Only top-level `docs/*.md` files match; nested docs files are excluded.

Observed output:

```text
Input changed files:
packages/tcp/docs/knowledge_base/service_info.md
packages/tcp/docs/README.md

Matched by workflow regex ^packages/.*/docs/[^/]*\.md$:
packages/tcp/docs/README.md

Observed: nested docs file is excluded from validation input
```

## Failing Test
The script above is a minimal failing reproduction of the workflow’s current changed-file filter logic.

## Evidence
- `.github/workflows/validate-package-docs.yml:7-8` only triggers on:
- `packages/*/docs/*.md`
- `packages/*/*/docs/*.md`
- `.github/workflows/validate-package-docs.yml:28-30` applies:
- `grep '^packages/.*/docs/[^/]*\.md$'`
- This regex explicitly excludes nested docs paths (contains `/` after `docs/`).

This is distinct from #18035 (deleted docs being skipped via `--diff-filter=d`): this issue affects non-deleted nested docs paths.

> [!NOTE]
>
> 🔒 Integrity filtering filtered 1 item
>
> Integrity filtering activated and filtered the following item 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:#unknown (`search_issues`: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".)
>
>

---
[What is this?](https://ela.st/github-ai-tools) | [From workflow: Bug Hunter](https://github.com/elastic/integrations/actions/runs/23591587922)

Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.
> - [x] expires on Apr 2, 2026, 11:29 AM UTC

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.