refactor(cli): dedup deploy ownership tracking#1646
Conversation
…ce helpers Replace inline isOwnedByApp(...) checks and the conflict/unmanaged/owner-set branching in auth, idp, resolver, function-registry, tailordb, secret-manager, and auth-connection deploy planners with the shared trackDesiredResourceOwnership / trackRemainingResourceOwner helpers, matching the pattern already used in executor, workflow, staticwebsite, and aigateway. No behavior change. Claude-Session: https://claude.ai/code/session_01NLYAfzKJnUxB5d2L1dpiCH
🦋 Changeset detectedLatest commit: d1a12e7 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
commit: |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
📖 Docs Quality & Consistency Check
✅ Docs are consistent with the implementation and contain no user-facing internal-detail leaks.
Checked areas:
- Deployment ownership tracking behavior documented in
packages/sdk/docs/cli/application.mdlines 77, 138-145 (stable app ID tracking, conflicts, unmanaged resources) - Secret Manager vault ownership behavior documented in
packages/sdk/docs/services/secret.mdlines 176-179 - GitHub Actions application ownership behavior documented in
packages/sdk/docs/github-actions.mdlines 203-204 - Changeset description accuracy (patch level, user-facing description)
Summary:
This PR is a pure internal refactoring that extracts repeated ownership-checking logic into two helper functions (trackDesiredResourceOwnership and trackRemainingResourceOwner). The refactored code maintains identical behavior to the original inline implementations:
- Same ownership classification logic
- Same conflict/unmanaged resource tracking
- Same JSON output format for
--dry-run --json - No changes to user-facing CLI commands, options, or APIs
All existing documentation about deployment ownership tracking, conflict detection, and unmanaged resource handling remains accurate because the behavior is unchanged.
Re-run this check by adding the
docs-checklabel to the PR.
…-ownership # Conflicts: # packages/sdk/src/cli/commands/deploy/auth.ts # packages/sdk/src/cli/commands/deploy/idp.ts
Code Metrics Report (packages/sdk)
Details | | main (6851982) | #1646 (5c85491) | +/- |
|--------------------|----------------|-----------------|-------|
- | Coverage | 72.4% | 72.4% | -0.1% |
| Files | 432 | 432 | 0 |
| Lines | 16370 | 16321 | -49 |
- | Covered | 11857 | 11817 | -40 |
+ | Code to Test Ratio | 1:0.4 | 1:0.4 | +0.0 |
| Code | 108107 | 108105 | -2 |
| Test | 47296 | 47296 | 0 |Code coverage of files in pull request scope (80.4% → 80.4%)
SDK Configure Bundle Size
Runtime Performance
Type Performance (instantiations)
Reported by octocov |
Summary
Deploy planning keeps ownership handling consistent across resource types without changing behavior.