Skip to content

test(artifacts): restore publishing permission regression tests - #41364

Merged
AmethystLiang merged 2 commits into
mainfrom
AmethystLiang/restore-artifact-permission-tests
Nov 12, 2026
Merged

AmethystLiang merged 2 commits into
mainfrom
AmethystLiang/restore-artifact-permission-tests

Conversation

@AmethystLiang

@AmethystLiang AmethystLiang commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

ELI5

Two recent test cleanups deleted the tests that make sure Orca never turns on public artifact publishing for an existing user without asking. This puts those tests back. Nothing about the app changes.

What Changed

Tests only. They are restored and adapted to current file paths:

The saved-opt-out and explicit-choice cases are left out: saved values already win in both paths, so reverting #40948 or #40982 does not fail them (review C1).

Why

STA-14784 (P1) was a real permission leak. Writing an older profile offline merged the new-profile default (artifactSharingEnabled: true) into it. The code fix (#40982) is still on main, but only its offline agent hooks test survived. Nothing guarded the project-transfer path, the rule that a profile without the setting loads as off, or the web fallback.

Linked Issue

Linear STA-14784. Follow-up to #40948 and #40982.

Visual Proof

N/A: tests only, nothing a user can see changes.

Testing

  • The 3 suites pass locally on macOS (6 tests).
  • Each restored guard fails when the code it guards is reverted. I removed the transfer exclusion in profile-project-state-file.ts, the === true normalization in normalize-loaded-global-settings.ts, and the web artifactSharingEnabled: false override. One matching test failed for each.
  • pnpm run lint (46 steps), typecheck:node, typecheck:web and oxfmt pass.

Risk

Level: Low. Adds tests only. Revert with a plain revert.

Review

Technical review chaired by Eng - Neil. C1 asked for two changes, both fixed in 4132cfa. C2 was clean on 4132cfa.

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Tests only, so there is no security, cross-platform, SSH, mobile, compatibility or performance impact.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • I stated the risk: what could break, for whom, and how to back it out
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (lint, node/web typecheck and the changed suites ran locally; CI covers the rest)

#41012 and #41007 removed the tests that guard #40948 (new profiles allow
artifact publishing, profiles saved before the setting stay off, web clients
fail closed until the host grant is mirrored) and #40982 (moving a project
between profiles must not grant publishing to an older profile). Restore them
against current paths. Each fails when the code it guards is reverted.
@coderabbitai

coderabbitai Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The change adds tests for artifactSharingEnabled. The tests cover persistence defaults and reloads, stored values, web local-storage values, and project moves between profiles without adding the setting to older profiles.

Merge Risk: Minimal · up to 4132c

This change adds regression tests only and does not alter product behavior. No actionable merge-blocking risk was identified.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the change: it adds regression tests that restore coverage for artifact-publishing permissions. The title follows the conventional commit style. The PR contains only test files, so the…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed The description follows the repository template closely. It includes ELI5, What Changed, Why, Linked Issue (Linear STA-14784 with follow-ups #40948 and #40982, though it is not a GitHub issue link), V…
Full details: Title check

Explanation

The title names the change: it adds regression tests that restore coverage for artifact-publishing permissions. The title follows the conventional commit style. The PR contains only test files, so the test( prefix and the restored tests match the changeset. Its 63 characters and 6 words make it concise.

Full details: Description check

Explanation

The description follows the repository template closely. It includes ELI5, What Changed, Why, Linked Issue (Linear STA-14784 with follow-ups #40948 and #40982, though it is not a GitHub issue link), Visual Proof marked N/A with reason, Testing with checkboxes and concrete results, Risk with level Low and revert method, Review, Agent skill boundary, Notes, and Checklist. The Linked Issue is a Linear ticket rather than a GitHub 'Fixes #' reference, and the AI Disclosure section is missing. Those gaps are minor for a tests-only change.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 28940edd-543f-4c26-a3ad-5ca702cd1129
Commits

Reviewing files that changed from the base of the PR and between 42bcfa3 and 4132cfa.

Files selected for processing: 3

  • src/main/orca-profiles/project-transfer/profile-project-transfer.test.ts
  • src/main/persistence/applying-settings/persistence-artifact-sharing-default.test.ts
  • src/renderer/src/web/preload-api/web-artifact-sharing-setting.test.ts
Files with no reviewable changes: 2

  • src/main/orca-profiles/project-transfer/profile-project-transfer.test.ts
  • src/main/persistence/applying-settings/persistence-artifact-sharing-default.test.ts
Files skipped from review as they are similar to previous changes: 1

  • src/renderer/src/web/preload-api/web-artifact-sharing-setting.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.

Drop the explicit opt-out and explicit-choice transfer cases: saved values
already win in both paths, so reverting #40948 or #40982 does not fail them.
Name the web test for what it checks: the local fallback, not host mirroring.
@AmethystLiang
AmethystLiang merged commit 267602a into main Nov 12, 2026
42 checks passed
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