Skip to content

refactor(cli): dedup deploy ownership tracking#1646

Merged
toiroakr merged 3 commits into
mainfrom
refactor/dedup-deploy-ownership
Jul 3, 2026
Merged

refactor(cli): dedup deploy ownership tracking#1646
toiroakr merged 3 commits into
mainfrom
refactor/dedup-deploy-ownership

Conversation

@dqn

@dqn dqn commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Deploy planning keeps ownership handling consistent across resource types without changing behavior.

dqn added 2 commits July 3, 2026 13:53
…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-bot

changeset-bot Bot commented Jul 3, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: d1a12e7

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@tailor-platform/sdk Patch
@tailor-platform/create-sdk Patch

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

@pkg-pr-new

pkg-pr-new Bot commented Jul 3, 2026

Copy link
Copy Markdown

Open in StackBlitz

pnpm add https://pkg.pr.new/@tailor-platform/create-sdk@d1a12e7
pnpm add https://pkg.pr.new/@tailor-platform/sdk@d1a12e7

commit: d1a12e7

@github-actions

This comment has been minimized.

@dqn dqn marked this pull request as ready for review July 3, 2026 05:23
@dqn dqn requested a review from a team as a code owner July 3, 2026 05:23
@dqn dqn requested a review from toiroakr July 3, 2026 05:23

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📖 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.md lines 77, 138-145 (stable app ID tracking, conflicts, unmanaged resources)
  • Secret Manager vault ownership behavior documented in packages/sdk/docs/services/secret.md lines 176-179
  • GitHub Actions application ownership behavior documented in packages/sdk/docs/github-actions.md lines 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-check label to the PR.


…-ownership

# Conflicts:
#	packages/sdk/src/cli/commands/deploy/auth.ts
#	packages/sdk/src/cli/commands/deploy/idp.ts
@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown

Code Metrics Report (packages/sdk)

main (6851982) #1646 (5c85491) +/-
Coverage 72.4% 72.4% -0.1%
Code to Test Ratio 1:0.4 1:0.4 +0.0
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%)

Files Coverage +/- Status
packages/sdk/src/cli/commands/deploy/auth-connection.ts 92.1% +0.4% modified
packages/sdk/src/cli/commands/deploy/auth.ts 68.1% -0.3% modified
packages/sdk/src/cli/commands/deploy/function-registry.ts 90.8% -0.6% modified
packages/sdk/src/cli/commands/deploy/idp.ts 80.5% -0.2% modified
packages/sdk/src/cli/commands/deploy/resolver.ts 83.0% +1.3% modified
packages/sdk/src/cli/commands/deploy/secret-manager.ts 91.5% -0.6% modified
packages/sdk/src/cli/commands/deploy/tailordb/index.ts 83.7% +0.3% modified

SDK Configure Bundle Size

main (6851982) #1646 (5c85491) +/-
configure-index-size 20.32KB 20.32KB 0KB
dependency-chunks-size 47.12KB 47.12KB 0KB
total-bundle-size 67.44KB 67.44KB 0KB

Runtime Performance

main (6851982) #1646 (5c85491) +/-
Generate Median 2,983ms 2,947ms -36ms
Generate Max 3,112ms 2,959ms -153ms
Apply Build Median 3,056ms 2,984ms -72ms
Apply Build Max 3,083ms 3,025ms -58ms

Type Performance (instantiations)

main (6851982) #1646 (5c85491) +/-
tailordb-basic 39,489 39,489 0
tailordb-optional 4,385 4,385 0
tailordb-relation 5,103 5,103 0
tailordb-validate 742 742 0
tailordb-hooks 5,222 5,222 0
tailordb-object 12,510 12,510 0
tailordb-enum 1,450 1,450 0
resolver-basic 9,272 9,272 0
resolver-nested 26,139 26,139 0
resolver-array 18,078 18,078 0
executor-schedule 4,310 4,310 0
executor-webhook 949 949 0
executor-record 5,664 5,664 0
executor-resolver 4,108 4,108 0
executor-operation-function 937 937 0
executor-operation-gql 945 945 0
executor-operation-webhook 956 956 0
executor-operation-workflow 1,789 1,789 0

Reported by octocov

@toiroakr toiroakr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@toiroakr toiroakr merged commit be8a611 into main Jul 3, 2026
41 checks passed
@toiroakr toiroakr deleted the refactor/dedup-deploy-ownership branch July 3, 2026 21:01
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