EPMDEDP-17364: feat: Add --deployment and --env filters to pipelineru… - #43
Merged
Merged
Conversation
…n list - pipelinerun list --deployment <d> --env <e> selects the runs of one environment, live and from Tekton Results, by the cdpipeline and cdstage labels; --type deploy keeps deploy runs only. Deploy runs carry no project, so --project never found them. - Run rows carry deployment and env in JSON; the table view of get shows them. - --env without --deployment, empty values and positional arguments are rejected; the --type help lists deploy.
geekhubuser
force-pushed
the
EPMDEDP-17364
branch
from
October 2, 2026 08:09
98201cc to
57ca96f
Compare
…ton Results limits - Send cdpipeline/cdstage as a label selector in the live PipelineRun list; values over 63 chars are skipped - List clean in --type help and docs - Document that --deployment/--env match archived runs only when the Results watcher records both labels - Collapse the five header fields in renderRunHeader into one loop - Use strings.CutPrefix in stageEnv; add a cdStage/stageEnv round-trip test Signed-off-by: Sergiy Kulanov <sergiy_kulanov@epam.com>
…ors in every command - Root wraps Args of every runnable leaf, including help and completion, with the flag-value check - The check also covers stringSlice and stringArray flags - pipelinerun list drops its local Args wrapper - Root tests cover NoArgs, ExactArgs, slice flags, help and completion - e2e rows PR-V-19, PR-S-PARAM-FLAG, SCA-V-14 Signed-off-by: Sergiy Kulanov <sergiy_kulanov@epam.com>
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
Deploy runs carry no project label, so
krci pipelinerun list --project <p> --type deployis always empty, and no filter selects the runs of one environment. An agent can only scankrci pipelinerun list --type deploy: the runs still in the cluster plus the 10 newest deploy runs of the whole platform. The krci skills work around it by matching run names (krci-overview,references/tooling.md), which misses runs outside that window and deploy runs of custom trigger templates with another name prefix.krci pipelinerun list --deployment <d> --env <e>selects the runs of one environment by theapp.edp.epam.com/cdpipelineandapp.edp.epam.com/cdstagelabels: live runs client-side, history through the Tekton Results filter, which keeps both as annotations.--type deploykeeps deploy runs only, since clean runs carry the same labels. The names are the oneskrci env get <deployment> <env>takes.deploymentandenvin JSON, omitted when absent; the table view ofgetprints them.--envwithout--deployment, an empty value, an invalid name and positional arguments fail before any portal call. The flag check runs before the argument check, so--project --pr 53still reports the flag without a value. The--typehelp listsdeploy, and the--projecthelp points deploy runs to the new flags.Fixes EPMDEDP-17364
Type of change
deploymentandenvare added JSON fields.pipelinerun listnow rejects positional arguments, which it used to ignore.How Has This Been Tested?
Unit tests cover the Tekton Results filter (including dashed names), live-row matching, both row mappers, a service test with live and history sources, and a
listRuntest against a mock portal that fails if the flags stop reaching the filter.make ciingolang:1.26on a clean LF clone of the branch:golangci-lint0 issues,go test -race ./...passes, build OK.Testbed measurement: try-kuberocketci with KRCI 3.15.0, a headless agent with the krci skills plugin and kubectl denied, the same prompt and platform state for both CLIs, 3 runs per row. The question: "Did the last deploy to environment dev of deployment demo succeed? When did it run, and if it failed, at which step and why?" That deploy had failed at
deploy-app/wait-for-deploybecause the application wentDegraded.On the busy platform two of three v0.17.0 agents answered that the deploy succeeded: they could not reach the run and read the Argo CD sync result instead. With this PR every agent found the run through
--deployment demo --env dev --type deploy, most after reading--help. The busy row was repeated with the binary built from this commit: 3/3 correct, 8 to 19 turns.Live, read-only, on a larger platform: the 10 newest deploy runs all belonged to two environments, so
--type deployshowed nothing of any other environment;--deployment <d> --env dev --type deployreturned that environment's last 10 deploy runs, two weeks back./e2epere2e/runner.md, pipelinerun group, binary from this branch, portal rows read-only against a live portal: 74 PASS · 2 FAIL · 1 SKIP. The 8 new rows (PR-H-09, PR-V-15 to PR-V-18, PR-L-24 to PR-L-26) also PASS through one Haiku agent each. PR-A-01 and PR-A-02 fail the same way onmain: the rows expectauthentication required, the CLI printsnot authenticated: run 'krci auth login'. PR-J-05 was skipped: no build run was in the cluster.Checklist
Screenshots (if appropriate)
N/A
Additional context
Docs:
docs/pipelinerun.md(filters, deploy and clean runs, JSON example). e2e:e2e/pipelinerun/test-cases.mdgains PR-H-09, PR-V-15 to PR-V-18, PR-L-24 to PR-L-26 and theDEPLOYMENTandENVplaceholders.Follow-up in
KubeRocketCI/skillsonce this is released: replace the name-matching recipe inkrci-overview'sreferences/tooling.mdwith--deploymentand--env.