ci-pipeline-monitor issue filing script#127929
Open
kg wants to merge 7 commits intodotnet:mainfrom
Open
Conversation
Contributor
There was a problem hiding this comment.
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.pyscript to readfailuresfrommonitor.dband preparegh issue create/gh issue commentcommands. - Generate a formatted Markdown body (via
--body-file) including pipeline links, console log/source links, and failure details for new issues.
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 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']})" | ||
| ) |
Member
Author
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
--goto tell it to issueghcommands.