GeezerVison is showing github.com — refactor(attest): read explicit repo flags from the flag set by mbevc1 · Pull Request #1421 · kosli-dev/cli
Conversation
mbevc1
commented
Nov 27, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Removes the hand-wired repoURLExplicit and repoNameExplicit fields from CommonAttestationOptions. The shared run now asks the flag set it already holds, through the explicit() helper added in #1420.
Each of the 13 attest commands had to set the two fields in its RunE before calling run. A command that forgot would silently treat --repository and --repo-url as defaulted from CI. This follows up a suggestion in the review of #1420.
Stacked on #1420: the base branch is 20261127_attest-no-commit-info, which holds the helper. Review and merge that PR first.
- No behaviour change.
cmd.Flags().Changed(...) is evaluated at the same point as before, on the same flag set.
- Not touched:
attest artifact and begin trail keep their own repoNameExplicit. Their option structs do not embed CommonAttestationOptions.
- Test: the repo-info wiring suite gains a case for an explicit
--repo-url being validated. This change moved that read, and no dry-run test covered it. The case fails when the read is broken.
Checklist
- Docs are autogenerated from CLI help — make sure the help text reflects your changes (no help text changes)
- Helm chart (
charts/k8s-reporter/) updated, if needed. Note: these changes live in a separate PR (not needed)
- Terraform provider and related changes (terraform-provider-kosli, terraform-aws-kosli-reporter) updated, if needed (not needed)
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
claude
Bot
commented
Nov 27, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|
Claude finished @mbevc1's task in 1m 21s —— View job
Review of new commits (c1d86662, 8975d3b7)
- Fetch existing review comments/findings
- Diff BEFORE..AFTER and check each prior finding's status
- Check new commits for bugs/regressions in changed lines
- Post summary comment
Previous findings: None — this is the first automated review pass on this PR (no prior Claude review or inline comments exist).
New commits reviewed:
c1d86662 removes repoURLExplicit/repoNameExplicit from CommonAttestationOptions and the per-command RunE lines that set them, replacing both call sites in attestation.go's run() with o.explicit("repo-url") / o.explicit("repository").
8975d3b7 renames/extends the wiring test with a new wantError case for an invalid --repo-url that fails validation without needing the test server.
Verification performed:
- Confirmed
o.flags is assigned once at construction time via addAttestationFlags (cmd/kosli/flags.go:98), and all 13 touched command files (attestCustom, attestDecision, attestGeneric, attestJira, attestJunit, attestOverride, attestPRAzure, attestPRBitbucket, attestPRGithub, attestPRGitlab, attestSbom, attestSnyk, attestSonar) call it, so o.flags.Changed(...) is evaluated against the same parsed flag set as before — no behaviour change.
- Confirmed
attest artifact and begin trail correctly retain their own repoNameExplicit field (they don't embed CommonAttestationOptions), and no stray references to the removed fields remain anywhere else in cmd/kosli/.
- The new test case in
repoInfoWiring_test.go exercises exactly the line that moved (validateRepoFlags(..., o.explicit("repo-url"))), and is correctly scoped as a no-server-needed guard (validation runs before any API call).
No bugs, regressions, or security issues found in the changed lines. No new inline comments were needed.
(branch)
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
CommonAttestationOptions kept repoURLExplicit and repoNameExplicit,
which each of the 13 attest commands had to set by hand in its RunE
before calling run. A command that forgot would silently treat
--repository and --repo-url as defaulted. run already holds the flag
set, so it now asks it directly through explicit(), as the
--no-commit-info path does.
No behaviour changes. attest artifact and begin trail keep their own
repoNameExplicit: they do not embed CommonAttestationOptions.
The wiring suite gains a case for an explicit --repo-url being
validated, the read this change moved that no dry-run test covered.
The server-backed suites already test an invalid --repo-url. This case
exists because it runs in dry-run mode, which its name now says.
This branch has not been deployed
No deployments
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.
|