Skip to content

direct: Manage app lifecycle on create as well#5069

Open
andrewnester wants to merge 2 commits intomainfrom
acc/fix-app-config-drift
Open

direct: Manage app lifecycle on create as well#5069
andrewnester wants to merge 2 commits intomainfrom
acc/fix-app-config-drift

Conversation

@andrewnester
Copy link
Copy Markdown
Contributor

Changes

Manage app lifecycle on create as well

Why

Even though Apps backend automatically does the start of the app and initial app deployment when app is created, we need to make a deployment ourselves anyway if lifecycle:started is set to true. It allows us to pass the correct source code path and other deployment configuration at creation.

This also fixes a config-drift test on both local and cloud

Tests

bundle/resources/apps/config-drift test works on Local and Cloud

@andrewnester andrewnester requested review from denik and pietern April 22, 2026 19:15
Updating deployment state...
Deployment complete!

=== Second deploy: pushes code with config
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The fix to deploy on create removes this second deploy which shouldn't be there in the first place and was a sign of the bug

// This happens when an app has no deployment yet (DefaultSourceCodePath is unset).
func (*ResourceApp) OverrideChangeDesc(_ context.Context, path *structpath.PathNode, change *ChangeDesc, remote *AppRemote) error {
if path.String() == "source_code_path" && remote.SourceCodePath == "" {
if path.String() == "source_code_path" && (remote.SourceCodePath == "" || remote.SourceCodePath == "null") {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

API can actually return null as a string for this value

@@ -1,53 +1,4 @@
{
"active_deployment": {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

skipping actions with "skip:action" from output as not relevant for the test

Comment thread bundle/appdeploy/app.go
// GitRepository is not supported in the Deploy API, only as part of Create, so we need to remove it.
if gitSource != nil {
gitSource.GitRepository = nil
}
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.

That sounds asymmetric. Known issue?

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