Skip to content

SP-3446: Add --staging option to t2tc package export - #442

Open
Buqeta (Buqeta) wants to merge 1 commit into
mainfrom
sp-3446
Open

Buqeta (Buqeta) wants to merge 1 commit into
mainfrom
sp-3446

Conversation

@Buqeta

Copy link
Copy Markdown
Contributor

Description

Adds --staging to t2tc package export. With Set Live, a branch can still change after it was set to live, so Team-to-Team Copy needs to export the selected branch's staging state instead of a published version.

  • --staging calls the new pacman endpoint GET /package-manager/api/core/staging/packages/export/batch with the given --packageKeys and --withDependencies. Branch keys (<projectKey>@<branchKey>) work.
  • variables.json: packages exported from staging (version staging in the manifest) get their values from the existing staging variables endpoint (/pacman/api/core/staging/packages/variables/by-package-keys). Dependencies still use the versioned variables endpoint.
  • --staging together with --keysByVersion is rejected.
  • Documented in docs/user-guide/t2tc-commands.md.

Depends on celonis/pacman#2979 (new endpoint) and a policy-guard allow rule for it before it works through the gateway.

Relevant links

Checklist

  • I have self-reviewed this PR
  • I have tested the change and proved that it works in different scenarios
    • module.spec.ts: --staging is passed to the service; --staging with --keysByVersion is rejected.
    • t2tc-package-export.spec.ts: branch package exported with dependencies calls the staging URL, sends only the dependency to the versioned variables endpoint and only the staging package to the staging variables endpoint, and writes both to variables.json.
    • All 62 tests in tests/commands/t2tc pass; tsc passes. Not tested against a live tenant yet (needs the pacman PR deployed).
  • I have updated docs if needed

Co-Authored-By: Claude noreply@anthropic.com
Includes-AI-Code: true

Export the staging state of the given package keys (including branch
packages) through the staging batch export endpoint, and fetch staging
variable values for packages exported from staging.

Co-Authored-By: Claude <noreply@anthropic.com>
Includes-AI-Code: true
@sonarqubecloud

Copy link
Copy Markdown

@Buqeta
Buqeta (Buqeta) marked this pull request as ready for review October 23, 2026 15:32
@Buqeta
Buqeta (Buqeta) requested a review from a team as a code owner October 23, 2026 15:32
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