feat(tpagectl): add diff command #626
No reviewers
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
thwap/thwap-pagesd!626
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/tpagectl-diff"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Implements Phase 10
diffcommand (roadmap #313).internal/tpagectl/siteconfig— defines the declared site-config document (SiteConfig{Name, Owner, Visibility, CustomDomain, PreviewEnabled}, YAML/JSON). This is the format the futureexportcommand will write, sodiffandexportinterop.internal/tpagectl/diff—tpagectl diff SITE:<SITE>.yaml(or--file), fetchesGET /api/v1/sites/{name}, and comparesvisibility,custom_domain,preview_enabled,name,owner.field: declared -> actuallines (empty →-), mirroring thesite updatediff style;Site "…" is in sync.when clean; a 404 is reported as drift (site not deployed on the daemon).--exit-codeexits 1 on drift for scripting (likestatus); drift lines are colored yellow viaui; site is resolved positionally or via--sitewith the interactive picker on a terminal.Why
Roadmap task #313.
Testing
siteconfig: YAML + JSON load, missing-file and parse errorsdiff:driftunit tests (in-sync, per-field, name/owner); e2e in-sync, drift, 404-not-deployed,--exit-code(exit 1) vs a fake daemon; missing config file → config errordiff --helpwiring via the root command; root-help golden + docs regeneratedgo test -race ./...passes (34 packages);make coverage= 85.0% (≥80% gate)golangci-lint runclean; pre-commit hooks passBreaking Changes
None. Adds a
diffcommand and the sharedsiteconfigpackage.Notes
No
thwap-actionsaction applies (CLI feature). The declared-state file format introduced here is reused by the futureexportcommand (#316).Closes #311
Closes #312
Closes #313
Add `tpagectl diff SITE` which compares a site's declared configuration against the daemon's actual state and prints any drift: - New internal/tpagectl/siteconfig package defines the declared site-config document (YAML/JSON); the future export command will write the same format. - diff reads <SITE>.yaml (or --file), fetches GET /api/v1/sites/{name}, and prints per-field `field: declared -> actual` lines for visibility, custom_domain, preview_enabled, name, and owner (empty -> "-"), mirroring the site update diff style. - "Site ... is in sync." when no drift; a 404 is reported as drift (site not deployed); --exit-code exits 1 on drift for scripting. - Site resolved positionally or via --site, with the interactive picker on a terminal; drift lines colored yellow via ui. Documented in the README and regenerated command docs. Closes #311 Closes #312 Closes #313