Skip to content

refactor(apply): centralize plan result display and simplify grouped formatting#882

Open
toiroakr wants to merge 3 commits intofeature/changeset-groupingfrom
refactor/simplify-grouped-display
Open

refactor(apply): centralize plan result display and simplify grouped formatting#882
toiroakr wants to merge 3 commits intofeature/changeset-groupingfrom
refactor/simplify-grouped-display

Conversation

@toiroakr
Copy link
Copy Markdown
Contributor

@toiroakr toiroakr commented Apr 1, 2026

Summary

  • Extract formatChangeEntriesWithFunctionRegistry generic helper into grouped-display.ts, eliminating duplicated format patterns across executor, resolver, auth hook, and workflow modules
  • Move all dry-run display logic out of individual plan functions (planExecutor, planPipeline, planAuth, planWorkflow, planTailorDB) into apply.ts printPlanResults — plan functions now return data only with no print side effects
  • Remove functionRegistryChanges parameter from planAuth, planPipeline, planExecutor, and planWorkflow since function registry grouping is now handled at the display layer
  • Compute display entries once and reuse for both printing and plan summary counting
  • Add formatFunctionRegistryDisplayName for human-readable remaining function registry entries
  • Add cross-action TailorDB grouping test (type=create + gqlPermission=update)

@toiroakr toiroakr requested a review from remiposo as a code owner April 1, 2026 12:26
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 1, 2026

⚠️ No Changeset found

Latest commit: 615c666

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 4 additional findings.

Open in Devin Review

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Apr 1, 2026

Open in StackBlitz

npm i https://pkg.pr.new/@tailor-platform/create-sdk@882

commit: 615c666

Move all dry-run display logic out of individual plan functions into
apply.ts printPlanResults. Plan functions now return data only, with no
side effects. This removes the functionRegistryChanges parameter from
planAuth, planPipeline, planExecutor, and planWorkflow, since function
registry grouping is now handled at the display layer.
@toiroakr toiroakr changed the title refactor(apply): simplify grouped display formatting with generic helper refactor(apply): centralize plan result display and simplify grouped formatting Apr 2, 2026
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

Devin Review found 1 new potential issue.

View 7 additional findings in Devin Review.

Open in Devin Review

Comment on lines +235 to +240
// Print grouped sections
printGroupedDisplaySection("Executors", executorEntries);
printGroupedDisplaySection("Workflows", workflowEntries);
printGroupedDisplaySection("TailorDB resources", tailorDBEntries);
printGroupedDisplaySection("Pipeline resolvers", resolverEntries);
printGroupedDisplaySection("Auth", authEntries);
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.

🟡 TailorDB services and Pipeline services no longer printed in dry-run output

The old code printed TailorDB service changes via serviceChangeSet.print() in planTailorDB and Pipeline service changes via serviceChangeSet.print() in planPipeline. Both calls were removed as part of the centralization, but the new printPlanResults function only prints grouped sections for "TailorDB resources" (types + gqlPermissions), "Pipeline resolvers", "Executors", "Workflows", and "Auth" — it never prints TailorDB service or Pipeline service changes. However, these change sets are still counted in the summary via summarizeChangeSets at apply.ts:393-394 and apply.ts:406. This means users will see a summary like "Plan: 3 to create..." where some counted changes (service creates/updates/deletes) are invisible in the output above the summary line.

Prompt for agents
In printPlanResults (apply.ts), the grouped display sections printed at lines 236-240 are missing TailorDB services and Pipeline services. The old code printed these via serviceChangeSet.print() inside planTailorDB (tailordb/index.ts, removed at old line 1009) and planPipeline (resolver.ts, removed at old line 141).

To fix, either:
1. Add printGroupedDisplaySection calls for TailorDB services and Pipeline services in printPlanResults, e.g. using formatChangeSetEntries(results.tailorDB.changeSet.service, ["service"]) and formatChangeSetEntries(results.pipeline.changeSet.service, ["service"]) and printing them under appropriate section headers, OR
2. Fold the service entries into the existing grouped sections (e.g. prepend TailorDB service entries to the TailorDB resources section, and Pipeline service entries to the Pipeline resolvers section).

The key requirement is that these change sets are already counted in the summary at summarizeChangeSets (lines 392-410), so they must also be visible in the printed output for consistency.
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

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