feat(application): platform app build task that runs after build_application across envs#10364
Open
davidfirst wants to merge 2 commits into
Open
feat(application): platform app build task that runs after build_application across envs#10364davidfirst wants to merge 2 commits into
davidfirst wants to merge 2 commits into
Conversation
…ication across envs
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a dedicated build task for “platform” apps (apps that bundle other apps’ build artifacts) so they can reliably run after all envs have completed build_application, avoiding cross-env ordering issues where a platform bundler reads artifacts that don’t exist yet.
Changes:
- Added
Application.platform?: booleanopt-in to classify platform apps. - Updated
AppsBuildTaskto skip platform apps via a newshouldRunForApp()hook, and introducedPlatformAppsBuildTaskthat runs only for platform apps and depends onbuild_application. - Updated
DeployTaskto resolve build metadata frombuild_platform_applicationwhen deploying platform apps.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| scopes/harmony/application/deploy.task.ts | Selects build-task results based on app.platform so deploy reads metadata from the correct build task. |
| scopes/harmony/application/build-platform-application.task.ts | New build task (build_platform_application) that runs after build_application and targets only platform apps. |
| scopes/harmony/application/build-application.task.ts | Adds shouldRunForApp() and skips apps marked platform === true. |
| scopes/harmony/application/application.ts | Introduces the platform?: boolean flag on the Application interface with behavior documentation. |
| scopes/harmony/application/application.main.runtime.ts | Registers the new PlatformAppsBuildTask alongside the existing app build task. |
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.
Adds a dedicated build task for "platform" apps (apps that bundle other apps' build artifacts), so cross-env ordering can't leave a platform's bundler reading an artifact that hasn't been produced yet.
Why
On a lane with a platform-app (node env) that embeds a frontend-app (react env) and a backend-app (node env), the build pipeline iterates env-by-env. When node env runs first, the platform-app's bundler can't find the frontend-app's
app-buildartifact because react env hasn't run yet. Toposorting envs by component deps doesn't work — components across envs often form env-level cycles even when component deps are acyclic.How
Application.platform?: booleanopt-in on the app.AppsBuildTaskgains ashouldRunForApphook and skips apps whereplatform === true.PlatformAppsBuildTaskextendsAppsBuildTask, runs only for platform apps, and declaresdependencies: ['teambit.harmony/application:build_application']. The existing toposort in theendlocation bucket placesbuild_application(every env) ahead ofbuild_platform_application(every env), so by the time the platform task fires, every other env has already emitted its app-bundle artifact.DeployTaskresolves build metadata from the correct task name based onapp.platform.Test plan
build_application/deploy_applicationunchangedplatform = trueon thePlatformclass to opt in