Skip to content

feat: add two-way manifest sync between project and app settings#543

Draft
mwbrooks wants to merge 1 commit into
mainfrom
mwbrooks-2-way-manifest-sync
Draft

feat: add two-way manifest sync between project and app settings#543
mwbrooks wants to merge 1 commit into
mainfrom
mwbrooks-2-way-manifest-sync

Conversation

@mwbrooks
Copy link
Copy Markdown
Member

Changelog

Added slack manifest sync command (and slack sync alias) that detects per-field differences between the local manifest.json and remote app settings, prompts users to resolve conflicts, and writes the merged result to both sides. Gated behind --experiment=manifest-sync.

Summary

This pull request adds two-way manifest sync so developers can resolve differences between their local manifest.json and the remote app settings on api.slack.com.

Today, when manifest.source=local, the local manifest silently overwrites the API on next install — discarding changes made on the web. This feature replaces the binary "Overwrite?" prompt with a per-field resolution flow when divergence is detected.

Key additions:

  • internal/pkg/manifest/ — flatten, diff, merge, display, writeback, and sync orchestrator
  • cmd/manifest/sync.go — standalone slack manifest sync command
  • slack sync alias in cmd/root.go
  • manifest-sync experiment flag for gated rollout
  • Integration into shouldUpdateManifest() in the install flow

Preview

📚 App Manifest
   Found 2 difference(s) between project and app settings

  display_information.description
    Project:      "A cool app for teams"
    App settings: "A cool app for collaboration"

  functions.new_func (only in project)
    Value: {"title":"New Function","description":"Greets"}

? How would you like to resolve these differences?
  > Use all project values
    Use all app settings values
    Choose for each difference

  Syncing manifest...
  ✓ Updated app settings
  ✓ Updated manifest.json

📚 App Manifest
   Finished manifest sync for "My App"

Testing

  1. Build the CLI: make build
  2. In a project with manifest.json, install an app: ./bin/slack install -e manifest-sync
  3. No differences: Run ./bin/slack manifest sync -e manifest-sync — should report "in sync"
  4. Remote change: Edit the manifest on https://app.slack.com/app-settings, then run ./bin/slack manifest sync -e manifest-sync — should show the difference, choose "Use all app settings values", verify manifest.json updated
  5. Local change: Edit manifest.json, run ./bin/slack manifest sync -e manifest-sync — choose "Use all project values", verify app settings updated
  6. Both sides changed: Edit manifest.json and app settings (different fields), run sync, choose "Choose for each difference" — verify per-field resolution works and both sides reflect the merged result
  7. Key order preserved: After sync, git diff manifest.json should only show value changes, not key reordering
  8. Triggered during install: Make a remote change, run ./bin/slack install -e manifest-sync — sync flow triggers instead of old "Overwrite?" prompt
  9. Force flag: Make a remote change, run ./bin/slack install -e manifest-sync --force — old behavior, local overwrites remote
  10. Without experiment: Run ./bin/slack install with a remote change — old "Overwrite?" prompt (unchanged behavior)

Notes

  • The set-manifest hook for code-generated manifests (e.g., manifest.ts) is not included in this initial implementation. For those projects, the merged manifest is pushed to the API only, with a warning that the local project was not updated.
  • Uses a two-way (local vs remote) comparison model rather than three-way merge. This avoids stale cached base issues in multi-developer scenarios.
  • The --force-remote flag (remote overwrites local) is a follow-up item.

Requirements

When the manifest-sync experiment is enabled, the CLI detects per-field
differences between the local manifest.json and the remote app settings,
lets the user resolve them interactively, and writes the merged result to
both sides. This replaces the binary "overwrite?" prompt when divergence
is detected during install/deploy.

Adds `slack manifest sync` command and `slack sync` alias.
Gated behind --experiment=manifest-sync.
@codecov
Copy link
Copy Markdown

codecov Bot commented May 13, 2026

Codecov Report

❌ Patch coverage is 43.55972% with 241 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.96%. Comparing base (f2e54bc) to head (58e107c).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
internal/pkg/manifest/display.go 0.00% 106 Missing ⚠️
internal/pkg/manifest/sync.go 0.00% 60 Missing ⚠️
internal/pkg/manifest/writeback.go 57.69% 19 Missing and 14 partials ⚠️
cmd/manifest/sync.go 43.47% 12 Missing and 1 partial ⚠️
internal/pkg/manifest/merge.go 87.34% 5 Missing and 5 partials ⚠️
internal/pkg/manifest/diff.go 82.97% 4 Missing and 4 partials ⚠️
internal/pkg/apps/install.go 0.00% 4 Missing and 3 partials ⚠️
internal/pkg/manifest/flatten.go 84.61% 2 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #543      +/-   ##
==========================================
- Coverage   71.56%   70.96%   -0.61%     
==========================================
  Files         224      231       +7     
  Lines       18976    19401     +425     
==========================================
+ Hits        13581    13767     +186     
- Misses       4192     4406     +214     
- Partials     1203     1228      +25     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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