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 — feat(attest): add --no-commit-info to attest without CI commit and repo info by mbevc1 · Pull Request #1420 · 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

Adds --no-commit-info to the kosli attest commands, so an attestation can be sent without the commit and repository info the CLI defaults from the CI environment.

In a supported CI, the attest commands default --commit and the repository flags from the environment. A job in one repository that attests to a trail belonging to another repository's build therefore attaches its own commit and repository to that trail. There was no supported way to prevent this: --commit="" is refused as an empty value, and leaving the flag out restores the default.

Closes #1418

kosli attest generic --flow F --trail T --name security-scan --compliant=true --no-commit-info
  • Commit: no git_commit_info is sent, with no commit lookup and no warning, with or without a checkout.
  • Repository: the repo info defaulted from the CI environment is left out. --repository, --repo-url, --repo-id and --repo-provider are sent only when passed explicitly, so the caller can name the repository the trail belongs to.
  • No mixing: explicit repo flags are not completed from the CI's values. A partial set sends no repo info, with the existing warning that ID, name and URL are all required.
  • Origin URL: still sent. It records which workflow run sent the attestation, which stays true.
  • With --commit: fails, whether the commit was passed as a flag or set through KOSLI_COMMIT or the config file.
  • Pull request and Jira attestations: fail, since they need the commit to find pull requests or Jira issue keys.

Options considered

The issue lists three. This PR implements the first.

  • A general --no-ci-defaults switch: rejected as too broad. It would also drop the origin URL, and each command would need its own definition of "no defaults".
  • Allowing --commit="": rejected. An exception to the empty-value rule would let an unset shell variable drop the commit silently.

Notes for review

  • Scope: the flag is on the 13 commands that share the common attestation flags. kosli attest artifact, kosli attest in-toto and kosli begin trail are unchanged; the issue covers attesting to an existing trail.
  • Repo flags from the environment: KOSLI_REPOSITORY and the other repo variables count as explicit, like the flags, and are sent.
  • attest sonar: --sonar-revision still defaults to the CI commit, since it names the revision that was scanned, not a commit attached to the attestation.
  • Artifact binding: Kosli binds an attestation reported before its artifact through the commit. With this flag, an artifact attestation needs the artifact to exist already or --fingerprint to be passed.
  • Empty-flag audit: the flag is registered for the 13 commands (empty-flag-audit-coverage.json, spec.json, categories.json). The five commands that need the commit use the value false in the spec, since true fails there by design.

Checklist

  • Docs are autogenerated from CLI help — make sure the help text reflects your 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
@github-actions github-actions Bot added go Pull requests that update go code feat 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 44s —— View job


Follow-up review — commits since last review

  • Fetch previous review comments
  • Diff BEFORE..AFTER (BEFORE 427ae3a1 isn't reachable locally — the branch was rebased onto current main, so SHAs changed but content didn't; confirmed by diffing the last two in-branch commits and the full origin/main...HEAD diff, which matches the PR's reported +202/-13 across the same 8 files)
  • Check status of each previous finding
  • Scan changed lines for new bugs/regressions
  • Post summary

Previous finding status:

  1. cmd/kosli/attestation.go — error message wrongly attributed --commit to KOSLI_COMMIT/config when it was passed as a flag (finding): RESOLVED. The message is now source-agnostic — "--no-commit-info cannot be combined with --commit, whether passed as a flag or set through KOSLI_COMMIT or the config file" — in both attestation.go and the two assertions in attestationCommitInfo_test.go that previously expected the old wording. This was already confirmed resolved in a prior reply on that thread; no further action needed there.

No new inline comments — the only change since the last review is this wording fix, and it introduces no new issues.

All reactions

Sorry, something went wrong.

Uh oh!

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

claude[bot]
claude Bot reviewed Nov 27, 2026
View reviewed changes
Comment thread cmd/kosli/attestation.go Resolved

Uh oh!

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

@mbevc1
mbevc1 marked this pull request as ready for review November 27, 2026 22:13
mbevc1 added 3 commits November 27, 2026 22:13
@mbevc1
feat(attest): add --no-commit-info to attest without CI commit and re…
1078151
…po info

In a supported CI the attest commands default --commit and the repository
flags from the environment. A job in one repository that attests to a
trail belonging to another repository's build therefore attached its own
commit and repository to that trail, and had no supported way not to:
--commit="" is refused as an empty value, and leaving the flag out
restores the default.

--no-commit-info sends the attestation without git_commit_info and
without the repository info defaulted from the CI environment, with no
commit lookup and no warning. Repository flags passed explicitly are
still sent, so the caller can name the repository the trail belongs to;
they are not completed from the CI's values. The origin URL is kept: it
says where the attestation was sent from, which stays true.

The flag fails with an explicit --commit, and on the pull request and
Jira attestations, which need the commit to do their work.

A general switch for all CI defaults was rejected as too broad, and
allowing --commit="" as an exception to the empty-value rule would let
an unset shell variable drop the commit silently.

Closes #1418
@mbevc1
fix(attest): update snyk docs golden and name KOSLI_COMMIT in the con…
5be7084
…flict

The golden page for attest snyk lists every flag of the command, so the
new --no-commit-info flag made TestDocsCmdSnyk fail.

A commit set through KOSLI_COMMIT or the config file counts as passed,
so a pipeline exporting it met an error naming a flag nobody typed. The
message now says where else the value can come from.

Refs #1418
@mbevc1
fix(attest): word the --no-commit-info conflict for every source of -…
71cb17f
…-commit

The message blamed KOSLI_COMMIT or the config file even when --commit
was typed on the command line, which is the common case.

Refs #1418
@mbevc1
mbevc1 force-pushed the 20261127_attest-no-commit-info branch from 427ae3a to 71cb17f Compare November 27, 2026 22:13
@mbevc1
mbevc1 enabled auto-merge (squash) November 27, 2026 22:17
@mbevc1 mbevc1 mentioned this pull request Nov 27, 2026
refactor(attest): read explicit repo flags from the flag set #1421
Open
3 tasks done

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

@claude claude[bot] claude[bot] left review comments

At least 1 approving review is required to merge this pull request.

Uh oh!

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

Assignees

No one assigned

Labels

feat go Pull requests that update go code

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

No way to opt out of CI-defaulted --commit on kosli attest when attesting cross-repo

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.