direct: Manage app lifecycle on create as well#5069
Open
andrewnester wants to merge 2 commits intomainfrom
Open
direct: Manage app lifecycle on create as well#5069andrewnester wants to merge 2 commits intomainfrom
andrewnester wants to merge 2 commits intomainfrom
Conversation
andrewnester
commented
Apr 22, 2026
| Updating deployment state... | ||
| Deployment complete! | ||
|
|
||
| === Second deploy: pushes code with config |
Contributor
Author
There was a problem hiding this comment.
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
andrewnester
commented
Apr 22, 2026
| // 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") { |
Contributor
Author
There was a problem hiding this comment.
API can actually return null as a string for this value
andrewnester
commented
Apr 22, 2026
| @@ -1,53 +1,4 @@ | |||
| { | |||
| "active_deployment": { | |||
Contributor
Author
There was a problem hiding this comment.
skipping actions with "skip:action" from output as not relevant for the test
pietern
approved these changes
Apr 23, 2026
| // 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 | ||
| } |
Contributor
There was a problem hiding this comment.
That sounds asymmetric. Known issue?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-drifttest works on Local and Cloud