Skip to content

Add log-searching-agent workflow with inline preflight search#548

Open
Copilot wants to merge 5 commits intomainfrom
copilot/log-searching-agent-preflight
Open

Add log-searching-agent workflow with inline preflight search#548
Copilot wants to merge 5 commits intomainfrom
copilot/log-searching-agent-preflight

Conversation

Copy link
Contributor

Copilot AI commented Mar 2, 2026

  • Create .github/workflows/gh-aw-log-searching-agent.md — workflow definition with inline preflight script
  • Create gh-agent-workflows/log-searching-agent/example.yml — trigger file with workflow_dispatch inputs
  • Create gh-agent-workflows/log-searching-agent/README.md — documentation
  • Add to excluded workflows in scripts/dogfood.sh
  • Compile the workflow — .lock.yml generated
  • Fix CI failure — recompiled lock.yml to pick up messages-footer format change from main

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

New workflow that downloads GitHub Actions logs for a specified workflow,
searches them for caller-supplied terms (comma-separated exact matches),
and hands the search results to an AI agent for pattern analysis and
triage issue creation.

All preflight logic is inline in the workflow frontmatter steps to
support workflow_call without external script references.

Co-authored-by: strawgate <6384545+strawgate@users.noreply.github.com>
@strawgate strawgate marked this pull request as ready for review March 2, 2026 18:18
@coderabbitai
Copy link

coderabbitai bot commented Mar 2, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 066f4b3 and 0488272.

📒 Files selected for processing (5)
  • .github/workflows/gh-aw-log-searching-agent.lock.yml
  • .github/workflows/gh-aw-log-searching-agent.md
  • gh-agent-workflows/log-searching-agent/README.md
  • gh-agent-workflows/log-searching-agent/example.yml
  • scripts/dogfood.sh

📝 Walkthrough

Walkthrough

This pull request introduces a Log Searching Agent workflow system for GitHub Actions that downloads and searches workflow logs for specified terms within a configurable time window, then analyzes results using an AI agent to identify patterns and file triage issues. The implementation comprises a reusable workflow definition with multi-stage execution (pre-activation, activation, agent, safe outputs, conclusion), a Markdown specification, documentation, an example workflow file, and updates to the dogfood exclusion script.

Possibly related PRs

  • PR #367: Adds new AI agent workflows and similarly modifies scripts/dogfood.sh to exclude the new workflow from synchronization.
🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Linked Issues check ✅ Passed PR fully implements all objectives from issue #547: pre-flight script downloads logs, searches for comma-separated terms, writes results to accessible location, and integrates with agent workflow.
Out of Scope Changes check ✅ Passed All changes directly support log-searching-agent implementation. Only scope-aligned modification is dogfood exclusion in scripts/dogfood.sh, which is appropriate for new agent workflows.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch copilot/log-searching-agent-preflight

Comment @coderabbitai help to get the list of available commands and usage tips.

github-actions[bot]

This comment was marked as resolved.

Copilot AI changed the title [WIP] Add log searching agent with pre-flight script Add log-searching-agent workflow with inline preflight search Mar 2, 2026

## Safe Outputs

- `create-issue` — file a log search investigation report (max 1, auto-closes older reports)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[LOW] Safe output behavior description does not match workflow config

This README says create-issue will "auto-close older reports", but the workflow config sets close-older-issues: false (in .github/workflows/gh-aw-log-searching-agent.md). That mismatch can mislead users about issue lifecycle behavior.

Suggested change
- `create-issue` — file a log search investigation report (max 1, auto-closes older reports)
- `create-issue` — file a log search investigation report (max 1)

@fr4nc1sc0-r4m0n
Copy link
Contributor

@copilot Will be feasible to execute this log-searching-agent over all the defined workflows in the repository?

…rom main)

Co-authored-by: fr4nc1sc0-r4m0n <215478872+fr4nc1sc0-r4m0n@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Mar 4, 2026

@copilot Will be feasible to execute this log-searching-agent over all the defined workflows in the repository?

Yes — the caller's trigger workflow can use a GitHub Actions matrix strategy to fan out over all (or a subset of) workflows. For example:

jobs:
  discover:
    runs-on: ubuntu-latest
    outputs:
      workflows: ${{ steps.list.outputs.workflows }}
    steps:
      - id: list
        run: |
          workflows=$(gh api repos/${{ github.repository }}/actions/workflows \
            --jq '[.workflows[].path | split("/")[-1]] | tojson')
          echo "workflows=$workflows" >> "$GITHUB_OUTPUT"
        env:
          GH_TOKEN: ${{ github.token }}

  search:
    needs: discover
    strategy:
      matrix:
        workflow: ${{ fromJSON(needs.discover.outputs.workflows) }}
    uses: elastic/ai-github-actions/.github/workflows/gh-aw-log-searching-agent.lock.yml@v0
    with:
      workflow: ${{ matrix.workflow }}
      search-terms: "OutOfMemoryError, DEADLINE_EXCEEDED"
    secrets:
      COPILOT_GITHUB_TOKEN: ${{ secrets.COPILOT_GITHUB_TOKEN }}

Each matrix leg runs the preflight search + agent independently, so you get a separate triage issue per workflow when actionable findings exist. The discover job can also filter the list (e.g., skip workflows by name pattern) before passing to the matrix.

Copy link
Contributor

@fr4nc1sc0-r4m0n fr4nc1sc0-r4m0n left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@fr4nc1sc0-r4m0n
Copy link
Contributor

@strawgate Do you think we can merge this?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants