Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
a9c0963
feat: auto-sync manifest from remote when creating with --app
srtaalej Sep 24, 2026
7b981e9
fix: reinitialize SDK config before manifest sync in create
srtaalej Sep 24, 2026
90d2c6d
feat: add quiet mode to manifest sync for create flow
srtaalej Sep 24, 2026
5d4217d
fix: show warning with remediation when manifest sync fails during cr…
srtaalej Sep 24, 2026
944e498
refactor: inline remote manifest fetch in create instead of calling Sync
srtaalej Sep 24, 2026
6ee329d
test: add coverage for manifest fetch failure during create with --app
srtaalej Sep 28, 2026
573a108
refactor: consolidate create link test helpers into parameterized setup
srtaalej Sep 28, 2026
d7c7816
refactor: simplify setupCreateLinkMocks to use explicit error param
srtaalej Sep 28, 2026
1dd8ed6
refactor: scope changes to create command only, use AuthWithTeamID fo…
srtaalej Sep 29, 2026
e3eeae4
Merge branch 'main' into ale-consolidate-create-sync
mwbrooks Sep 29, 2026
a607b52
fix: address review feedback for create --app manifest sync
srtaalej Oct 6, 2026
ae612be
fix: hash exported manifest and avoid mutating it when stripping loca…
srtaalej Oct 6, 2026
629f7eb
fix: show create --app manifest result in an App Manifest section
srtaalej Oct 6, 2026
0b5068a
Merge branch 'main' into ale-consolidate-create-sync
srtaalej Oct 6, 2026
691efd0
test: cover remote-source skip, deployed apps, remedy output and app …
srtaalej Oct 6, 2026
72a9fe9
Merge branch 'main' into ale-consolidate-create-sync
srtaalej Oct 8, 2026
6c82c8c
Merge branch 'main' into ale-consolidate-create-sync
srtaalej Oct 8, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions cmd/project/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ import (
"time"

"github.com/slackapi/slack-cli/cmd/app"
"github.com/slackapi/slack-cli/internal/config"
"github.com/slackapi/slack-cli/internal/iostreams"
"github.com/slackapi/slack-cli/internal/manifest"
"github.com/slackapi/slack-cli/internal/pkg/create"
"github.com/slackapi/slack-cli/internal/shared"
"github.com/slackapi/slack-cli/internal/shared/types"
Expand Down Expand Up @@ -238,12 +240,61 @@ func runCreateCommand(clients *shared.ClientFactory, cmd *cobra.Command, args []
Text: "App",
Secondary: app.FormatListSuccess([]types.App{*linkedApp}),
}))

// Fetch remote manifest and write it to the local project.
// Skip for remote-source projects where manifest.json is not used.
manifestSource, _ := clients.Config.ProjectConfig.GetManifestSource(ctx)
if !manifestSource.Equals(config.ManifestSourceRemote) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
if !manifestSource.Equals(config.ManifestSourceRemote) {
if manifestSource.Equals(config.ManifestSourceLocal) {

🔬 question: Can we reverse this for more confidence in this case? IIRC we want to update local manifest sources in particular as part of the PR?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🦠 note: I'm cautious that no source might be possible but testing seems to set the default configurations before we get to this point.

syncRemedy := " Run %s to sync manually"
syncRemedyCmd := style.Commandf("manifest sync --manifest-source=remote", false)
if auth, err := clients.Auth().AuthWithTeamID(ctx, linkedApp.TeamID); err != nil {
clients.IO.PrintWarning(ctx, "Failed to resolve auth for manifest sync: %s", err)
clients.IO.PrintInfo(ctx, false, syncRemedy, syncRemedyCmd)
} else if remoteManifest, err := clients.AppClient().Manifest.GetManifestRemote(ctx, auth.Token, linkedApp.AppID); err != nil {
clients.IO.PrintWarning(ctx, "Failed to fetch manifest from app settings: %s", err)
clients.IO.PrintInfo(ctx, false, syncRemedy, syncRemedyCmd)
} else {
appManifest := remoteManifest.AppManifest
if linkedApp.IsDev {
appManifest = manifest.StripDevLocalSuffix(appManifest)
}
writeResult, err := manifest.WriteManifestLocal(clients.Fs, absProjectPath, appManifest)
if err != nil {
clients.IO.PrintWarning(ctx, "Failed to write manifest to project: %s", err)
clients.IO.PrintInfo(ctx, false, syncRemedy, syncRemedyCmd)
} else if writeResult.Written {
lines := []string{fmt.Sprintf("%s Updated manifest.json from app settings", style.Green("✓"))}
if writeResult.Warning != "" {
lines = append(lines, fmt.Sprintf("%s %s", style.Yellow("!"), writeResult.Warning))
}
printCreateManifestSection(ctx, clients, lines...)
// Hash the remote manifest as exported, since install compares against the export.
hash, err := clients.Config.ProjectConfig.Cache().NewManifestHash(ctx, remoteManifest.AppManifest)
if err == nil {
_ = clients.Config.ProjectConfig.Cache().SetManifestHash(ctx, linkedApp.AppID, hash)
}
Comment on lines +271 to +275

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

👁️‍🗨️ thought: A debug log for these errors might make later troubleshooting more simple?

} else {
printCreateManifestSection(ctx, clients,
"Skipped copying app settings to the project: no manifest.json found in the project root",
"Your project manifest is managed elsewhere (e.g. manifest.ts), so no changes were made",
)
}
}
}
}

printCreateSuccess(ctx, clients, appDirPath)
return nil
}

func printCreateManifestSection(ctx context.Context, clients *shared.ClientFactory, lines ...string) {
clients.IO.PrintInfo(ctx, false, "%s", style.Sectionf(style.TextSection{
Emoji: "books",
Text: "App Manifest",
Secondary: lines,
}))
}

// printCreateSuccess outputs an informative message after creating a new app
func printCreateSuccess(ctx context.Context, clients *shared.ClientFactory, appPath string) {
// Check if this is a Deno project to conditionally enable some features
Expand Down
Loading
Loading