Skip to content

feat(application): platform app build task that runs after build_application across envs#10364

Open
davidfirst wants to merge 2 commits into
masterfrom
feat-platform-app-build-task
Open

feat(application): platform app build task that runs after build_application across envs#10364
davidfirst wants to merge 2 commits into
masterfrom
feat-platform-app-build-task

Conversation

@davidfirst
Copy link
Copy Markdown
Member

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-build artifact 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

  • New Application.platform?: boolean opt-in on the app.
  • AppsBuildTask gains a shouldRunForApp hook and skips apps where platform === true.
  • New PlatformAppsBuildTask extends AppsBuildTask, runs only for platform apps, and declares dependencies: ['teambit.harmony/application:build_application']. The existing toposort in the end location bucket places build_application (every env) ahead of build_platform_application (every env), so by the time the platform task fires, every other env has already emitted its app-bundle artifact.
  • DeployTask resolves build metadata from the correct task name based on app.platform.

Test plan

  • Run build on a platform lane and confirm the platform's bundler finds upstream app-build artifacts regardless of env iteration order
  • Confirm non-platform apps still build and deploy via build_application / deploy_application unchanged
  • Platform components: set platform = true on the Platform class to opt in

Copilot AI review requested due to automatic review settings May 11, 2026 17:59
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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?: boolean opt-in to classify platform apps.
  • Updated AppsBuildTask to skip platform apps via a new shouldRunForApp() hook, and introduced PlatformAppsBuildTask that runs only for platform apps and depends on build_application.
  • Updated DeployTask to resolve build metadata from build_platform_application when 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.

Comment thread scopes/harmony/application/build-application.task.ts
Comment thread scopes/harmony/application/deploy.task.ts
Comment thread scopes/harmony/application/build-platform-application.task.ts
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