Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
21 changes: 20 additions & 1 deletion .github/workflows/ad-hoc-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ jobs:
with:
branch: ${{ inputs.branch }}

mcp-build:
name: mcp-build
uses: ./.github/workflows/mcp-build.yml
secrets: inherit
with:
branch: ${{ inputs.branch }}

rts-build:
name: rts-build
uses: ./.github/workflows/rts-build.yml
Expand All @@ -49,7 +56,7 @@ jobs:
branch: ${{ inputs.branch }}

package:
needs: [server-build, client-build, rts-build]
needs: [server-build, client-build, mcp-build, rts-build]
runs-on: ubuntu-latest
# Set permissions since we're using OIDC token authentication between Depot and GitHub
permissions:
Expand Down Expand Up @@ -94,6 +101,18 @@ jobs:
echo "Cleaning up the tar files"
rm app/client/packages/rts/dist/rts-dist.tar

- name: Download the MCP build artifact
uses: actions/download-artifact@v4
with:
name: mcp-dist
path: app/client/packages/mcp/dist

- name: Untar the MCP folder
run: |
tar -xvf app/client/packages/mcp/dist/mcp-dist.tar -C app/client/packages/mcp/
echo "Cleaning up the MCP tar files"
rm app/client/packages/mcp/dist/mcp-dist.tar

- name: Generate info.json
id: info_json
run: |
Expand Down
11 changes: 10 additions & 1 deletion .github/workflows/build-client-server-count.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,15 @@ jobs:
with:
pr: ${{fromJson(needs.file-check.outputs.pr)}}
skip-tests: "true"

mcp-build:
name: mcp-build
needs: [file-check]
if: success() && needs.file-check.outputs.runId == '0'
uses: ./.github/workflows/mcp-build.yml
secrets: inherit
with:
pr: ${{fromJson(needs.file-check.outputs.pr)}}

rts-build:
name: rts-build
Expand All @@ -148,7 +157,7 @@ jobs:
pr: ${{fromJson(needs.file-check.outputs.pr)}}

build-docker-image:
needs: [file-check, client-build, server-build, rts-build]
needs: [file-check, client-build, server-build, mcp-build, rts-build]
# Only run if the build step is successful
if: success() && needs.file-check.outputs.runId == '0'
name: build-docker-image
Expand Down
11 changes: 10 additions & 1 deletion .github/workflows/build-client-server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,15 @@ jobs:
checkout-ref: ${{ needs.file-check.outputs.merge_sha }}
skip-tests: "true"

mcp-build:
name: mcp-build
needs: [file-check]
if: success() && needs.file-check.outputs.runId == '0'
uses: ./.github/workflows/mcp-build.yml
secrets: inherit
with:
pr: ${{fromJson(needs.file-check.outputs.pr)}}

rts-build:
name: rts-build
needs: [file-check]
Expand All @@ -356,7 +365,7 @@ jobs:
checkout-ref: ${{ needs.file-check.outputs.merge_sha }}

build-docker-image:
needs: [file-check, client-build, server-build, rts-build]
needs: [file-check, client-build, server-build, mcp-build, rts-build]
# Only run if the build step is successful
if: success() && needs.file-check.outputs.runId == '0'
name: build-docker-image
Expand Down
13 changes: 13 additions & 0 deletions .github/workflows/build-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,19 @@ jobs:
name: server-build
path: app/server/dist/

- name: Download the MCP build artifact
if: steps.run_result.outputs.run_result != 'success'
uses: actions/download-artifact@v4
with:
name: mcp-dist
path: app/client/packages/mcp/dist

- name: Un-tar the MCP folder
run: |
tar -xvf app/client/packages/mcp/dist/mcp-dist.tar -C app/client/packages/mcp/
echo "Cleaning up the MCP tar files"
rm app/client/packages/mcp/dist/mcp-dist.tar

- name: Download the rts build artifact
if: steps.run_result.outputs.run_result != 'success'
uses: actions/download-artifact@v4
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/docs/test-build-docker-image.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,13 @@ The `client-build` job builds the client-side codebase. It uses the configuratio

The `rts-build` job builds the "rts" (real-time suggestions) package of the client-side codebase. It uses the configuration defined in `.github/workflows/rts-build.yml` and inherits secrets from the repository.

### `mcp-build`

This job builds and tests the MCP service, then supplies its bundled artifact to the Docker-image jobs.

### `build-docker-image`

This job, named `build-docker-image`, creates and pushes the Docker image for the application. It is dependent on the success of the `client-build`, `server-build`, and `rts-build` jobs. The Docker image is built with two platforms: `linux/arm64` and `linux/amd64`.
This job, named `build-docker-image`, creates and pushes the Docker image for the application. It is dependent on the success of the `client-build`, `server-build`, `rts-build`, and `mcp-build` jobs. The Docker image is built with two platforms: `linux/arm64` and `linux/amd64`.

### `ci-test`

Expand Down
22 changes: 21 additions & 1 deletion .github/workflows/github-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,16 @@ jobs:
path: app/client/packages/rts/rts-dist.tar
overwrite: true

mcp-build:
needs:
- prelude
uses: ./.github/workflows/mcp-build.yml
secrets: inherit
with:
branch: ${{ github.ref }}

package:
needs: [prelude, client-build, server-build, rts-build]
needs: [prelude, client-build, server-build, rts-build, mcp-build]

runs-on: ubuntu-latest
permissions:
Expand Down Expand Up @@ -231,6 +239,18 @@ jobs:
name: server-build
path: app/server/dist

- name: Download the MCP build artifact
uses: actions/download-artifact@v4
with:
name: mcp-dist
path: app/client/packages/mcp/dist

- name: Untar the MCP folder
run: |
tar -xvf app/client/packages/mcp/dist/mcp-dist.tar -C app/client/packages/mcp/
echo "Cleaning up the MCP tar files"
rm app/client/packages/mcp/dist/mcp-dist.tar

- name: Download the rts build artifact
uses: actions/download-artifact@v4
with:
Expand Down
112 changes: 112 additions & 0 deletions .github/workflows/mcp-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
name: Build MCP Workflow

# Least privilege: this workflow only reads the repo and uploads/downloads artifacts.
permissions:
contents: read

on:
workflow_dispatch:
workflow_call:
inputs:
pr:
description: "PR number when building a pull-request merge commit"
required: false
type: number
skip-tests:
description: "Skip unit tests for image-only builds"
required: false
type: string
default: "false"
branch:
description: "Branch to build when pr is 0"
required: false
type: string

pull_request:
branches: [release, master]
paths:
- "app/client/packages/mcp/**"

defaults:
run:
working-directory: app/client/packages/mcp
shell: bash

jobs:
build:
runs-on: ubuntu-latest
if: |
github.event.pull_request.head.repo.full_name == github.repository ||
github.event_name == 'push' ||
github.event_name == 'workflow_dispatch' ||
github.event_name == 'repository_dispatch' ||
github.event_name == 'schedule' ||
github.event_name == 'release'
steps:
- name: Checkout the merged pull-request commit
if: inputs.pr != 0
uses: actions/checkout@v4
with:
fetch-tags: true
persist-credentials: false
ref: refs/pull/${{ inputs.pr }}/merge

- name: Checkout the specified branch
if: inputs.pr == 0 && inputs.branch != ''
uses: actions/checkout@v4
with:
fetch-tags: true
persist-credentials: false
ref: ${{ inputs.branch }}

- name: Checkout the head commit
if: inputs.pr == 0 && inputs.branch == ''
uses: actions/checkout@v4
with:
fetch-tags: true
persist-credentials: false

- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version-file: app/client/package.json

# actions/setup-node@v4 does not restore Yarn 3 caches from a subdirectory.
- name: Restore Yarn cache
uses: actions/cache@v4
with:
path: app/client/.yarn/cache
key: v1-yarn3-${{ hashFiles('app/client/yarn.lock') }}
restore-keys: |
v1-yarn3-

- name: Install dependencies
run: |
corepack enable
yarn install --immutable

- name: Check types
run: yarn check-types

- name: Lint
run: yarn lint

- name: Check formatting
run: yarn prettier

- name: Run unit tests
if: inputs.skip-tests != 'true'
run: yarn test:unit

- name: Build
run: yarn build

- name: Tar the MCP bundle
run: tar -cvf mcp-dist.tar dist

- name: Upload MCP build bundle
uses: actions/upload-artifact@v4
with:
name: mcp-dist
path: app/client/packages/mcp/mcp-dist.tar
overwrite: true
58 changes: 48 additions & 10 deletions .github/workflows/on-demand-build-docker-image-deploy-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,36 @@ on:
description: Base image tag to use (overrides branch-based default)
required: false
type: string
skip-tests:
description: Skip tests during the build (same as slash-command skip-tests)
required: false
type: boolean
default: true

jobs:
resolve-params:
runs-on: ubuntu-latest
outputs:
pr_number: ${{ steps.resolve.outputs.pr_number }}
skip_tests: ${{ steps.resolve.outputs.skip_tests }}
steps:
- name: Resolve PR number
- name: Resolve PR number and skip-tests
id: resolve
env:
SLASH_PR: ${{ github.event.client_payload.pull_request.number }}
INPUT_PR: ${{ inputs.issue_number }}
SLASH_SKIP_TESTS: ${{ github.event.client_payload.slash_command.args.named.skip-tests }}
INPUT_SKIP_TESTS: ${{ inputs.skip-tests }}
run: |
if [[ -n "${{ github.event.client_payload.pull_request.number }}" ]]; then
echo "pr_number=${{ github.event.client_payload.pull_request.number }}" >> "$GITHUB_OUTPUT"
if [[ -n "$SLASH_PR" ]]; then
echo "pr_number=$SLASH_PR" >> "$GITHUB_OUTPUT"
else
echo "pr_number=$INPUT_PR" >> "$GITHUB_OUTPUT"
fi
if [[ -n "$SLASH_SKIP_TESTS" ]]; then
echo "skip_tests=$SLASH_SKIP_TESTS" >> "$GITHUB_OUTPUT"
else
echo "pr_number=${{ inputs.issue_number }}" >> "$GITHUB_OUTPUT"
echo "skip_tests=$INPUT_SKIP_TESTS" >> "$GITHUB_OUTPUT"
fi

notify-job-details:
Expand All @@ -44,7 +60,7 @@ jobs:
body: |
Deploying Your Preview: <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}>.
Workflow: `${{ github.workflow }}`.
skip-tests: `${{ github.event.client_payload.slash_command.args.named.skip-tests }}`.
skip-tests: `${{ needs.resolve-params.outputs.skip_tests }}`.
env: `${{ github.event.client_payload.slash_command.args.named.env }}`.
PR: ${{ needs.resolve-params.outputs.pr_number }}.
recreate: ${{ github.event.client_payload.slash_command.args.named.recreate }}.
Expand All @@ -58,7 +74,7 @@ jobs:
secrets: inherit
with:
pr: ${{ fromJSON(needs.resolve-params.outputs.pr_number) }}
skip-tests: ${{ github.event.client_payload.slash_command.args.named.skip-tests }}
skip-tests: ${{ needs.resolve-params.outputs.skip_tests }}
is-pg-build: ${{ github.event.client_payload.pull_request.base.ref == 'pg' }}

client-build:
Expand All @@ -69,7 +85,17 @@ jobs:
secrets: inherit
with:
pr: ${{ fromJSON(needs.resolve-params.outputs.pr_number) }}
skip-tests: ${{ github.event.client_payload.slash_command.args.named.skip-tests }}
skip-tests: ${{ needs.resolve-params.outputs.skip_tests }}

mcp-build:
needs: [resolve-params]
name: mcp-build
if: github.event.client_payload.slash_command.args.named.env != 'release'
uses: ./.github/workflows/mcp-build.yml
secrets: inherit
with:
pr: ${{ fromJSON(needs.resolve-params.outputs.pr_number) }}
skip-tests: ${{ needs.resolve-params.outputs.skip_tests }}

rts-build:
needs: [resolve-params]
Expand All @@ -79,7 +105,7 @@ jobs:
secrets: inherit
with:
pr: ${{ fromJSON(needs.resolve-params.outputs.pr_number) }}
skip-tests: ${{ github.event.client_payload.slash_command.args.named.skip-tests }}
skip-tests: ${{ needs.resolve-params.outputs.skip_tests }}

vercel-build:
needs: [resolve-params]
Expand Down Expand Up @@ -149,7 +175,7 @@ jobs:
})

push-image:
needs: [resolve-params, client-build, rts-build, server-build]
needs: [resolve-params, client-build, mcp-build, rts-build, server-build]
runs-on: ubuntu-latest
permissions:
contents: read
Expand Down Expand Up @@ -189,6 +215,18 @@ jobs:
name: server-build
path: app/server/dist

- name: Download the MCP build artifact
uses: actions/download-artifact@v4
with:
name: mcp-dist
path: app/client/packages/mcp/dist

- name: Untar the MCP folder
run: |
tar -xvf app/client/packages/mcp/dist/mcp-dist.tar -C app/client/packages/mcp/
echo "Cleaning up the MCP tar files"
rm app/client/packages/mcp/dist/mcp-dist.tar

- name: Download the rts build artifact
uses: actions/download-artifact@v4
with:
Expand Down Expand Up @@ -343,4 +381,4 @@ jobs:
with:
issue-number: ${{ needs.resolve-params.outputs.pr_number }}
body: |
Deploy-Preview-URL: https://${{ vars.EDITION }}-${{ needs.resolve-params.outputs.pr_number }}.dp.appsmith.com
Deploy-Preview-URL: https://${{ vars.EDITION }}-${{ needs.resolve-params.outputs.pr_number }}.dp.appsmith.com
Loading
Loading