Skip to content

Renamed OVERRIDE_SBOM_VERSION to SBOM_VERSION#10

Merged
kashifpk merged 1 commit into
masterfrom
sbom-enrichment
Oct 17, 2024
Merged

Renamed OVERRIDE_SBOM_VERSION to SBOM_VERSION#10
kashifpk merged 1 commit into
masterfrom
sbom-enrichment

Conversation

@kashifpk
Copy link
Copy Markdown
Contributor

No description provided.

@kashifpk kashifpk merged commit 25cfd87 into master Oct 17, 2024
@kashifpk kashifpk deleted the sbom-enrichment branch October 17, 2024 02:30
vpetersson added a commit that referenced this pull request May 29, 2026
Fifteen correctness, integration, and UX fixes from the extra-high-effort
code review on this branch:

  #1  ci_emitter: disambiguate output_file when two PlannedComponents
      slugify to the same name (one matrix job's SBOM was clobbering
      another's on disk).
  #2  _paginate: stop on missing 'next' / single-page envelopes
      instead of looping to MAX_PAGES=500 and raising APIError.
  #3  _paginate: don't yield the envelope dict as an item when 'items'
      is missing — poisoned list_components_by_name into a flood of
      duplicate creates.
  #4  Make component_type required on SbomifyApiClient; yocto facade
      and wizard apply explicitly pass 'sbom' (the historical Yocto
      type that the new client's 'bom' default was silently changing).
  #5  Track was_created through apply so DUPLICATE_NAME-recovered
      components render as reused on the Done screen instead of
      "created".
  #6  Tighten _OWNER_REPO_RE to require github.com; nested GitLab /
      Gitea / Bitbucket URLs no longer extract a wrong owner/repo
      slug into Done-screen OIDC binding instructions.
  #7  DISCOVERY_CAP now counts unique directories, not raw matches —
      monorepos with several lockfiles per dir aren't truncated below
      200 projects.
  #8  Resolve apply-log widget on the main thread and hop
      RichLog.write back via app.call_from_thread; Textual widgets
      aren't thread-safe.
  #9  attach_components_to_product failure is now surfaced as a red
      "Attach failed" row on the Done screen instead of a warning
      that scrolls past.
  #10 patch_component_visibility catches AuthError and logs warning,
      restoring the best-effort semantics yocto pipelines depend on.
  #11 Upload destination catches AuthError separately and tags
      UploadResult.error_code='AUTH_FAILED' so CI summaries can
      still distinguish auth failures from other 4xx.
  #12 list_contact_profiles paginates instead of single-shot
      truncating at 100 profiles.
  #13 _fetch_releases paginates so create_release's DUPLICATE_NAME
      recovery can reach existing releases on page 2+ of busy
      products.
  #14 Submit all three auth-prefetch futures before collecting
      .result() so the ThreadPoolExecutor actually parallelises the
      products/components/profiles fetch.
  #15 Welcome's Cancel button and empty-state path call exit()
      directly instead of action_quit_with_cancel — the double-tap
      confirmation is right for Ctrl-C but wrong for an explicit
      button click.

Test, lint, type, and format gates all pass (2281 passed, 4 skipped).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
vpetersson added a commit that referenced this pull request May 29, 2026
Fifteen wizard correctness + integration fixes from the latest
extra-high-effort code review:

  #1  io.write_sbomify_json: sentinel + ownership check, mirrors the
      workflow file's WIZARD_HEADER_SENTINEL. Refuses to overwrite a
      pre-existing sbomify.json that lacks the __sbomify_wizard__ key.
      Protects users carrying over a hand-crafted sbomify.json (full
      licenses / multi-entity suppliers / vcs_* overrides) against
      silent clobber.
  #2  ConfigureSbomScreen: when toggling to aug-profile, default
      picker.highlighted to the first REAL profile when one exists
      (not the + Create new sentinel). Workspaces with existing
      profiles can now single-Enter to advance with the most-likely
      selection.
  #3  ConfigureSbomScreen: detect Escape from ConfigureSbomifyJson
      screen via _json_form_visited flag; flip augmentation back to
      Skip + notify. Breaks the Enter→Escape→Enter form re-push loop.
  #4  CreateProfileScreen: distinguish dict-without-id from error
      string. A successful POST whose body the client can't parse
      now surfaces "Profile may have been created but the response
      was unexpected. Check the sbomify UI before re-submitting" —
      no more confusing "✗  {}" + duplicate-POST trap.
  #5/#6 Authenticate worker picks the user's DEFAULT workspace via
      is_default_team / is_me — same signal the backend uses to scope
      list_components / list_products. Multi-workspace PATs no longer
      silently bind a profile to components in a different workspace.
      Helper _pick_default_workspace_key is unit-tested.
  #7  Review _summary escapes profile / supplier / product names
      through rich.markup.escape so names containing '[' don't crash
      Rich render or emit garbled output at the about-to-apply moment.
  #8  ConfigureSbomScreen.on_screen_resume snapshots picker.highlighted
      BEFORE clear_options() and restores it after add_options() when
      no fresh auto-select target is set. Cancelled CreateProfile no
      longer silently downgrades augmentation to "skip".
  #9  on_radio_set_changed None-guards event.pressed — programmatic
      RadioButton.value loops in on_screen_resume / _populate_from
      fire Changed events with possible intermediate None state.
      Same fragile pattern guarded across ConfigureSbom and
      ConfigureSbomifyJsonScreen.
  #10 ConfigureSbomifyJsonScreen._populate_from narrows the
      lifecycle-restore except clause to NoMatches — real radio
      iteration bugs now fail loud in tests instead of leaving the
      wrong phase silently selected.
  #11 list_workspaces docstring records the trailing-slash rules
      (verified against stage): /workspaces/ requires the slash;
      nested /workspaces/{key}/contact-profiles must NOT have one.
      Future maintainers stop trying to "normalise" the URLs.
  #12 list_workspaces now accepts both bare-list AND paginated
      envelope shapes, matching every other list endpoint. Protects
      against a backend migration silently returning [] and breaking
      team_key resolution.
  #13 Deleted dead on_input_submitted handlers in CreateProfile +
      ConfigureSbomifyJson — they were unreachable due to the screens'
      priority=True Enter binding.
  #14 test_plan_defaults pins sbomify_json_data is None AND
      contact_profile_id is None — regression guard so flipping
      either to a default_factory dict can't silently produce the
      data-loss / cross-workspace-bind bugs above.
  #15 WorkspaceSnapshot.team_key docstring + styles.tcss comment
      updated to reflect /workspaces/ route + ConfigureSbom owner
      (both still said /teams/ and ConfigureWorkflow respectively).

Adds eight new tests in tests/test_wizard_state.py covering
write_sbomify_json create / overwrite / refuse-handauthored /
refuse-malformed, the sentinel helper, and _pick_default_workspace_key.

All gates clean: 2295 passed, ruff + ruff-format + mypy clean.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

1 participant