EPMDEDP-17360: feat: Add pipelinerun get --wait and pipeline results - #42
Merged
Merged
Conversation
- pipelinerun get --wait polls a run until it finishes and exits 1 unless it succeeded; --timeout (default 1h) bounds the wait. - pipelinerun get and list show the pipeline results of a run still in the cluster, such as VCS_TAG of a build: a Results block, results in JSON. - project build reports "upgrade the portal" when the portal has no build route, instead of failing to parse the 404 body. - sonar gate says "no analyses yet" only for gate status NONE. Signed-off-by: Sergiy Kulanov <sergiy_kulanov@epam.com>
SergK
force-pushed
the
EPMDEDP-17360
branch
from
September 29, 2026 09:51
6774960 to
230c71c
Compare
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.
Description
An AI agent with the krci skills plugin and krci v0.16.0, with
kubectldenied, ran "build main and tell me the version and quality result" on a local testbed. It got there, but in 41 turns: it polledpipelinerun getmore than 15 times, read the built version from a task log, distrusted a passing Sonar gate, and on an older portal could not tell whyproject buildfailed. This PR closes those four gaps in the CLI; no portal change.krci pipelinerun get --waitpolls the run every 10 s until it finishes, then prints it the waygetdoes, including--reasonand--logs. The exit code is0only forSucceeded; any other final status still prints the run and exits1withpipeline run "<name>" finished with status <status>and a--reasonhint.--timeout(default1h) bounds the wait. Waiting lives onget, not onproject build, so it covers every run type, including the review and build runs that git events start.krci pipelinerun getandlistcarry the run's pipeline results (status.results):resultsin JSON and aResults:block in the table, for exampleVCS_TAG, the version a build produced. Only a run still in the cluster has them: Tekton Results summaries do not, and the portal has no REST route for the stored PipelineRun record.--waitreturns while the run is still in the cluster.krci project buildagainst a portal withoutPOST /rest/v1/pipelineruns/build(every portal release up to 0.8.0) printedjson: cannot unmarshal string into Go struct field ErrorNOTFOUND.error. The generated client parses a JSON 404 into the tRPC error envelope beforecheckBuildResponseruns, so the existing route-missing mapping, and the "Portal too old" row ofdocs/project.md, were never reached.Buildnow reads the raw response; the message isportal has no endpoint for this command (Route POST:/rest/v1/pipelineruns/build not found); upgrade the portal.krci sonar gateprinted(no conditions — project has no analyses yet)for any gate without conditions, including a passed gate right after an analysis. Only statusNONEsays that now; a gate with a status prints(no conditions evaluated).Fixes EPMDEDP-17360
Type of change
resultsis an added JSON field. Without--wait,getbehaves as before, including exit0for a failed run.How Has This Been Tested?
Unit tests came first. The new
project buildtest reproduced the exact error from the discovery run before the fix.make ciingolang:1.26on a clean LF clone of the branch:golangci-lint0 issues,go test -race ./...passes, build OK./e2epere2e/runner.md, binary built from this branch, portal rows read-only against a live portal with the developer role: pipelinerun 67 PASS · 2 FAIL · 0 SKIP, project build 10 PASS · 0 FAIL · 3 SKIP.pipelinerunsections 1 to 9, deterministic harnessproject buildPROJ-B-01 to PROJ-B-10, dry-run and not-found rows includedmain12bee91 gives the same output. The rows expectauthentication required, the CLI printsnot authenticated: run 'krci auth login'.Live, read-only:
project build my-app --dry-run -o jsonagainst a portal without the build routemain:calling project build: json: cannot unmarshal string into Go struct field ErrorNOTFOUND.error ...; this branch:portal has no endpoint for this command (Route POST:/rest/v1/pipelineruns/build not found); upgrade the portalpipelinerun get <finished run> --waitget); exit0for Succeeded,1plus the--reasonhint for Failedsonar gatefor a project without an analysis(no conditions — project has no analyses yet), unchanged; a passed gate with conditions prints the table as beforepipelinerun get <review run> --wait -o json, started while the run wasRunningFailed, 8m 10s), exit1with the--reasonhintpipelinerun get <build run> --wait -o json, started while the build wasRunningSucceeded, exit0,results.VCS_TAG=build/<version>; the table view showsResults: VCS_TAG=build/<version>, andkrci project versionslists the same<version>as the newest version of that branchThe
pipelinerun startrows were not run: they need the Pipelines frome2e/pipelinerun/fixtures/applied to the cluster, and this PR does not touchstart.Checklist
Screenshots (if appropriate)
N/A
Additional context
Docs:
docs/pipelinerun.md(Results, Waiting for a run, JSONresults),docs/project.md(build and wait),docs/sonar.md, README command tree and agent scenario. e2e:e2e/pipelinerun/test-cases.mdgains PR-H-08, PR-V-12 to PR-V-14, PR-GE-08 to PR-GE-11, PR-J-05 and theSUCCEEDED_RUN_NAMEandBUILD_RUN_NAMEplaceholders.The same discovery found gaps this PR leaves out, each a separate ticket: a deploy verb (the deploy run is assembled in the portal UI), filtering deploy runs by environment, and pod logs and events (need a portal REST route first).