Skip to content

[fix] clear the SonarCloud board: CI supply-chain hardening + native controls in the panel - #8

Merged
YJack0000 merged 2 commits into
mainfrom
claude/dependency-security-vulnerabilities-c98c8e
Aug 14, 2026
Merged

[fix] clear the SonarCloud board: CI supply-chain hardening + native controls in the panel#8
YJack0000 merged 2 commits into
mainfrom
claude/dependency-security-vulnerabilities-c98c8e

Conversation

@YJack0000

@YJack0000 YJack0000 commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Clears all 27 open SonarCloud issues. Three groups, one theme each.

Workflows — supply chain

  • Every third-party action pinned to a full commit SHA (dtolnay/rust-toolchain, Swatinem/rust-cache, oven-sh/setup-bun, tauri-apps/tauri-action, softprops/action-gh-release), with the tag kept in a trailing comment. actions/* are GitHub-owned and were not flagged, so they stay on tags.
    • The one trap: rust-toolchain defaults its toolchain input to github.action_ref — which is exactly how @stable selects the channel. Pinned to a SHA that default becomes the SHA, so all four uses now say toolchain: stable explicitly. Without this the pin is a broken build, not a hardening.
  • bun install --ignore-scripts. Nothing in the tree needs a lifecycle script — esbuild and the tauri CLI ship their platform binaries as optional deps, not postinstall downloads. Verified by wiping node_modules and doing a clean --frozen-lockfile --ignore-scripts install followed by a full bun run build.
  • --locked on every cargo invocation, so CI fails loudly on a stale lockfile instead of quietly resolving a different dependency tree. Both lockfiles were checked and already satisfy it.
  • release.yml drops to contents: read at the workflow level; only the release job raises itself to contents: write. The three jobs that handle the Apple signing secrets now run with a token that cannot publish a release.

Scripts

  • macos-keychain.sh fetches Apple's CA anchors with --proto '=https' --proto-redir '=https' --tlsv1.2. It passes -L, so without the redirect guard a 302 into http:// would have been followed and the trust anchors fetched in the clear.
  • [[[ throughout bump-version.sh and macos-keychain.sh (17 issues). Semantics preserved — every RHS stays quoted, so nothing turns into a glob match.

Panel — real controls instead of ARIA impersonations

The recurring finding was non-interactive elements carrying role="button", a tabIndex, and a hand-rolled Enter/Space handler. Rather than paper over each one, the four affected surfaces became native elements:

was now
<article role="button" tabIndex={0} onKeyDown> (tool card) <button class="card">
<div role="button" tabIndex onKeyDown aria-disabled> (profile switch target) <button class="dprofile-body" disabled>
<code onClick> (copyable command) <button class="copyable">
<div class="scrim" onClick> + <aside role="dialog"> <button class="scrim"> + <dialog open>

The last row is not a new pattern — KeysView already ships exactly that pair for the add-key drawer, and the dialog.detail / .scrim resets were already in styles.css waiting for it.

A button may only contain phrasing content, so the layout elements inside the card and the profile row moved from <header>/<h2>/<footer>/<div>/<dl> onto spans; the CSS classes carry the boxes either way, plus a UA-chrome reset and an explicit display: block on .dprofile-id (it lost its block box when the <div> became a <span>). Tooltips on the badges survive, which an absolutely-positioned overlay button would have swallowed.

Also: explicit type="button" on all 14 non-submit buttons; ToolDetail split into PermissionsSection / ProfileFoot / NoteList / Scopes, which takes both cognitive-complexity hotspots (18 and 19) under 15 and unpicks five nested ternaries; notes and SVG layers keyed by content instead of array index; props marked Readonly; headlineExpiry sorts with an explicit localeCompare; duplicate .dprofile selector folded; boot-splash light-mode text darkened from 4.1:1 to 5.3:1 to clear WCAG AA.

Verification

Full local CI equivalent, all green:

  • cargo fmt --all --check, cargo clippy --workspace --all-targets --locked -- -D warnings, cargo test --workspace --locked (601 tests), cargo build --workspace --locked
  • cargo clippy --all-targets --locked and cargo build --locked in app/src-tauri
  • clean bun install --frozen-lockfile --ignore-scripts + bun run build (tsc + vite)
  • logo check: 25 tools, 25 marks, none missing

The four rebuilt components were also rendered against the compiled stylesheet and checked visually — card grid rows, the profile-id block, the kvs two-column grid and the copyable flex row all hold, and .side-item was already a shipped <button> with display: flex, so flex/grid on a button is proven in this webview.

The TODO(linux)

Resolved by doing it, not by deleting it. The TODO claimed a Linux job "would fail on path assumptions" — that turned out not to hold. patchbay-core has no cfg(target_os) branch anywhere: the macOS-shaped tool locations are plain strings built under a caller-supplied home, and the suite supplies a synthetic one. The Keychain path is covered through MemoryKeystore, so no test shells out to security.

So the core suite was already portable, and ci.yml now has a core (Linux) job that keeps it that way — it goes red the moment core reaches for a real $HOME, a security invocation, or a platform cfg. CI confirms it passes. This is not a claim that patchbay runs on Linux; pb, the panel and the probes remain macOS-only, which is why exactly one crate is built there.

…e controls in the panel

Workflows
- Pin every third-party action to a full commit SHA (dtolnay/rust-toolchain,
  Swatinem/rust-cache, oven-sh/setup-bun, tauri-apps/tauri-action,
  softprops/action-gh-release). rust-toolchain derives its channel from
  `github.action_ref`, which a SHA pin turns into the SHA — so each use now
  names `toolchain: stable` explicitly.
- `bun install` gets `--ignore-scripts`; nothing in the tree needs a lifecycle
  script (esbuild and the tauri CLI ship platform binaries as optional deps).
- `cargo build/test/clippy/run` get `--locked`, so CI fails on a stale lockfile
  instead of silently resolving a different tree.
- release.yml drops to `contents: read` at the workflow level; only the
  `release` job raises itself to write. The three jobs that handle the signing
  secrets now carry a token that cannot publish.

Scripts
- macos-keychain.sh fetches Apple's CA anchors with `--proto '=https'
  --proto-redir '=https' --tlsv1.2`; `-L` would otherwise follow a redirect
  into cleartext.
- `[` -> `[[` throughout bump-version.sh and macos-keychain.sh.

Panel
- The tool card, the profile-row switch target, the copyable command and the
  detail scrim are all real <button>s now instead of divs wearing
  role="button" + tabIndex + a hand-rolled Enter/Space handler; the detail
  drawer is a native <dialog>, matching the key vault's existing pattern.
  Their children are phrasing content, so the layout classes moved from
  <header>/<h2>/<div>/<dl> onto spans and the CSS carries the boxes.
- Explicit type="button" on every non-submit button.
- Split ToolDetail into PermissionsSection / ProfileFoot / NoteList / Scopes,
  which takes both cognitive-complexity hotspots under the limit and unpicks
  five nested ternaries.
- Key notes and SVG layers by content rather than array index; props marked
  Readonly; `headlineExpiry` sorts with an explicit localeCompare comparator.
- Fold the duplicate `.dprofile` selector; darken the boot splash's light-mode
  text to clear WCAG AA (4.1:1 -> 5.3:1).
patchbay-core has no cfg(target_os) branch: the macOS-shaped tool paths are
plain strings built under a caller-supplied home, and the suite supplies a
synthetic one. The Keychain path is covered through MemoryKeystore, so no test
shells out to a macOS binary. The suite is therefore portable today, and this
job is what keeps it so — it goes red the moment core reaches for a real $HOME
or a platform cfg. Not a claim that patchbay runs on Linux; pb, the panel and
the probes remain macOS-only, hence the single crate.
@sonarqubecloud

Copy link
Copy Markdown

@YJack0000
YJack0000 merged commit c94be4b into main Aug 14, 2026
4 checks passed
@YJack0000 YJack0000 mentioned this pull request Aug 14, 2026
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