fix(wizard): prefer is_default_workspace, keep reading the old name - #389
Open
aurangzaib048 wants to merge 2 commits into
Open
aurangzaib048 wants to merge 2 commits into
aurangzaib048 wants to merge 2 commits into
Conversation
The backend is renaming is_default_team and now serves is_default_workspace beside it. Both carry the same value today. Reading only the old one is the failure worth avoiding, and it is a quiet one. When the field is finally dropped, .get returns None, every membership reads False, and the picker falls through to the first workspace in the list: no error, no warning, just uploads landing in a workspace nobody chose. Reading only the new one would break against any backend that has not shipped it yet. So it prefers the new name and falls back. Four tests, covering both names present, the old one alone, the new one alone, and the two disagreeing. Pointing the picker back at the old field fails the sunset case with 'prod' where 'sandbox' was expected, which is exactly the silent misdirection.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the wizard’s workspace default-selection logic to stay compatible with a backend rename from is_default_team to is_default_workspace, ensuring the wizard continues to pick the correct default workspace across both new and old backend versions.
Changes:
- Prefer
is_default_workspacewhen selecting the default workspace, while falling back to deprecatedis_default_team. - Add test coverage for the four compatibility cases (both fields present, old-only, new-only, and disagreement).
- Add an
audit_trail.txtfile to the repo (appears to be a generated artifact and unrelated to the field rename).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
sbomify_action/cli/wizard/screens/authenticate.py |
Adds _is_default_member helper and updates default-workspace selection to prefer the new backend flag with backward compatibility. |
tests/test_wizard_state.py |
Adds tests covering backward/forward compatibility and the sunset scenario for the renamed backend flag. |
audit_trail.txt |
New audit trail output file added at repo root (appears to be a generated runtime artifact, not part of the wizard rename fix). |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
vpetersson-bot
added a commit
to vpetersson-bot/sbomify-action
that referenced
this pull request
Aug 31, 2026
A run writes sbom_output.json and audit_trail.txt side by side (console.py), but only the first was ignored. So running the tool inside a checkout leaves audit_trail.txt untracked and ready to be swept into a commit, which is how it reached sbomify#389. What it carries is the reason this matters rather than being untidy: the file records the absolute input path, so a committed one publishes the generating machine's directory layout and username. Separately worth deciding, and not addressed here: whether the audit trail should record an absolute path at all. It is a compliance artifact meant to be handed to someone else, and the full local path is of no use to them. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
vpetersson-bot
added a commit
to vpetersson-bot/sbomify-action
that referenced
this pull request
Aug 31, 2026
A run writes sbom_output.json and audit_trail.txt side by side (console.py), but only the first was ignored. So running the tool inside a checkout leaves audit_trail.txt untracked and ready to be swept into a commit, which is how it reached sbomify#389. What it carries is the reason this matters rather than being untidy: the file records the absolute input path, so a committed one publishes the generating machine's directory layout and username. Separately worth deciding, and not addressed here: whether the audit trail should record an absolute path at all. It is a compliance artifact meant to be handed to someone else, and the full local path is of no use to them. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
vpetersson-bot
added a commit
to vpetersson-bot/sbomify-action
that referenced
this pull request
Aug 31, 2026
A run writes sbom_output.json and audit_trail.txt side by side (console.py), but only the first was ignored. So running the tool inside a checkout leaves audit_trail.txt untracked and ready to be swept into a commit, which is how it reached sbomify#389. What it carries is the reason this matters rather than being untidy: the file records the absolute input path, so a committed one publishes the generating machine's directory layout and username. Separately worth deciding, and not addressed here: whether the audit trail should record an absolute path at all. It is a compliance artifact meant to be handed to someone else, and the full local path is of no use to them. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
It is a generated runtime artifact that a run writes beside sbom_output.json, and the committed copy records the absolute input path from the machine that produced it, including a personal username. Nothing in the repo reads it. The ignore rule that stops it happening again is sbomify#393, so it is left out of this change rather than added in both.
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The behavioral change is small, well-scoped, and backed by targeted tests, with only a minor docstring clarity nit noted.
Review details
Suppressed comments (1)
sbomify_action/cli/wizard/screens/authenticate.py:35
- Docstring caveat still refers to the deprecated flag name (
is_default_team=False), even though the function now prefersis_default_workspace. Updating the example to mention the new name (and optionally the legacy name) would avoid confusion once the old field is sunset.
Caveat: for a *scoped* token bound to a non-default workspace, the
membership block on the token's bound workspace still reads
``is_default_team=False`` (the flag tracks the user's default, not
- Files reviewed: 2/2 changed files
- Comments generated: 0 new
- Review effort level: Lite
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The backend is renaming
is_default_team. It now servesis_default_workspacebeside it, both carrying the same value, with the old one deprecated. This is the action's half, and it wants to land before any sunset date.Why this one matters more than a normal field rename
The wizard's workspace picker reads that flag to mirror how the backend scopes
list_products/list_components:When the field is dropped,
.get()returnsNone. Not an exception, not a 4xx: every membership readsFalse, the loop falls through, andfallbackis the first workspace in the list. A user with several workspaces silently gets the wrong one, and uploads land in it.The auth-success status line names the picked workspace, so a human can currently spot a mismatch. After the drop, that line would confidently name the wrong workspace with nothing looking broken.
Reading only the new name has the opposite problem: it breaks against any backend that has not shipped it yet, including self-hosted installs on an older release. So
_is_default_memberprefers the new name and falls back to the old.Tests
Four cases: both names present, the old one alone, the new one alone, and the two disagreeing.
The sunset case is the one worth having. Point the picker back at the old field and it fails exactly as the outage would look:
Wrong workspace, no error.
Note
tests/test_php_composer.py::TestWhenItIsFetched::test_other_ecosystems_do_not[go.mod]fails on this branch and on its parent commit. Pre-existing and unrelated to this change.