Repository: liam-hq/liam
Pull request #912: e2e test to run when deploying with vercel
Author: login: FunamaYukina
Labels: name: Review effort 2/5
Created: 2025-03-17T05:29:20Z | Merged: 2025-03-18T05:58:36Z

## Issue

Added workflow file so that e2e testing runs when deploying by vercel. 
I then deleted the existing ``vercel-deploy-erd.yml.``

✅ e2e test passed
https://github.com/liam-hq/liam/actions/runs/13897536570

The part that allows e2e tests to run after vercel deployment is based on the following.
https://vercel.com/guides/how-can-i-run-end-to-end-tests-after-my-vercel-preview-deployment

## Why is this change needed?
<!-- Please explain briefly why this change is necessary -->

## What would you like reviewers to focus on?
<!-- What specific aspects are you requesting review for? -->

## Testing Verification
<!-- Please describe how you verified these changes in your local environment using text/images/video -->

## What was done
<!-- This section will be filled by PR-Agent when the Pull Request is opened -->

### 🤖 Generated by PR Agent at 478e61e3a5795f010c3f6e2adb0f8008f7f2a698

- Added a new workflow for running E2E tests on deployment success.
- Removed the old Vercel deployment workflow for `erd-sample` app.
- Configured conditional triggers for E2E tests based on deployment environment and target URL.
- Included Slack notifications for E2E test failures in production.


## Detailed Changes
<!-- This section will be filled by PR-Agent when the Pull Request is opened -->

<table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Tests</strong></td><td><table>
<tr>
  <td>
    <details>
      <summary><strong>e2e_tests.yml</strong><dd><code>Introduced E2E tests workflow with conditional triggers</code>&nbsp; &nbsp; </dd></summary>
<hr>

.github/workflows/e2e_tests.yml

<li>Added a new workflow for E2E tests triggered by deployment status.<br> <li> Configured conditional checks for environments and target URLs.<br> <li> Integrated Playwright for browser-based E2E testing.<br> <li> Added Slack notifications for test failures in production.


</details>


  </td>
  <td><a href="https://github.com/liam-hq/liam/pull/912/files#diff-37aed4ad4a8c3a4220c5e3c2eee33093073b8d64f480cc742b63764c859b6c72">+101/-0</a>&nbsp; </td>

</tr>
</table></td></tr><tr><td><strong>Enhancement</strong></td><td><table>
<tr>
  <td>
    <details>
      <summary><strong>vercel-deploy-erd.yml</strong><dd><code>Removed Vercel deployment workflow for `erd-sample`</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

.github/workflows/vercel-deploy-erd.yml

<li>Removed the Vercel deployment workflow for <code>erd-sample</code> app.<br> <li> Deprecated redundant deployment and E2E test triggers.


</details>


  </td>
  <td><a href="https://github.com/liam-hq/liam/pull/912/files#diff-16fc8834a2e94b053dcb88454fe8eedc9d7225f7e0837ebfcc50e0df2c356e8b">+0/-94</a>&nbsp; &nbsp; </td>

</tr>
</table></td></tr></tr></tbody></table>

## Additional Notes
<!-- Any additional information for reviewers -->

___

> <details> <summary>  Need help?</summary><li>Type <code>/help how to ...</code> in the comments thread for any questions about Qodo Merge usage.</li><li>Check out the <a href="https://qodo-merge-docs.qodo.ai/usage-guide/">documentation</a> for more information.</li></details>


Diff:
diff --git a/.github/workflows/_run_e2e_test.yml b/.github/workflows/e2e_tests.yml
similarity index 71%
rename from .github/workflows/_run_e2e_test.yml
rename to .github/workflows/e2e_tests.yml
index 12505dee4c..18f75b2ecf 100644
--- a/.github/workflows/_run_e2e_test.yml
+++ b/.github/workflows/e2e_tests.yml
@@ -1,31 +1,42 @@
-name: Run E2E Tests
+name: E2E Tests
 
 on:
-  workflow_call:
-    inputs:
-      url:
-        required: true
-        type: string
-      environment:
-        required: false
-        type: string
-        default: 'preview'
+  deployment_status:
+
 jobs:
-  e2e-test:
+  e2e-tests:
+    if: |
+      github.event_name == 'deployment_status' &&
+      github.event.deployment_status.state == 'success' &&
+      (
+        (
+          contains(github.event.deployment.environment, 'Production') &&
+          contains(github.event.deployment_status.target_url, 'liam-erd-web')
+        ) ||
+        (
+          contains(github.event.deployment.environment, 'Preview') &&
+          !contains(github.event.deployment_status.target_url, 'liam-erd-sample') &&
+          !contains(github.event.deployment_status.target_url, 'liam-docs')
+        )
+      )
     runs-on: ubuntu-latest
     timeout-minutes: 10
     strategy:
       matrix:
-        browser: [chromium, 'Mobile Safari']
+        browser: [chromium, "Mobile Safari"]
       fail-fast: false
     defaults:
       run:
         working-directory: "frontend/packages/e2e"
     env:
       CI: true
+      URL: ${{ github.event.deployment_status.target_url }}
+      ENVIRONMENT: ${{ github.event.deployment.environment }}
     steps:
       - name: Checkout repository
         uses: actions/checkout@v4
+        with:
+          ref: ${{ github.event.deployment.sha }}
 
       - name: Setup pnpm
         uses: ./.github/actions/pnpm-setup
@@ -51,7 +62,7 @@ jobs:
       - name: Run e2e tests
         run: pnpm exec playwright test --project="${{ matrix.browser }}"
         env:
-          URL: ${{ inputs.url }}
+          URL: ${{ env.URL }}
 
       - name: Upload test results
         uses: actions/upload-artifact@v4
@@ -60,9 +71,9 @@ jobs:
           name: test-results
           path: frontend/packages/e2e/test-results/
           retention-days: 30
-          
+
       - name: Slack Notification on Failure
-        if: ${{ inputs.environment == 'production' && failure() }}
+        if: ${{ env.ENVIRONMENT == 'production' && failure() }}
         uses: tokorom/action-slack-incoming-webhook@d57bf1eb618f3dae9509afefa70d5774ad3d42bf # v1.3.0
         env:
           INCOMING_WEBHOOK_URL: ${{ secrets.SLACK_CLI_CI_WEBHOOK_URL }}
diff --git a/.github/workflows/vercel-deploy-erd.yml b/.github/workflows/vercel-deploy-erd.yml
deleted file mode 100644
index 9d9ab921b4..0000000000
--- a/.github/workflows/vercel-deploy-erd.yml
+++ /dev/null
@@ -1,94 +0,0 @@
-# This workflow specifically deploys the `apps/erd-sample` and `apps/app` app.
-# For deployments of other `apps/*` apps, see `.github/workflows/vercel-deploy.yml`.
-name: Vercel Deployment erd-sample
-
-on:
-  push:
-    branches:
-      - main
-  pull_request:
-  workflow_dispatch:
-
-concurrency:
-  group: ${{ github.workflow }}-${{ github.ref }}
-  cancel-in-progress: true
-
-jobs:
-  setup-deployment:
-    runs-on: ubuntu-latest
-    permissions:
-      contents: read
-      pull-requests: read
-    outputs:
-      environment: ${{ steps.environment.outputs.environment }}
-      has-changes: ${{ steps.changes.outputs.src }}
-    steps:
-      - uses: actions/checkout@v4
-      - uses: tj-actions/branch-names@6c999acf206f5561e19f46301bb310e9e70d8815 # v7.0.7
-        id: branch-name
-      - name: Detect Environment Changes
-        id: environment
-        run: |
-          echo "environment=${{ steps.branch-name.outputs.current_branch == 'main' && 'production' || 'preview' }}" >> $GITHUB_OUTPUT
-      - uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
-        id: changes
-        with:
-          filters: |
-            src:
-              - './.github/workflows/vercel-deploy-erd.yml'
-              - './.github/workflows/_run_e2e_test.yml'
-              - './frontend/apps/app/**'
-              - './frontend/packages/cli/**'
-              - './frontend/packages/db-structure/**'
-              - './frontend/packages/e2e/**'
-              - './frontend/packages/erd-core/**'
-              - './frontend/packages/ui/**'
-              - './pnpm-lock.yaml'
-
-  deploy:
-    name: Deploy
-    needs: [setup-deployment]
-    runs-on: ubuntu-latest
-    timeout-minutes: 15
-    if: ${{ needs.setup-deployment.outputs.has-changes == 'true' }}
-    strategy:
-      matrix:
-        apps:
-          - name: app
-            vercel-project-id-key: VERCEL_PROJECT_ID_ERD_WEB
-    environment:
-      name: "${{ needs.setup-deployment.outputs.environment }} - ${{ matrix.apps.name }}"
-      url: ${{ steps.deployment.outputs.deployment-url }}
-    permissions:
-      contents: read
-      deployments: write
-    outputs:
-      app-name: ${{ matrix.apps.name }}
-      url: ${{ steps.deployment.outputs.deployment-url }}
-    env:
-      VERCEL_ORG_ID: ${{ vars.VERCEL_ORG_ID }}
-      VERCEL_PROJECT_ID: ${{ vars[matrix.apps.vercel-project-id-key] }}
-    steps:
-      - uses: actions/checkout@v4
-      - uses: ./.github/actions/pnpm-setup
-      - name: Pull Vercel Enviroment Infomation
-        run: pnpm exec vercel pull --yes --environment=${{ needs.setup-deployment.outputs.environment }} --token=${{ secrets.VERCEL_TOKEN }}
-      - name: Pull Vercel Enviroment Variables
-        run: pnpm vercel:env-pull --yes --environment=${{ needs.setup-deployment.outputs.environment }} --token=${{ secrets.VERCEL_TOKEN }}
-      - name: Build Project Artifacts
-        run: pnpm exec vercel build ${{ needs.setup-deployment.outputs.environment == 'production' && '--prod' || '' }}
-      - name: Deploy Project Artifacts to Vercel
-        run: |
-          pnpm exec vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }} ${{ needs.setup-deployment.outputs.environment == 'production' && '--prod' || '' }} > deployment-url.txt
-          echo "deployment-url=$(cat deployment-url.txt)" >> $GITHUB_OUTPUT
-        id: deployment
-  run-e2e:
-    needs: deploy
-    if: needs.deploy.result == 'success'
-    uses: ./.github/workflows/_run_e2e_test.yml
-    with:
-      url: ${{ needs.deploy.outputs.url }}
-      environment: ${{ needs.setup-deployment.outputs.environment }}
-    concurrency:
-      group: ${{ github.workflow }}-${{ github.ref }}-e2e
-      cancel-in-progress: true


Reviews:
user: login: FunamaYukina
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-17T08:26:57Z
user: login: MH4GF
body: Thanks!
state: APPROVED
author_association: CONTRIBUTOR
submitted_at: 2025-03-18T00:21:52Z
user: login: FunamaYukina
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-18T05:49:24Z
user: login: MH4GF
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-18T05:52:31Z

Review comments:
diff_hunk: @@ -0,0 +1,100 @@
+name: E2E Tests
+
+on:
+  deployment_status:
+
+jobs:
+  e2e-tests:
+    if: |
+      github.event_name == 'deployment_status' &&
+      github.event.deployment_status.state == 'success' &&
+      (
+        (
+          contains(github.event.deployment.environment, 'Production') &&
+          contains(github.event.deployment_status.target_url, 'liam-erd-web')
+        ) ||
+        (
+          contains(github.event.deployment.environment, 'Preview') &&
+          !contains(github.event.deployment_status.target_url, 'liam-erd-sample') &&
+          !contains(github.event.deployment_status.target_url, 'liam-docs')
+        )
+      )
path: .github/workflows/e2e_tests.yml
user: login: FunamaYukina
body: The preview environment is difficult to identify because of URLs like ``https://vercel.com/route-06-core/liam-app/BUkhUNMkptDdh5dL1D3DQui9A8Vw`` 😞. 
created_at: 2025-03-17T08:26:57Z
author_association: MEMBER
diff_hunk: @@ -0,0 +1,101 @@
+name: E2E Tests
+
+on:
+  deployment_status:
+
+jobs:
+  e2e-tests:
+    if: |
+      github.event_name == 'deployment_status' &&
+      github.event.deployment_status.state == 'success' &&
+      (
+        (
+          contains(github.event.deployment.environment, 'Production') &&
+          contains(github.event.deployment_status.target_url, 'liam-erd-web')
+        ) ||
+        (
+          contains(github.event.deployment.environment, 'Preview') &&
+          !contains(github.event.deployment_status.target_url, 'liam-erd-sample') &&
path: .github/workflows/e2e_tests.yml
user: login: MH4GF
body: It is better to E2E test `liam-erd-sample` as well, what do you think?
created_at: 2025-03-18T00:20:08Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,101 @@
+name: E2E Tests
+
+on:
+  deployment_status:
+
+jobs:
+  e2e-tests:
+    if: |
+      github.event_name == 'deployment_status' &&
+      github.event.deployment_status.state == 'success' &&
+      (
+        (
+          contains(github.event.deployment.environment, 'Production') &&
+          contains(github.event.deployment_status.target_url, 'liam-erd-web')
+        ) ||
+        (
+          contains(github.event.deployment.environment, 'Preview') &&
+          !contains(github.event.deployment_status.target_url, 'liam-erd-sample') &&
path: .github/workflows/e2e_tests.yml
user: login: FunamaYukina
body: That was true.🙏
I have also made the test run on ``erd-sample``.
However, let me add this in the next pull request because VRT（mobile） was always in a state to fail.💭
https://github.com/liam-hq/liam/actions/runs/13916160365/job/38939497913
I give up adding to this PR.
created_at: 2025-03-18T05:49:24Z
author_association: MEMBER
diff_hunk: @@ -0,0 +1,101 @@
+name: E2E Tests
+
+on:
+  deployment_status:
+
+jobs:
+  e2e-tests:
+    if: |
+      github.event_name == 'deployment_status' &&
+      github.event.deployment_status.state == 'success' &&
+      (
+        (
+          contains(github.event.deployment.environment, 'Production') &&
+          contains(github.event.deployment_status.target_url, 'liam-erd-web')
+        ) ||
+        (
+          contains(github.event.deployment.environment, 'Preview') &&
+          !contains(github.event.deployment_status.target_url, 'liam-erd-sample') &&
path: .github/workflows/e2e_tests.yml
user: login: MH4GF
body: This is difficult... thank you!
created_at: 2025-03-18T05:52:31Z
author_association: CONTRIBUTOR

PR comments:
user: login: changeset-bot[bot]
created_at: 2025-03-17T05:29:25Z
body: ###  ⚠️  No Changeset found

Latest commit: 54a2c211d216b7ff8f542f94651bb7835668992c

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. **If these changes should result in a version bump, you need to add a changeset.**

<details><summary>This PR includes no changesets</summary>

  When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

</details>

[Click here to learn what changesets are, and how to add one](https://github.com/changesets/changesets/blob/main/docs/adding-a-changeset.md).

[Click here if you're a maintainer who wants to add a changeset to this PR](https://github.com/liam-hq/liam/new/feat/add-run-e2e-workflow?filename=.changeset/soft-llamas-watch.md&value=---%0A%0A---%0A%0Ae2e%20test%20to%20run%20when%20deploying%20with%20vercel%0A)


author_association: NONE
user: login: vercel[bot]
created_at: 2025-03-17T05:29:25Z
body: [vc]: #ZnE9uPo8tsPK18I1a7+yksCV0Mf3eHJYSdN1cj9EDGs=:eyJpc01vbm9yZXBvIjp0cnVlLCJ0eXBlIjoiZ2l0aHViIiwicHJvamVjdHMiOlt7Im5hbWUiOiJ0ZXN0LWxpYW0tZG9jcyIsInJvb3REaXJlY3RvcnkiOiJmcm9udGVuZC9hcHBzL2RvY3MiLCJsaXZlRmVlZGJhY2siOnsicmVzb2x2ZWQiOjAsInVucmVzb2x2ZWQiOjAsInRvdGFsIjowLCJsaW5rIjoiIn0sImluc3BlY3RvclVybCI6Imh0dHBzOi8vdmVyY2VsLmNvbS9yb3V0ZS0wNi1jb3JlL3Rlc3QtbGlhbS1kb2NzL0h2UzJaVko0WjFvN1B2dW55dktRTG02VnVBSnIiLCJuZXh0Q29tbWl0U3RhdHVzIjoiSUdOT1JFRCJ9LHsibmFtZSI6InRlc3QtbGlhbS1lcmQtd2ViIiwicm9vdERpcmVjdG9yeSI6ImZyb250ZW5kL2FwcHMvYXBwIiwiaW5zcGVjdG9yVX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dENvbW1pdFN0YXR1cyI6IklHTk9SRUQiLCJsaXZlRmVlZGJhY2siOnsicmVzb2x2ZWQiOjAsInVucmVzb2x2ZWQiOjAsInRvdGFsIjowLCJsaW5rIjoiIn19LHsibmFtZSI6ImxpYW0tYXBwIiwicm9vdERpcmVjdG9yeSI6ImZyb250ZW5kL2FwcHMvYXBwIiwiaW5zcGVjdG9yVXJsIjoiaHR0cHM6Ly92ZXJjZWwuY29tL3JvdXRlLTA2LWNvcmUvbGlhbS1hcHAvOFpyQ3YxanN5eFNGTUVqdDVDS2FnQW80b3lyQiIsInByZXZpZXdVcmwiOiJsaWFtLWFwcC1naXQtZmVhdC1hZGQtcnVuLWUyZS13b3JrZmxvdy1yb3V0ZS0wNi1jb3JlLnZlcmNlbC5hcHAiLCJuZXh0Q29tbWl0U3RhdHVzIjoiREVQTE9ZRUQiLCJsaXZlRmVlZGJhY2siOnsicmVzb2x2ZWQiOjAsInVucmVzb2x2ZWQiOjAsInRvdGFsIjowLCJsaW5rIjoibGlhbS1hcHAtZ2l0LWZlYXQtYWRkLXJ1bi1lMmUtd29ya2Zsb3ctcm91dGUtMDYtY29yZS52ZXJjZWwuYXBwIn19XX0=
**The latest updates on your projects**. Learn more about [Vercel for Git ↗︎](https://vercel.link/github-learn-more)

| Name | Status | Preview | Comments | Updated (UTC) |
| :--- | :----- | :------ | :------- | :------ |
| **liam-app** | ✅ Ready ([Inspect](https://vercel.com/route-06-core/liam-app/8ZrCv1jsyxSFMEjt5CKagAo4oyrB)) | [Visit Preview](https://liam-app-git-feat-add-run-e2e-workflow-route-06-core.vercel.app) | 💬 [**Add feedback**](https://vercel.live/open-feedback/liam-app-git-feat-add-run-e2e-workflow-route-06-core.vercel.app?via=pr-comment-feedback-link) | Mar 18, 2025 5:50am |
| **liam-erd-sample** | ✅ Ready ([Inspect](https://vercel.com/route-06-core/liam-erd-sample/bSjs9S3NL6MLsxa7yC9vfusgnaNn)) | [Visit Preview](https://liam-erd-sample-git-feat-add-run-e2e-workflow-route-06-core.vercel.app) | 💬 [**Add feedback**](https://vercel.live/open-feedback/liam-erd-sample-git-feat-add-run-e2e-workflow-route-06-core.vercel.app?via=pr-comment-feedback-link) | Mar 18, 2025 5:50am |
| **test-liam-erd-web** | ✅ Ready ([Inspect](https://vercel.com/route-06-core/test-liam-erd-web/EHajrJ2kmYhcmVu7VUoi38nQhGen)) | [Visit Preview](https://test-liam-erd-web-git-feat-add-run-e2e-workflow-route-06-core.vercel.app) | 💬 [**Add feedback**](https://vercel.live/open-feedback/test-liam-erd-web-git-feat-add-run-e2e-workflow-route-06-core.vercel.app?via=pr-comment-feedback-link) | Mar 18, 2025 5:50am |

<details><summary>4 Skipped Deployments</summary>

| Name | Status | Preview | Comments | Updated (UTC) |
| :--- | :----- | :------ | :------- | :------ |
| **liam-docs** | ⬜️ Ignored ([Inspect](https://vercel.com/route-06-core/liam-docs/HQKXt1VSczco1z7WUD8GYWsXqhFH)) | [Visit Preview](https://liam-docs-git-feat-add-run-e2e-workflow-route-06-core.vercel.app) |  | Mar 18, 2025 5:50am |
| **test-liam-app** | ⬜️ Ignored ([Inspect](https://vercel.com/route-06-core/test-liam-app/3UVkdUTioYCeu7CmpftdeHVajUZM)) | [Visit Preview](https://test-liam-app-git-feat-add-run-e2e-workflow-route-06-core.vercel.app) |  | Mar 18, 2025 5:50am |
| **test-liam-docs** | ⬜️ Ignored ([Inspect](https://vercel.com/route-06-core/test-liam-docs/HvS2ZVJ4Z1o7PvunyvKQLm6VuAJr)) |  |  | Mar 18, 2025 5:50am |
| **test-liam-erd-sample** | ⬜️ Ignored ([Inspect](https://vercel.com/route-06-core/test-liam-erd-sample/6BGq1eTKja9C7EW3SbbehYV6srPR)) |  |  | Mar 18, 2025 5:50am |
</details>








author_association: NONE
user: login: supabase[bot]
created_at: 2025-03-17T05:29:50Z
body: [supa]:ffdgmemmrhmsnzccyidd
**Updates to [Preview Branch (feat/add-run-e2e-workflow) ↗︎](https://supabase.com/dashboard/project/ffdgmemmrhmsnzccyidd)**

| Deployments | Status                      | Updated                   |
| ----------- | --------------------------- | ------------------------- |
| Database    | ✅ | Tue, 18 Mar 2025 05:47:52 UTC |
| Services    | ✅  | Tue, 18 Mar 2025 05:47:52 UTC  |
| APIs        | ✅      | Tue, 18 Mar 2025 05:47:52 UTC      |

Tasks are run on every commit but only new migration files are pushed.
Close and reopen this PR if you want to apply changes from existing seed or migration files.

| Tasks          | Status                       | Updated                    |
| -------------- | ---------------------------- | -------------------------- |
| Configurations | ✅ | Tue, 18 Mar 2025 05:47:53 UTC |
| Migrations     | ✅ | Tue, 18 Mar 2025 05:47:53 UTC |
| Seeding        | ✅   | Tue, 18 Mar 2025 05:47:53 UTC   |
| Edge Functions | ✅  | Tue, 18 Mar 2025 05:47:53 UTC  |

<hr/>




View logs for this [Workflow Run ↗︎](https://supabase.com/dashboard/project/ffdgmemmrhmsnzccyidd/branches).
Learn more about [Supabase for Git ↗︎](https://supabase.com/docs/guides/platform/branching).

author_association: NONE
user: login: liam-migration[bot]
created_at: 2025-03-17T05:29:56Z
body: The provided schema changes primarily involve updates to GitHub Actions workflows rather than traditional database schema changes. However, I will analyze them in the context of their impact on the deployment and testing processes, as these are crucial for maintaining the integrity and reliability of the system.

1. **Renaming and Structuring**:
   - The workflow file for end-to-end (E2E) tests has been renamed from "Run E2E Tests" to "E2E Tests." This change, while minor, enhances clarity in naming conventions, making it immediately clear that the workflow is focused on E2E tests. Such naming conventions are essential for maintainability and team understanding.

2. **Event Trigger Changes**:
   - The workflow is now triggered by `deployment_status`, which adds a layer of specificity to when the tests are run. This is a significant improvement as it ensures tests only run on successful deployments, reducing unnecessary test executions and focusing resources on meaningful events. This approach can help in identifying deployment issues more effectively.

3. **Conditional Logic**:
   - The introduction of conditional logic based on deployment environments (Production and Preview) to determine if tests should run is a smart move. It prevents tests from running on environments that are not meant for testing, thereby saving time and resources. This logic also adds a level of validation for the deployment status, ensuring that only successful deployments are subject to testing.

4. **Environment Variable Management**:
   - The transition from using inputs for URL and environment variables to using environment variables directly enhances the reliability of the workflow. By leveraging `github.event.deployment_status.target_url` and `github.event.deployment.environment`, the workflow reduces potential input errors and makes the configuration more robust.

5. **Removal of Unused Workflow**:
   - The removal of the `vercel-deploy-erd.yml` workflow indicates a streamlining of the deployment processes. While not directly related to database changes, this can lead to reduced complexity in the deployment pipeline, which is beneficial. However, it’s important to ensure that the functionalities previously covered by this workflow are either no longer necessary or have been adequately addressed elsewhere in the CI/CD pipeline.

6. **Notification Enhancement**:
   - The addition of a Slack notification step on failure is a valuable enhancement. This allows for immediate awareness of test failures, enabling quicker responses from the development team. Timely notifications can significantly improve the team's ability to maintain the application in a production-ready state.

7. **Code Formatting and Consistency**:
   - There are minor changes in code formatting, such as the use of double quotes for the browser matrix. Maintaining consistent coding standards is essential for readability and collaboration among developers. Ensuring that all code adheres to a consistent style can help prevent confusion and errors during future modifications.

In conclusion, the workflow changes reflect an overall positive direction in terms of clarity, efficiency, and responsiveness to deployment events. The focus on successful deployments, combined with improved notification mechanisms, will likely enhance the reliability of the testing process. However, it is crucial to monitor the impact of the removed workflow to ensure that no necessary functionality is lost and that the deployment process remains smooth. Continuous evaluation of these workflows will be key to adapting to the evolving needs of the project.

Migration URL:  https://liam-erd-web.vercel.app/app/projects/6/migrations/12
author_association: CONTRIBUTOR
user: login: FunamaYukina
created_at: 2025-03-17T10:55:04Z
body: 📝 The reason e2e was not working properly was because I did not set the value properly in env.
https://github.com/liam-hq/liam/pull/912/commits/85048087a5ba0c85f55aaaccf6e5c059cd8ca08a

author_association: MEMBER
user: login: qodo-free-for-open-source-projects[bot]
created_at: 2025-03-17T11:24:11Z
body: ## PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

<table>
<tr><td>⏱️&nbsp;<strong>Estimated effort to review</strong>: 2 🔵🔵⚪⚪⚪</td></tr>
<tr><td>🧪&nbsp;<strong>No relevant tests</strong></td></tr>
<tr><td>🔒&nbsp;<strong>No security concerns identified</strong></td></tr>
<tr><td>⚡&nbsp;<strong>Recommended focus areas for review</strong><br><br>

<details><summary><a href='https://github.com/liam-hq/liam/pull/912/files#diff-37aed4ad4a8c3a4220c5e3c2eee33093073b8d64f480cc742b63764c859b6c72R8-R21'><strong>Conditional Logic</strong></a>

The complex conditional logic for determining when to run tests could be difficult to maintain. Consider extracting this logic into a reusable component or simplifying the conditions.
</summary>

```yaml
if: |
  github.event_name == 'deployment_status' &&
  github.event.deployment_status.state == 'success' &&
  (
    (
      contains(github.event.deployment.environment, 'Production') &&
      contains(github.event.deployment_status.target_url, 'liam-erd-web')
    ) ||
    (
      contains(github.event.deployment.environment, 'Preview') &&
      !contains(github.event.deployment_status.target_url, 'liam-erd-sample') &&
      !contains(github.event.deployment_status.target_url, 'liam-docs')
    )
  )
```

</details>

<details><summary><a href='https://github.com/liam-hq/liam/pull/912/files#diff-37aed4ad4a8c3a4220c5e3c2eee33093073b8d64f480cc742b63764c859b6c72R62-R66'><strong>Error Handling</strong></a>

The workflow doesn't include specific error handling or retry mechanisms for transient failures in E2E tests, which are common in UI testing.
</summary>

```yaml
- name: Run e2e tests
  run: pnpm exec playwright test --project="${{ matrix.browser }}"
  env:
    URL: ${{ env.URL }}

```

</details>

</td></tr>
</table>

author_association: CONTRIBUTOR
user: login: qodo-free-for-open-source-projects[bot]
created_at: 2025-03-17T11:24:22Z
body: ## PR Code Suggestions ✨

<!-- 478e61e -->

Explore these optional code suggestions:

<table><thead><tr><td><strong>Category</strong></td><td align=left><strong>Suggestion&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </strong></td><td align=center><strong>Impact</strong></td></tr><tbody><tr><td rowspan=1>Possible issue</td>
<td>



<details><summary>Fix environment condition check</summary>

___


**The condition is using <code>env.ENVIRONMENT</code> but should use <br><code>github.event.deployment.environment</code> for consistency with how the environment is <br>determined in the job condition. The current approach might not correctly <br>identify production deployments.**

[.github/workflows/e2e_tests.yml [75-76]](https://github.com/liam-hq/liam/pull/912/files#diff-37aed4ad4a8c3a4220c5e3c2eee33093073b8d64f480cc742b63764c859b6c72R75-R76)

```diff
 - name: Slack Notification on Failure
-  if: ${{ env.ENVIRONMENT == 'production' && failure() }}
+  if: ${{ contains(github.event.deployment.environment, 'Production') && failure() }}
```

- [ ] **Apply this suggestion** <!-- /improve --apply_suggestion=0 -->

<details><summary>Suggestion importance[1-10]: 8</summary>

__

Why: The suggestion correctly identifies an inconsistency in how the environment is checked. Using `env.ENVIRONMENT == 'production'` doesn't match the pattern used in the job condition (which uses `contains(github.event.deployment.environment, 'Production')`). This could cause the Slack notification to not trigger properly for production deployments.


</details></details></td><td align=center>Medium

</td></tr>
<tr><td align="center" colspan="2">

- [ ] Update <!-- /improve --more_suggestions=true -->

</td><td></td></tr></tbody></table>
author_association: CONTRIBUTOR
user: login: MH4GF
created_at: 2025-03-18T00:21:33Z
body: @FunamaYukina I think we can delete this file:

https://github.com/liam-hq/liam/blob/f3ee96fc53cc9b8dbddca018a5bd2371a7ca70b7/.github/workflows/_run_e2e_test.yml
author_association: CONTRIBUTOR
user: login: FunamaYukina
created_at: 2025-03-18T04:00:15Z
body: Thank you for noticing.🙏 I have deleted the ``_run_e2e_test.yml`` file.
author_association: MEMBER
user: login: FunamaYukina
created_at: 2025-03-18T04:00:48Z
body: I will check the liam-erd-sample test as it seems to fail.

https://github.com/liam-hq/liam/actions/runs/13914287503/job/38934385356
author_association: MEMBER
user: login: MH4GF
created_at: 2025-03-18T04:02:22Z
body: @FunamaYukina If testing of liam-erd-sample fails, It is not necessary to include it in this PR!
author_association: CONTRIBUTOR
user: login: FunamaYukina
created_at: 2025-03-18T05:55:58Z
body: Thank you for the review!
author_association: MEMBER