Skip to content

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

Open
migmartri wants to merge 2 commits intomainfrom
2822-fix-org-selection
Open

fix(cli): use org from local attestation state for subsequent commands#2823
migmartri wants to merge 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>
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

1 participant