Commit Graph

22 Commits

Author SHA1 Message Date
Abhitej John 134917c42c fix: reinforce no-script-execution constraint in devops-health-check (#845)
* fix: reinforce no-script-execution constraint in devops-health-check

The agent was hallucinating Python script creation (run_analysis2.py)
and attempting to execute it, which was correctly blocked by the bash
allowlist security policy. Strengthen the efficiency guideline to
explicitly state that python/python3/node are NOT in the bash
allowlist and will be blocked, directing the agent to use jq instead.

Fixes #841

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix: narrow wording to 'general-purpose language runtimes' per review

Addresses review feedback: 'any script interpreter' was too broad since
jq/sed are technically interpreters but ARE in the allowlist.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-07-07 08:33:48 -07:00
Jeff Handley 11c5dfc738 Require environment input to pat_pool shared workflow. (#832)
* Require environment input to pat_pool shared workflow.

- Updates the PAT pool shared workflow to latest version
- Updates the validate-pat-pool workflow to match other repos
- Updates all agentic workflows to use the updated PAT pool import
  with the standard secret names used across other repos
- The new version of the import does not require the 'needs' workaround
  but the issue-triage workflow's 'roles: all' configuration requires
  a different workaround to ensure the pre_activation job exists for
  the pat_pool job to be able to depend on it (necessary for ordering).

* Update markdown bullet style

* Apply Copilot PR feedback

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Bump versions to match gh-aw

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-06-25 15:35:22 -07:00
Amaury Levé d656edc4f2 fix(devops-health): stop recurring groom node_id and health-check tool/token failures (#815)
* fix(devops-health): stop recurring groom node_id and health-check tool/token failures

Groom (fixes 780/792/797): MCP issue_read(get_comments) sometimes omits node_id, which hide-comment requires. The agent was reporting missing_data and failing the run. Make node_id best-effort: skip hiding comments without a node_id and continue; the weekly cleanup workflow removes them by age.

Health check (fixes 810/791/788): the agent attempted sed and git commands (incl. manual git plumbing on the cache-memory dir) that the bash allowlist denied, looping on the denials and exhausting the 25M effective-token budget. Add sed and git to the allowlist, and add guidelines to not git-manage cache-memory and not retry denied commands.

Recompiled lock files with pinned gh-aw v0.77.5.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix(groom): clarify skipped-comment count goes in noop summary only

Address PR review: Step 6 only emits a summary via noop when no other safe-output calls were made, so 'note in the Step 6 summary' was misleading. Track the skipped count internally and include it in the noop message only when that summary is emitted.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-06-24 11:00:39 +02:00
Jan Krivanek 78f3f755e7 Migrate Copilot PAT rotation to shared pat_pool import (#743)
Adopt the shared workflow import pattern from dotnet/runtime PR #127946,
replacing the per-workflow select-copilot-pat action + custom job (shipped in
#736) with a reusable shared/pat_pool.md import.

What changed:
- Add .github/workflows/shared/pat_pool.md: an import that defines a `pat_pool`
  job (inline bash, no separate action) exposing a `pat_number` output, plus an
  import-schema mapping COPILOT_PAT_0..7 to this repo's pool secrets
  (COPILOT_GITHUB_TOKEN, COPILOT_GITHUB_TOKEN_2..8).
- Add .github/workflows/shared/pat_pool.README.md documenting the pattern.
- Convert all 8 agentic workflows to `imports: - shared/pat_pool.md` +
  `engine.env` `case(needs.pat_pool.outputs.pat_number ...)`.
- Delete the now-unused .github/actions/select-copilot-pat action.
- Add .github/workflows/validate-pat-pool.yml: a daily standalone workflow that
  validates each pool PAT with a Copilot CLI request and summarizes pool health.

Wiring note (adaptation from runtime): consuming workflows declare
`on.needs: [pat_pool]` instead of runtime's `needs: [pre_activation]` +
`on.permissions: {}`. This wires pat_pool ahead of the pre_activation and
activation jobs so the selected PAT is validated by the activation job and used
by the agent, and it works for `roles: all` workflows (issue-triage), which do
not produce a pre_activation job for the runtime workaround to attach to.

Compiled with gh-aw v0.77.5. Verified end-to-end with a temporary
test-pat-rotation workflow (since removed): a run selected token #2 of the
3-token pool and the agent job observed pat_number='2', confirming the rotated
PAT reaches the agent.
2026-06-10 10:20:09 +02:00
Jan Krivanek cc0621e2ac Fix Copilot PAT rotation for gh-aw v0.77.5 runtime (#736)
* Fix Copilot PAT rotation for gh-aw v0.77.5 runtime

The PAT-rotation stop-gap wired the rotated token into engine.env via needs.pre_activation.outputs.copilot_pat_number. Because the compiled agent job depends only on 'activation' (not the built-in 'pre_activation'), that needs reference evaluated to an empty string in the agent job, so the case() fell through to the default COPILOT_GITHUB_TOKEN and rotation never reached the agent. gh-aw v0.77.5 surfaces this as a compiler warning.

Replace the pre_activation step-injection with a 'select_copilot_pat' custom job wired via on.needs. As a user-defined job referenced in engine.env, the compiler makes it a direct dependency of the agent job, so needs.select_copilot_pat.outputs.copilot_pat_number resolves correctly in both the activation and agent jobs. Same action, same secret pool, same case() expression. Recompiled all workflows with gh-aw v0.77.5.

* Add temporary test-pat-rotation workflow to validate rotation

Non-destructive pull_request-triggered workflow that selects a pool token and asserts, in the agent job, that needs.select_copilot_pat.outputs.copilot_pat_number is non-empty (the exact value that was silently empty with the old pre_activation wiring). To be removed after validation.

* Work around gh-aw v0.77.5 invalid-YAML rendering of top-level if

gh-aw v0.77.5 emits the top-level frontmatter `if:` on the built-in
pre_activation job WITHOUT a ${{ }} wrapper. When the condition starts with
`!` (the fork guards), the emitted `if: !(...)` is invalid YAML (a leading `!`
starts a YAML tag), which GitHub rejects as a workflow-file startup failure.
v0.68.3 wrapped it (valid); v0.77.5 does not. Confirmed independent of the
PAT-rotation change via a minimal probe.

Wrap the fork-guard conditions in parentheses so the emitted scalar starts
with `(` instead of `!` (semantically identical). Affects close-stale-prs,
devops-health-check, devops-health-groom, markdown-linter, pr-malicious-scan.

* Update select-copilot-pat README for the custom-job + on.needs pattern

* Remove temporary test-pat-rotation workflow (rotation validated)
2026-06-09 19:58:25 +02:00
Jan Krivanek 7bd6628e91 fix(devops-health): resilient dashboard issue discovery (#737)
The health check located its dashboard issue solely via the devops-health label search. When GitHub silently dropped the pinned dashboard (#288) from its issue search/list index, the workflow could not find it, created a duplicate (#695), and abandoned the pinned issue -- leaving the pinned dashboard stale for days.

Step 4.1 now resolves the dashboard by a cached issue number first (updating it directly by number, which works even when the issue is missing from search), persists that number to cache-memory every run, falls back to label + pinned-issue lookup, and consolidates duplicates. Documents the new health-dashboard-issue cache key.

Lock file unchanged: the prompt body is runtime-imported from these .md files.
2026-06-09 17:47:06 +00:00
Jan Krivanek 205e9f54e2 fix(groom): prune resolved rows, add First Seen column, handle duplicate sections (#637)
* fix(groom): prune resolved rows, add First Seen column, handle duplicate sections

- Rename 'Status' column to 'Investigation' for clarity
- Add 'First Seen' column showing when finding was first detected
- Remove resolved investigation rows instead of keeping them forever
- Handle duplicate Investigation Results sections by merging into one
- Update health-check workflow to use matching column schema
- Drop resolved rows from health-check table preservation logic

* fix(health-check): remove duplicate Investigation Results section

The health-check and groom workflows both created a '## Investigation
Results' section, causing duplicates in issue #288. The groom owns this
section via its replace-island block — remove it from the health-check
template and update the guideline accordingly.

* fix(health-check): restore Investigation Results as placeholder section

The health-check replaces the entire issue body, so removing the section
entirely caused it to disappear. Instead, keep it as a placeholder that:
- Preserves existing rows from the groom's island markers
- Appends new 'Dispatched' rows for findings dispatched in this run
- Does NOT add island markers itself (the groom adds those)

This ensures the section survives health-check body rewrites while the
groom still owns the detailed content via replace-island.

* fix: address PR review comments on groom/health-check workflows

- Fix duplicate section guidance: clarify replace-island only updates
  first occurrence, doesn't auto-remove later duplicates
- Match example dispatched row text with health-check template
- Fix First Seen source: parse from summary line (first seen YYYY-MM-DD)
  instead of non-existent **First seen:** field
- Preserve all non-resolved rows (not just Done rows) in health-check
- Fix Step 4.2 to align with prune behavior in Step 4.3
- Add schema migration for legacy 4-column tables in health-check
- Add link to dispatched investigation rows
2026-05-11 20:31:24 +02:00
Jan Krivanek 70e2d3b333 Simplify the focus of devops health workflows (#521)
* Simplify the focus of devops health workflows

* Updated gh-aw and recompiled

* Fix scope wording to include resource usage per review feedback
2026-04-13 17:39:20 +02:00
Jan Krivanek a331d0994e Fix the devops health workflows after gh-aw update (#511) 2026-04-09 20:10:13 +02:00
Jan Krivanek 070f8b4648 Add pats rotation to agentic workflows (#500)
* Copy PATs rotation from dotnet/core

* Recompile agentic workflows with gh-aw v0.67.1

Remove unsupported 'failure' safe-output (dropped in gh-aw v0.67.1).
Regenerate lock files with the new compiler version.
No functional changes.

* Add Copilot PAT pool rotation to agentic workflows

Use the select-copilot-pat action to randomly select from a pool of
COPILOT_GITHUB_TOKEN / COPILOT_GITHUB_TOKEN_2..8 secrets, distributing
Copilot API load across multiple PATs.

This is a stop-gap until organization-level billing is available for
Agentic Workflows. See .github/actions/select-copilot-pat/README.md.
2026-04-07 12:37:30 +02:00
Jan Krivanek e6250320e8 Clean the agentic workflows report bugs (#474) 2026-03-30 12:45:24 +00:00
Jan Krivanek 5a199da6f6 Fix the compilation issues with devops agentic workflows (#353) 2026-03-13 10:04:28 +01:00
Jan Krivanek 4a4306f563 Disable scheduled workflows on forks (#318)
* Disable schedules on forks

* Reflect PR comments
2026-03-11 10:17:01 +01:00
Jan Krivanek d709e0b55a Add checking for orphaned skills/plugins (#291) 2026-03-09 14:23:07 +01:00
Jan Krivanek a9335d4116 Workaround gh-aw concurrency group issue (#290)
* Workaround gh-aw concurrency group issue

* Clarify concurrency bug comment per code review

Rephrase comment to make clear the bug causes mutual cancellation,
not a 2-run limit. The 2-run cap is the workaround, not the bug.

Co-authored-by: Copilot <copilot@github.com>

---------

Co-authored-by: Copilot <copilot@github.com>
2026-03-09 11:55:18 +01:00
Jan Krivanek 941fedb937 [Infra] Harden the health check groomer (#260)
* Harden the health check groomer

* Fix pr comment
2026-03-06 13:47:38 +01:00
Jan Krivanek e4c7b43b5b [Infra] Improve resiliency of health checks (#256)
* Increase timeout and make sharing info resilient to cache eviction

* Fix path
2026-03-06 10:06:31 +01:00
Jan Krivanek 1f02fab51f [Infra] Improve the daily health check (#215)
* Improve the daily health check

* Reflect PR comments
2026-03-05 10:23:47 +01:00
Jan Krivanek 29846573f6 [Infra] Improving health check aw (#187)
* Update the issue update mask

* Improve pipeline issues detection

* Reflect PR comments
2026-03-04 14:17:23 +01:00
Copilot 61a4f0b540 Fix stale src/ paths in devops-health-check.md after folder rename to plugins/ (#175)
* Initial plan

* Fix incorrect src/ paths to plugins/ in devops-health-check.md

Co-authored-by: timheuer <4821+timheuer@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: timheuer <4821+timheuer@users.noreply.github.com>
2026-03-04 09:16:18 +01:00
Jan Krivanek 66b8659ec3 [Infra] Fix devops aw (#167)
* Fix devops-aw triggering

* fix: add pull_request to pre_activation gate so PR trigger works

* fix: enable deep investigation dispatches

- Fix COPILOT_GITHUB_TOKEN in investigate workflow to use _3 (fine-grained PAT)
- Strengthen Step 5 dispatch instructions to be MANDATORY
- Add first-run note: all critical findings must be dispatched
- Add verification checklist before finishing

* fix: update frontmatter hash to match .md source

* fix: investigation uses add-comment instead of update-issue

update-issue fails on workflow_dispatch (no triggering issue context).
Switch to add-comment with explicit item_number targeting the health issue.
Remove update_issue from safe-outputs config, tools, and validation.

* fix: address PR review feedback

- Fix concurrency group: use stable ref-based key with cancel-in-progress
  instead of run_id which defeated mutual exclusion (reviewer feedback)
- Remove temporary pull_request trigger and pre_activation gating
  (was only needed for testing, reviewer correctly flagged mismatch)
- Remove slash command references from docs and shared knowledge
  since slash_command trigger was removed (reviewer feedback)
2026-03-03 16:21:10 +01:00
Jan Krivanek 7b2708f8c7 [Infra] Add devops agentic workflow (#141)
* Add initial plan

* add token strategy

* Add devops agentic workflow PoC

* Fix PR Comments

* Replace hand-written .yml wrappers with gh aw compile

- Move workflow .md files from eng/agentic-workflows/ to .github/workflows/
- Delete hand-written .yml wrappers (devops-health-check.yml, devops-health-investigate.yml)
- Generate .lock.yml files via gh aw compile
- Move compiled knowledge files to .github/aw/shared/ (required by gh-aw import security)
- Fix permissions: issues: write -> issues: read (strict mode uses safe-outputs)
- Update README with new file structure and setup instructions

Addresses PR #141 Comment 5 (ViktorHofer)

* Use fuzzy daily schedule, update README for gh-aw standard structure

* Recompile lock.yml with latest changes

* Add skills health

* Remove redundant file
2026-03-02 21:59:28 +01:00