Skip to content

Reuse GitHub status comments#1416

Draft
gjkim42 wants to merge 1 commit into
mainfrom
report-with-sticky-comment
Draft

Reuse GitHub status comments#1416
gjkim42 wants to merge 1 commit into
mainfrom
report-with-sticky-comment

Conversation

@gjkim42

@gjkim42 gjkim42 commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

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 test
  • make verify

Does this PR introduce a user-facing change?

GitHub task status reporting now updates an existing Kelos status comment for the task instead of creating additional lifecycle comments when possible.

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.

  • Bug Fixes
    • Added FindTaskStatusComment to 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.
    • Updated watcher to call this lookup when AnnotationGitHubCommentID is absent and persist the found ID for future runs.
    • Adjusted tests to cover GET→PATCH/POST flows and added coverage for not-found cases.
    • Clarified docs to say we maintain one status comment per task.

Written for commit 266997b. Summary will update on new commits.

Review in cubic

const defaultBaseURL = "https://api.github.com"
const (
defaultBaseURL = "https://api.github.com"
githubStatusCommentHeader = "🤖 **Kelos Task Status**"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should this be configurable? So that if multiple agents run against the same PR they aren't all updating the same comment?

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants