GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

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

@mbevc1 mbevc1 commented Nov 27, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

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.

All reactions
@mbevc1
mbevc1 force-pushed the 20261127_attest-explicit-repo-flags branch from 37cc5a2 to 9e9e808 Compare November 27, 2026 22:22
@github-actions github-actions Bot added go Pull requests that update go code refactor labels Nov 27, 2026
@claude

claude Bot commented Nov 27, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

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)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mbevc1 mbevc1 closed this Nov 27, 2026
@mbevc1 mbevc1 reopened this Nov 27, 2026
@mbevc1
mbevc1 marked this pull request as ready for review November 27, 2026 22:35
@mbevc1
mbevc1 force-pushed the 20261127_attest-explicit-repo-flags branch from 38ef228 to 095f27e Compare November 27, 2026 22:35
mbevc1 added 2 commits November 27, 2026 22:38
@mbevc1
refactor(attest): read explicit repo flags from the flag set
c1d8666
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.
@mbevc1
test(attest): name the --repo-url wiring case as the no-server guard
8975d3b
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.
@mbevc1
mbevc1 force-pushed the 20261127_attest-explicit-repo-flags branch from 095f27e to 8975d3b Compare November 27, 2026 22:38

This branch has not been deployed

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

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

go Pull requests that update go code refactor

Projects

None yet

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.

1 participant

@mbevc1
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.