Skip to content

Add daily fixer agentic workflow for 'Resource not accessible by integration' across long-term branches #424

Description

@fr4nc1sc0-r4m0n

Daily fixer for “Resource not accessible by integration” across long-term branches

Analysis

  • The repository already has reusable patterns for failed-run analysis and remediation in ./.github/workflows/gh-aw-pr-actions-detective.md, ./.github/workflows/gh-aw-pr-actions-fixer.md, and scheduled fixer scaffolding in ./.github/workflows/gh-aw-scheduled-fix.md.
  • The requested workflow must run every 24 hours, scan failed workflow executions from the last 24h, detect the exact error text Resource not accessible by integration, and open remediation PRs.
  • PR granularity is defined: one PR per failing workflow.
  • Scope is defined: default branch plus all long-term branches (release branches included).
  • Remediation instructions must be loaded from the external source at runtime: https://github.com/elastic/observability-cicd/blob/main/github-actions/actionable/alerts/app/prompts/accessible-by-integration.txt.
  • Review process is defined: generated PRs must request review from the elastic/observablt-ci team and remain pending until approval (no auto-merge behavior).

Implementation Plan

  1. Create specialized workflow source (./.github/workflows/gh-aw-resource-not-accessible-by-integration-fixer.md):

    • Add a new gh-aw workflow with workflow_call inputs, safe PR output, and Actions read + PR write permissions.
    • Base structure on existing detective/fixer workflows so behavior is consistent with current repo conventions.
    • Why: this is the canonical source that compiles into the distributable lock workflow.
  2. Implement 24h scan and branch coverage logic (./.github/workflows/gh-aw-resource-not-accessible-by-integration-fixer.md):

    • Instruct the agent to query failed runs created in the last 24 hours and include all long-term branches (default + configured release branches).
    • Add explicit input for long-term branch patterns/names so consumers can define their branch set without code changes.
    • Why: ensures deterministic daily coverage for default and release maintenance lines.
  3. Implement error detection and per-workflow PR fan-out (./.github/workflows/gh-aw-resource-not-accessible-by-integration-fixer.md):

    • Parse run/job logs and match exact error text Resource not accessible by integration.
    • Group findings by failing workflow and create exactly one PR per failing workflow (branch-aware to avoid collisions).
    • Skip PR creation when no matching failures are found.
    • Why: aligns with requested PR granularity and avoids mixed, hard-to-review remediation PRs.
  4. Load and apply external remediation instructions (./.github/workflows/gh-aw-resource-not-accessible-by-integration-fixer.md):

    • Require runtime fetch of the remediation prompt from the provided observability-cicd URL via web-fetch.
    • Require the agent to follow those instructions as the primary fix policy when patching workflow permissions/config.
    • Why: guarantees fixes follow the mandated centralized guidance.
  5. Enforce PR description and review assignment requirements (./.github/workflows/gh-aw-resource-not-accessible-by-integration-fixer.md):

    • Require each generated PR body to include: affected workflow/run links, exact failure evidence, root cause, and remediation approach applied.
    • Require reviewer request for team elastic/observablt-ci and keep PR unmerged/pending approval.
    • Why: satisfies governance and traceability requirements for automated changes.
  6. Add consumer trigger with 24h cadence (./gh-agent-workflows/resource-not-accessible-by-integration-fixer/example.yml):

    • Add schedule trigger to run once every 24 hours plus workflow_dispatch for manual execution.
    • Wire required secrets/permissions and pass branch-scope input defaults.
    • Why: provides installable, ready-to-use workflow entrypoint for target repositories.
  7. Document usage and operational behavior (./gh-agent-workflows/resource-not-accessible-by-integration-fixer/README.md):

    • Document cadence, 24h scan window, branch scope configuration, per-workflow PR behavior, and required review team assignment.
    • Document dependency on external instructions URL and failure/noop behavior.
    • Why: makes rollout and operations predictable for adopters.
  8. Register in workflow catalogs and setup automation (./gh-agent-workflows/README.md, ./docs/workflows/gh-agent-workflows.md, ./scripts/quick-setup.sh):

    • Add the new workflow to workflow listings/docs.
    • Add it to continuous_improvement_workflows in quick-setup.
    • Why: ensures discoverability and inclusion in the continuous-improvement install set.
  9. Compile and validate repository artifacts (./Makefile):

    • Run make compile to generate lock workflow and dogfood trigger artifacts.
    • Run make lint to validate workflows/actions.
    • Perform a smoke test in a test repo: (a) no matching error -> no PR, (b) matching error -> one PR per failing workflow with required body and team review request.
    • Why: confirms generated artifacts and runtime behavior before merge.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions