Skip to content

ci-pipeline-monitor issue filing script#127929

Open
kg wants to merge 7 commits intodotnet:mainfrom
kg:ci-pipeline-monitor-issue-filing
Open

ci-pipeline-monitor issue filing script#127929
kg wants to merge 7 commits intodotnet:mainfrom
kg:ci-pipeline-monitor-issue-filing

Conversation

@kg
Copy link
Copy Markdown
Member

@kg kg commented May 7, 2026

This PR adds a manually triggered script that will generate github issues/comments from failures in the CI pipeline monitor skill's database. Teaching the agent to invoke the script is left as a future exercise, it's quite easy to manually trigger the script after running the agent.

By default it runs in 'dry run' mode and just prints what it would do, you have to explicitly pass --go to tell it to issue gh commands.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a new manually-invoked Python script under the ci-pipeline-monitor skill to generate GitHub issues and/or add comments based on rows in the monitor’s SQLite database, defaulting to a dry-run unless --go is provided.

Changes:

  • Add update_github.py script to read failures from monitor.db and prepare gh issue create / gh issue comment commands.
  • Generate a formatted Markdown body (via --body-file) including pipeline links, console log/source links, and failure details for new issues.

Comment thread .github/skills/ci-pipeline-monitor/scripts/update_github.py Outdated
Comment thread .github/skills/ci-pipeline-monitor/scripts/update_github.py Outdated
Comment thread .github/skills/ci-pipeline-monitor/scripts/update_github.py Outdated
@kg kg marked this pull request as ready for review May 8, 2026 16:45
Copilot AI review requested due to automatic review settings May 8, 2026 16:45
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 8 comments.

Comment on lines +4 to +5
You must have done `gh repo set-default` at least once on the current checkout for this to work.

Comment thread .github/skills/ci-pipeline-monitor/scripts/update_github.py
Comment thread .github/skills/ci-pipeline-monitor/scripts/update_github.py Outdated
Comment thread .github/skills/ci-pipeline-monitor/scripts/update_github.py Outdated
Comment on lines +97 to +113
# Failed in — JOIN with pipelines to guarantee build_id/build_number
affected = list(cur.execute(
"SELECT fp.pipeline_name, "
"COALESCE(fp.build_id, p.build_id) AS build_id, "
"COALESCE(fp.build_number, p.build_number) AS build_number "
"FROM failure_pipelines fp "
"LEFT JOIN pipelines p ON fp.pipeline_name = p.name "
"WHERE fp.failure_id = ? ORDER BY fp.pipeline_name",
(fail["id"],)
))
out.append(f"**Failed in ({len(affected)}):**")
for ap in affected:
bn = ap["build_number"] or ""
out.append(
f"- [{ap['pipeline_name']} {bn}]"
f"(https://dev.azure.com/{ADO_ORG}/{ADO_PROJECT}/_build/results?buildId={ap['build_id']})"
)
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This looks like it probably needs fixing both here and in generate_report, does it make sense to you @JulieLeeMSFT ? I can fix it in both if you think it is worth fixing. But I don't know how we would get a failure without a build id.

Comment thread .github/skills/ci-pipeline-monitor/scripts/update_github.py Outdated
Comment thread .github/skills/ci-pipeline-monitor/scripts/update_github.py Outdated
Comment thread .github/skills/ci-pipeline-monitor/scripts/update_github.py Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-skills Agent Skills

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants