[fix] clear the SonarCloud board: CI supply-chain hardening + native controls in the panel - #8
Merged
YJack0000 merged 2 commits intoAug 14, 2026
Conversation
…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.
|
Merged
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.



Clears all 27 open SonarCloud issues. Three groups, one theme each.
Workflows — supply chain
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.rust-toolchaindefaults itstoolchaininput togithub.action_ref— which is exactly how@stableselects the channel. Pinned to a SHA that default becomes the SHA, so all four uses now saytoolchain: stableexplicitly. 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 wipingnode_modulesand doing a clean--frozen-lockfile --ignore-scriptsinstall followed by a fullbun run build.--lockedon 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.ymldrops tocontents: readat the workflow level; only thereleasejob raises itself tocontents: write. The three jobs that handle the Apple signing secrets now run with a token that cannot publish a release.Scripts
macos-keychain.shfetches Apple's CA anchors with--proto '=https' --proto-redir '=https' --tlsv1.2. It passes-L, so without the redirect guard a 302 intohttp://would have been followed and the trust anchors fetched in the clear.[→[[throughoutbump-version.shandmacos-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", atabIndex, and a hand-rolled Enter/Space handler. Rather than paper over each one, the four affected surfaces became native elements:<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 —
KeysViewalready ships exactly that pair for the add-key drawer, and thedialog.detail/.scrimresets were already instyles.csswaiting 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 explicitdisplay: blockon.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;ToolDetailsplit intoPermissionsSection/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 markedReadonly;headlineExpirysorts with an explicitlocaleCompare; duplicate.dprofileselector 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 --lockedcargo clippy --all-targets --lockedandcargo build --lockedinapp/src-tauribun install --frozen-lockfile --ignore-scripts+bun run build(tsc + vite)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-itemwas already a shipped<button>withdisplay: 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-corehas nocfg(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 throughMemoryKeystore, so no test shells out tosecurity.So the core suite was already portable, and
ci.ymlnow has acore (Linux)job that keeps it that way — it goes red the moment core reaches for a real$HOME, asecurityinvocation, 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.