elastic / elastic/ai-github-actions
[framework-best-practices] Expand ci-tests path filters to include tested source files
- Dominant language
- Python
- Stars
- 11
- Forks
- 16
- Avg merge
- 22h 9m
- Merged PRs (30d)
- 31
Description
## Framework / Library Best Practices Findings
### 1. CI test workflow underuses GitHub Actions path filtering for tested source files
**Library:** GitHub Actions workflow syntax (paths filters) + `pytest>=8.0` test suite from `pyproject.toml`.
**Library feature:** `on.pull_request.paths` / `on.push.paths` can include all source files covered by tests so tests run whenever tested code changes.
**Current code:**
- `.github/workflows/ci-tests.yml:4-13` only triggers on:
- `.github/workflows/gh-aw-fragments/**`
- `tests/**`
- `pyproject.toml`
- But tests explicitly target source files outside those paths:
- `tests/test_fetch_workflow_logs.py:6` imports `scripts/fetch-workflow-logs.py`
- `tests/test_extract_log_errors.py:7-9` imports `scripts/extract-log-errors.py`
- `tests/test_check_nav_catalog.py:9` imports `scripts/check-nav-catalog.py`
- `tests/test_docs_hooks.py:6` imports `docs/hooks.py`
**Simplification:**
Use workflow-native path filters to include the tested source locations directly (for example `scripts/**` and `docs/hooks.py`) instead of relying on a narrower hand-curated list. This keeps triggers aligned with what the test suite actually exercises.
**Why it matters:**
Changes to tested code can currently skip the `ci-tests` workflow, allowing regressions in `scripts/*` or `docs/hooks.py` to merge without running pytest. Expanding `paths` reduces this gap with a small, native workflow change.
**Documentation:**
- https://docs.github.com/actions/using-workflows/workflow-syntax-for-github-actions#onpushpull_requestpull_request_targetpathspaths-ignore
## Suggested Actions
- [ ] Update `.github/workflows/ci-tests.yml` `pull_request.paths` and `push.paths` to include `scripts/**` and `docs/hooks.py` (and any other tested source paths).
- [ ] Keep path filters synchronized with files imported by tests to prevent future coverage drift.
---
[What is this?](https://ela.st/github-ai-tools) | [From workflow: Trigger Framework Best Practices](https://github.com/elastic/ai-github-actions/actions/runs/26956707350)
Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.
Contributor guide
Assessment
This issue has not been assessed yet.