Skip to content

feat: add sf package trust link unlink command (W-23970577) - #1273

Open
sshyamala-sfdc wants to merge 3 commits into
packaging-distribution/spifrom
t/packaging-distribution/w-23970577/trust-link-unlink
Open

feat: add sf package trust link unlink command (W-23970577)#1273
sshyamala-sfdc wants to merge 3 commits into
packaging-distribution/spifrom
t/packaging-distribution/w-23970577/trust-link-unlink

Conversation

@sshyamala-sfdc

Copy link
Copy Markdown
Collaborator

What & Why

Implements the plugin command for W-23970577 — [SPI] [L][CLI] Implement CLI for Public Secure management (link/unlink): the unlink verb.

sf package trust link unlink clears an authoring org's Public Secure (VerifiedDev) trust link, returning it to the Not Linked state — from any current state (Pending, Linked, or Declined). This enables the retry-after-decline flow (unlink → request again). It wraps PackageTrustLink.unlink from the packaging library.

Depends on the packaging-library side, published as prerelease @salesforce/packaging@5.0.9-spi.0 (library PR: forcedotcom/packaging#919).

Command

sf package trust link unlink --target-org <authoringOrg>

  • Run against your connected authoring org (the 1GP namespace org or 2GP Dev Hub).
  • No --verified-org flag — an org holds at most one link, so unlink clears whichever link exists.
  • If a link is removed, reports the removed Verified Org and its prior status.
  • If no link exists, reports it's already Not Linked (idempotent no-op).
  • Hidden beta command (no package.json subtopic entry), consistent with trust link request.

Changes

  • src/commands/package/trust/link/unlink.ts — new command
  • messages/package_trust_link_unlink.md — messages
  • schemas/package-trust-link-unlink.json — result schema
  • command-snapshot.json — new command entry
  • test/commands/package/packageTrustLinkUnlink.test.ts — 3 unit tests
  • package.json / yarn.lock — pin @salesforce/packaging@5.0.9-spi.0

Testing

  • Full unit suite: 136 passing (incl. 3 new unlink tests).
  • snapshot:compare → No changes detected.
  • schema:compare → No changes detected.
  • Build + tests run against the published 5.0.9-spi.0 package (not a local link).

sshyamala-sfdc and others added 3 commits August 27, 2026 00:59
Add the beta `sf package trust link unlink` command that clears the
connected authoring org's Public Secure trust link, returning it to the
Not Linked state. Delegates to PackageTrustLink.unlink; reports the removed
link's verified org and prior status, or that the org is already Not Linked.
Hidden/beta consistent with the other trust link commands. Includes messages,
JSON schema, command-snapshot entry, and unit tests.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… t/packaging-distribution/w-23970577/trust-link-unlink

# Conflicts:
#	command-snapshot.json
Pin the published packaging prerelease that includes PackageTrustLink.unlink
so plugin CI resolves the unlink implementation.

Co-Authored-By: Claude Opus 4.8 (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.

2 participants