Skip to content

fix(cli): use org from local attestation state for subsequent commands#2823

Merged
migmartri merged 2 commits intomainfrom
2822-fix-org-selection
Mar 9, 2026
Merged

fix(cli): use org from local attestation state for subsequent commands#2823
migmartri merged 2 commits intomainfrom
2822-fix-org-selection

Conversation

@migmartri
Copy link
Member

@migmartri migmartri commented Mar 6, 2026

Summary

  • Read the organization from the local crafting state in PersistentPreRunE so that att add, att push, etc. use the same org that was passed to att init --org X, instead of falling back to the default org from the CLI config

Fixes #2822

When `att init --org X` is used, subsequent subcommands (add, push, etc.)
now read the organization from the local crafting state file so the gRPC
connection targets the correct org instead of falling back to the default
from the CLI config.

Fixes #2822

Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>
Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 3 files

Deduplicate the attestation state path logic by having both newCrafter
and orgFromLocalState use the shared action.AttestationStatePath helper.

Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>
@migmartri migmartri merged commit ee1162b into main Mar 9, 2026
15 checks passed
@migmartri migmartri deleted the 2822-fix-org-selection branch March 9, 2026 11:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

attestation add fails if the default organization is different than the one provided explicitly

2 participants