elastic / elastic/ai-github-actions

[product-manager-impersonator] Import-path safety lint for workflow sources

Open
#1,159 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
11
Forks
16
Avg merge
22h 9m
Merged PRs (30d)
31

Description

## Feature Idea

**Summary:** Add a lightweight `lint-imports` check that validates `imports:` paths in `.github/workflows/gh-aw-*.md` and fails early on accidental non-canonical paths.

## Why a Customer Would Want This
Teams extending or maintaining these workflows need fast, clear feedback when they touch workflow sources. Today, import-path mistakes can be subtle and only surface later in compile/review churn. A dedicated lint check would reduce contributor confusion and prevent avoidable CI noise.

## Rough Implementation Sketch
- Add `scripts/check-workflow-imports.py` to parse frontmatter `imports:` in `.github/workflows/gh-aw-*.md`.
- Enforce local import conventions and flag suspicious paths (especially accidental 3+ segment paths that are interpreted differently by the compiler).
- Wire a new `make lint-imports` target into `make lint`.
- Add a CI step in `.github/workflows/ci.yml` so pull requests fail with actionable file/line errors before compile-time confusion.

## Why It Won't Be That Hard
This is a small, additive static validation: one script plus Makefile/CI wiring. The repository already uses custom lint checks (`scripts/check-nav-catalog.py`), so there is an existing pattern for introducing focused validators without changing runtime workflow behavior.

## Evidence
- `gh-agent-workflows/DEVELOPING.md:109-113` documents a sharp edge: only 2-level import paths are local; 3+ segments are interpreted as remote references.
- `gh-agent-workflows/DEVELOPING.md:145-149` shows contributors are expected to edit workflow sources regularly, increasing the chance of path mistakes.
- `.github/workflows/gh-aw-pr-review.md:5-18` shows long manual `imports:` lists where typo risk is non-trivial.
- `Makefile:243-245` and `.github/workflows/ci.yml:9-33` show current lint coverage does not include semantic validation of workflow import paths.
- Duplicate checks found no direct match:
- `repo:elastic/ai-github-actions is:issue is:open in:title "[product-manager-impersonator]" "import"` → 0
- `repo:elastic/ai-github-actions is:issue "import-path safety lint"` → 0
- Reviewed `/tmp/previous-findings.json`; no previously filed PM-impersonator issue with this proposal.

> [!NOTE]
>
> 🔒 Integrity filter blocked 48 items
>
> The following items were blocked because they don't meet the GitHub integrity level.
>
> - [#334](https://github.com/elastic/ai-github-actions/issues/334) `search_issues`: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
> - [#704](https://github.com/elastic/ai-github-actions/issues/704) `search_issues`: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
> - [#65](https://github.com/elastic/ai-github-actions/issues/65) `search_issues`: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
> - [#333](https://github.com/elastic/ai-github-actions/issues/333) `search_issues`: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
> - [#424](https://github.com/elastic/ai-github-actions/issues/424) `search_issues`: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
> - [#483](https://github.com/elastic/ai-github-actions/issues/483) `search_issues`: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
> - [#353](https://github.com/elastic/ai-github-actions/issues/353) `search_issues`: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
> - [#306](https://github.com/elastic/ai-github-actions/issues/306) `search_issues`: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
> - [#324](https://github.com/elastic/ai-github-actions/issues/324) `search_issues`: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
> - [#192](https://github.com/elastic/ai-github-actions/issues/192) `search_issues`: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
> - [#235](https://github.com/elastic/ai-github-actions/issues/235) `search_issues`: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
> - [#1067](https://github.com/elastic/ai-github-actions/issues/1067) `search_issues`: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
> - [#139](https://github.com/elastic/ai-github-actions/issues/139) `search_issues`: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
> - [#224](https://github.com/elastic/ai-github-actions/issues/224) `search_issues`: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
> - [#321](https://github.com/elastic/ai-github-actions/issues/321) `search_issues`: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
> - [#684](https://github.com/elastic/ai-github-actions/issues/684) `search_issues`: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
> - ... and 32 more items
>
> To allow these resources, lower `min-integrity` in your GitHub frontmatter:
>
> ```yaml
> tools:
> github:
> min-integrity: approved # merged | approved | unapproved | none
> ```
>
>

---
[What is this?](https://ela.st/github-ai-tools) | [From workflow: Trigger Product Manager Impersonator](https://github.com/elastic/ai-github-actions/actions/runs/26397859873)

Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.

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.