feat(cli): watch repo-maintenance workflow after enable/disable repos#1615
feat(cli): watch repo-maintenance workflow after enable/disable repos#1615ralphbean wants to merge 1 commit into
Conversation
Site previewPreview: https://bb6c094c-site.fullsend-ai.workers.dev Commit: |
ReviewFindingsLow
Previous runReviewFindingsLow
|
| @@ -2384,34 +2393,111 @@ func loadRepoConfig(ctx context.Context, client forge.Client, printer *ui.Printe | |||
| } | |||
There was a problem hiding this comment.
[low] style
Duplicate godoc comment for saveRepoConfig. The old single-line comment was retained and the new multi-line comment was added below it, resulting in the function name appearing twice in the comment block.
Suggested fix: Delete the old comment line ("// saveRepoConfig marshals and commits the updated config, then triggers the repo-maintenance workflow.") so only the new three-line comment remains.
| // GitHub workflow commands (::notice::, ::warning::) produce check-run | ||
| // annotations that are accessible via the check-runs API. | ||
| func (c *LiveClient) GetWorkflowRunAnnotations(ctx context.Context, owner, repo string, runID int) ([]forge.Annotation, error) { | ||
| // List jobs for this run. |
There was a problem hiding this comment.
[low] correctness
GetWorkflowRunAnnotations does not paginate either the jobs endpoint or the annotations endpoint. GitHub defaults to 30 items per page for jobs and 100 for annotations. For typical repo-maintenance runs this is unlikely to be an issue, but could silently drop data for workflows with many jobs.
Suggested fix: Add ?per_page=100 to the jobs request, or document the pagination limitation in the method comment.
After `fullsend admin enable/disable repos` updates config.yaml and dispatches the repo-maintenance workflow, the CLI now polls for the workflow run to complete and harvests ::notice:: annotations to display PR URLs (enrollment or removal PRs) directly in the terminal output. This replaces the static "The repo-maintenance workflow will create enrollment PRs" message with live feedback showing the workflow status and the resulting PR links. Changes: - Add Annotation type and GetWorkflowRunAnnotations to forge.Client - Implement annotation harvesting via GitHub check-runs API - Add awaitRepoMaintenance helper called by both enable and disable - saveRepoConfig now returns dispatch time for workflow watching - Simplify e2e test polling loops since the CLI now waits for the workflow to complete before returning Assisted-by: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Ralph Bean <rbean@redhat.com>
862488c to
0362cc1
Compare
| return buf.String(), nil | ||
| } | ||
|
|
||
| // GetWorkflowRunAnnotations returns annotations from all jobs in a workflow run. |
There was a problem hiding this comment.
[low] correctness
GetWorkflowRunAnnotations does not paginate the jobs endpoint or the annotations endpoint. GitHub defaults to 30 items per page for jobs. Could silently drop data for workflows with many jobs.
Suggested fix: Append ?per_page=100 to the jobs list URL, or document that pagination is intentionally omitted.
Summary
fullsend admin enable/disable reposupdates config.yaml, the CLI now watches the repo-maintenance workflow run to completion and prints PR URLs from its::notice::annotationsGetWorkflowRunAnnotationsto the forge interface (harvests check-run annotations via GitHub API)Test plan
awaitRepoMaintenance(success, timeout, failure, context cancellation)make go-testandmake lintpass🤖 Generated with Claude Code