Reuse GitHub status comments#1416
Draft
gjkim42 wants to merge 1 commit into
Draft
Conversation
| const defaultBaseURL = "https://api.github.com" | ||
| const ( | ||
| defaultBaseURL = "https://api.github.com" | ||
| githubStatusCommentHeader = "🤖 **Kelos Task Status**" |
Contributor
There was a problem hiding this comment.
Should this be configurable? So that if multiple agents run against the same PR they aren't all updating the same comment?
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.
What type of PR is this?
/kind bug
What this PR does / why we need it:
Updates GitHub task status reporting to reuse an existing Kelos status comment for the same task instead of posting another comment when the stored comment ID annotation is missing. The reporter now searches existing issue/PR comments for the Kelos task-status marker, patches the latest matching comment, and only creates a comment when no match exists.
This keeps GitHub issue and PR timelines compact while preserving the existing initial-comment behavior for tasks that have not reported before.
Which issue(s) this PR is related to:
N/A
Special notes for your reviewer:
Validated with:
make testmake verifyDoes this PR introduce a user-facing change?
Summary by cubic
Updates GitHub status reporting to reuse a single Kelos status comment per task. When the stored comment ID is missing, we find the existing status comment and update it instead of creating duplicates.
FindTaskStatusCommentto scan issue/PR comments (paged) and find the latest Kelos status by header and task name; updates it when found, creates only if none exist.AnnotationGitHubCommentIDis absent and persist the found ID for future runs.Written for commit 266997b. Summary will update on new commits.