Skip to content

Conversation

@mikeallisonJS
Copy link
Collaborator

@mikeallisonJS mikeallisonJS commented Aug 5, 2025

Summary by CodeRabbit

  • Chores
    • Updated GitHub Actions workflow for improved simplicity and reliability.
    • Removed PostgreSQL service setup from automated build and test processes.
    • Streamlined Doppler CLI installation using the official GitHub Action.
    • Added an environment variable for enhanced build step configuration.
    • Enhanced build caching and input tracking with new default target settings.

@mikeallisonJS mikeallisonJS requested a review from tataihono August 5, 2025 23:55
@mikeallisonJS mikeallisonJS self-assigned this Aug 5, 2025
@linear
Copy link

linear bot commented Aug 5, 2025

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 5, 2025

Walkthrough

The GitHub Actions workflow configuration is updated by removing the PostgreSQL service setup from both the build and test jobs. The Doppler CLI installation in the build job is replaced with the official Doppler CLI GitHub Action. An environment variable, NX_CLOUD_ACCESS_TOKEN, is added to both the build and test jobs. The nx.json configuration removes the entire tasksRunnerOptions section and adds a new target default for prisma-generate with caching enabled and inputs set to all schema.prisma files.

Changes

Cohort / File(s) Change Summary
GitHub Actions Workflow Update
.github/workflows/main.yml
Removed PostgreSQL service setup from build and test jobs; replaced Doppler CLI install with official GitHub Action; added NX_CLOUD_ACCESS_TOKEN environment variable to build and test jobs.
Nx Configuration Update
nx.json
Removed entire tasksRunnerOptions section; added new target default prisma-generate with caching enabled and inputs set to all schema.prisma files.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5bcda25 and 97f32b8.

📒 Files selected for processing (2)
  • .github/workflows/main.yml (3 hunks)
  • nx.json (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/main.yml
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: CR
PR: JesusFilm/core#0
File: .cursor/rules/infrastructure.mdc:0-0
Timestamp: 2025-07-22T18:37:46.814Z
Learning: Applies to infrastructure/**/.github/workflows/*.yml : Integrate Terraform with CI/CD pipelines (e.g., GitHub Actions, GitLab CI) to automate testing, planning, and deployment.
Learnt from: CR
PR: JesusFilm/core#0
File: .cursor/rules/infrastructure.mdc:0-0
Timestamp: 2025-07-22T18:37:46.814Z
Learning: Applies to infrastructure/**/.github/workflows/*.yml : Run `terraform plan` in CI pipelines to catch any issues before applying infrastructure changes.
📚 Learning: always ignore eslint warnings (import/no-useless-path-segments) for prisma client imports using the ...
Learnt from: tataihono
PR: JesusFilm/core#5390
File: apis/api-media/src/workers/bigQuery/importers/shortLinks/shortLinks.spec.ts:1-1
Timestamp: 2025-03-02T23:04:09.558Z
Learning: Always ignore ESLint warnings (import/no-useless-path-segments) for Prisma client imports using the format `.prisma/api-media-client` instead of `./.prisma/api-media-client`. This is an intentional pattern in the codebase.

Applied to files:

  • nx.json
📚 Learning: applies to workers/**/* : cloudflare workers should be implemented using vite...
Learnt from: CR
PR: JesusFilm/core#0
File: .cursor/rules/workers.mdc:0-0
Timestamp: 2025-07-22T18:38:10.430Z
Learning: Applies to workers/**/* : Cloudflare workers should be implemented using Vite

Applied to files:

  • nx.json
🔇 Additional comments (1)
nx.json (1)

83-85: Re-check caching for prisma-generate – possible cross-platform pitfalls

prisma generate emits platform-specific binaries under .prisma/client. With cache: true, Nx Cloud may restore a Linux-built client onto macOS/Windows (or vice-versa), causing runtime crashes.
Options:

-  "prisma-generate": {
-    "cache": true,
+  "prisma-generate": {
+    "cache": false,                # safest
     "inputs": ["{projectRoot}/**/schema.prisma"]

If you want to keep caching, at least add an outputs array that explicitly scopes the generated artefacts and consider dependsOn: ["^prisma-generate"] so projects pick up upstream schema changes.

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch mikeallison/eng-3088-mainyml-nx-cloud-caching

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@nx-cloud
Copy link

nx-cloud bot commented Aug 5, 2025

View your CI Pipeline Execution ↗ for commit 97f32b8

Command Status Duration Result
nx affected --target=codecov --base=06fa542bb88... ✅ Succeeded 6s View ↗
nx affected --target=test --base=06fa542bb885b1... ✅ Succeeded 6s View ↗
nx run-many --target=prisma-generate --all --pa... ✅ Succeeded 1s View ↗

☁️ Nx Cloud last updated this comment at 2025-08-06 00:34:02 UTC

@nx-cloud
Copy link

nx-cloud bot commented Aug 5, 2025

View your CI Pipeline Execution ↗ for commit f111818

Command Status Duration Result
nx affected --target=build --base=06fa542bb885b... ✅ Succeeded <1s View ↗
nx affected --target=fetch-secrets --base=06fa5... ✅ Succeeded <1s View ↗

☁️ Nx Cloud last updated this comment at 2025-08-05 23:56:30 UTC

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
.github/workflows/main.yml (1)

51-53: Pin third-party action to a specific commit SHA.

uses: dopplerhq/cli-action@v3 pulls the latest v3 tag on every run, which is susceptible to supply-chain hijacking or unexpected breaking changes.
Pin to a stable commit SHA published by Doppler and keep the major tag only as a comment for human readability.

-      - name: Install Doppler
-        uses: dopplerhq/cli-action@v3
+      - name: Install Doppler
+        # v3.2.1 – 6d1e1c0a7c0d7830d8b3d92a2d8c6c2d4a4b2e31
+        uses: dopplerhq/cli-action@6d1e1c0a7c0d7830d8b3d92a2d8c6c2d4a4b2e31 # v3
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 06fa542 and f111818.

📒 Files selected for processing (1)
  • .github/workflows/main.yml (2 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: CR
PR: JesusFilm/core#0
File: .cursor/rules/infrastructure.mdc:0-0
Timestamp: 2025-07-22T18:37:46.814Z
Learning: Applies to infrastructure/**/.github/workflows/*.yml : Integrate Terraform with CI/CD pipelines (e.g., GitHub Actions, GitLab CI) to automate testing, planning, and deployment.
📚 Learning: applies to infrastructure/**/.github/workflows/*.yml : integrate terraform with ci/cd pipelines (e.g...
Learnt from: CR
PR: JesusFilm/core#0
File: .cursor/rules/infrastructure.mdc:0-0
Timestamp: 2025-07-22T18:37:46.814Z
Learning: Applies to infrastructure/**/.github/workflows/*.yml : Integrate Terraform with CI/CD pipelines (e.g., GitHub Actions, GitLab CI) to automate testing, planning, and deployment.

Applied to files:

  • .github/workflows/main.yml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: test (22, 3/3)
  • GitHub Check: lint (22)
  • GitHub Check: Analyze (javascript)
🔇 Additional comments (2)
.github/workflows/main.yml (2)

74-76: Verify availability & scope of NX_CLOUD_ACCESS_TOKEN.

A new secret is injected only in this step.

  1. Confirm that the secret is defined in the repo / org secrets; otherwise the build will fail silently with an empty token.
  2. If downstream Nx commands (e.g. nx run-many) are executed in later steps or in the test job, consider setting the token at the job level to avoid duplication.

78-86: PostgreSQL service removal is safe to merge

A search across the workflow and test suites shows:

• No services: or postgres references in .github/workflows/main.yml
• The CI runs prisma generate (which doesn’t require a live DB) and invokes Jest only for unit tests
• The only hard-coded Postgres URLs live in infra modules and one data-import spec, which mocks or validates the URL string rather than opening a real connection

You can safely remove the Postgres service from the Actions workflow without breaking Prisma generation or your test suite.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (2)
.github/workflows/main.yml (2)

79-84: Same runner downgrade caveat applies to the test job

The test matrix (3 shards) previously enjoyed 4 vCPUs; moving to the standard runner may bottleneck Jest shards and nullify parallelism gains.


1-139: Set explicit permissions for the workflow

CodeQL warns that the workflow runs with default token rights. Add the minimum required block at the workflow or job level, e.g.:

permissions:
  contents: read
  id-token: write      # if OIDC uploads (Codecov) need it

This hardens the pipeline against privilege escalation.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f111818 and 5bcda25.

📒 Files selected for processing (1)
  • .github/workflows/main.yml (4 hunks)
🧰 Additional context used
🧠 Learnings (4)
📓 Common learnings
Learnt from: CR
PR: JesusFilm/core#0
File: .cursor/rules/infrastructure.mdc:0-0
Timestamp: 2025-07-22T18:37:46.814Z
Learning: Applies to infrastructure/**/.github/workflows/*.yml : Integrate Terraform with CI/CD pipelines (e.g., GitHub Actions, GitLab CI) to automate testing, planning, and deployment.
📚 Learning: applies to infrastructure/**/.github/workflows/*.yml : integrate terraform with ci/cd pipelines (e.g...
Learnt from: CR
PR: JesusFilm/core#0
File: .cursor/rules/infrastructure.mdc:0-0
Timestamp: 2025-07-22T18:37:46.814Z
Learning: Applies to infrastructure/**/.github/workflows/*.yml : Integrate Terraform with CI/CD pipelines (e.g., GitHub Actions, GitLab CI) to automate testing, planning, and deployment.

Applied to files:

  • .github/workflows/main.yml
📚 Learning: applies to infrastructure/**/.github/workflows/*.yml : run `terraform plan` in ci pipelines to catch...
Learnt from: CR
PR: JesusFilm/core#0
File: .cursor/rules/infrastructure.mdc:0-0
Timestamp: 2025-07-22T18:37:46.814Z
Learning: Applies to infrastructure/**/.github/workflows/*.yml : Run `terraform plan` in CI pipelines to catch any issues before applying infrastructure changes.

Applied to files:

  • .github/workflows/main.yml
📚 Learning: write modular, reusable ci/cd pipelines...
Learnt from: CR
PR: JesusFilm/core#0
File: .cursor/rules/kubernetes.mdc:0-0
Timestamp: 2025-07-22T18:38:06.139Z
Learning: Write modular, reusable CI/CD pipelines

Applied to files:

  • .github/workflows/main.yml
🪛 GitHub Check: CodeQL
.github/workflows/main.yml

[warning] 14-78: Workflow does not contain permissions
Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {{contents: read}}

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: lint (22)
  • GitHub Check: Analyze (javascript)
🔇 Additional comments (2)
.github/workflows/main.yml (2)

14-18: Runner downgrade may lengthen CI times

ubuntu-latest maps to a 2-vCPU GitHub-hosted runner, whereas the removed blacksmith-4vcpu-ubuntu-2204 runner provided twice the cores. Build/test durations can noticeably increase (Nx remote execution will still wait on local steps like npm install).
Consider measuring the wall-clock delta; if the slowdown is material, keep the 4-vCPU runner or enable the ubuntu-latest-xl tier.


75-76: Secret added only for build – omit for test?

If tests rely on distributed caching, the token should also be exposed in the test job (before the start-ci-run step). Otherwise agents started in the test job will fail authentication.

…d actions/cache@v4 for improved caching of node modules
…@v5 and useblacksmith/stickydisk@v1 for improved caching and performance
@github-actions github-actions bot requested a deployment to Preview - journeys-admin August 6, 2025 00:20 Pending
@github-actions github-actions bot requested a deployment to Preview - arclight August 6, 2025 00:20 Pending
@github-actions github-actions bot temporarily deployed to Preview - short-links August 6, 2025 00:23 Inactive
@github-actions github-actions bot temporarily deployed to Preview - arclight August 6, 2025 00:23 Inactive
@github-actions github-actions bot temporarily deployed to Preview - videos-admin August 6, 2025 00:23 Inactive
@github-actions github-actions bot temporarily deployed to Preview - watch-modern August 6, 2025 00:23 Inactive
@github-actions github-actions bot temporarily deployed to Preview - journeys-admin August 6, 2025 00:23 Inactive
@github-actions github-actions bot temporarily deployed to Preview - watch August 6, 2025 00:23 Inactive
@github-actions github-actions bot temporarily deployed to Preview - journeys August 6, 2025 00:23 Inactive
@github-actions
Copy link
Contributor

github-actions bot commented Aug 6, 2025

The latest updates on your projects.

Name Status Preview Updated (UTC)
arclight ✅ Ready arclight preview Wed Aug 6 12:24:43 NZST 2025

@github-actions
Copy link
Contributor

github-actions bot commented Aug 6, 2025

The latest updates on your projects.

Name Status Preview Updated (UTC)
watch-modern ✅ Ready watch-modern preview Wed Aug 6 12:24:58 NZST 2025

@github-actions
Copy link
Contributor

github-actions bot commented Aug 6, 2025

The latest updates on your projects.

Name Status Preview Updated (UTC)
docs ✅ Ready docs preview Wed Aug 6 12:25:09 NZST 2025

@github-actions
Copy link
Contributor

github-actions bot commented Aug 6, 2025

The latest updates on your projects.

Name Status Preview Updated (UTC)
short-links ✅ Ready short-links preview Wed Aug 6 12:25:10 NZST 2025

@github-actions
Copy link
Contributor

github-actions bot commented Aug 6, 2025

The latest updates on your projects.

Name Status Preview Updated (UTC)
journeys ✅ Ready journeys preview Wed Aug 6 12:25:34 NZST 2025

@github-actions
Copy link
Contributor

github-actions bot commented Aug 6, 2025

The latest updates on your projects.

Name Status Preview Updated (UTC)
videos-admin ✅ Ready videos-admin preview Wed Aug 6 12:25:52 NZST 2025

@github-actions
Copy link
Contributor

github-actions bot commented Aug 6, 2025

The latest updates on your projects.

Name Status Preview Updated (UTC)
journeys-admin ✅ Ready journeys-admin preview Wed Aug 6 12:26:13 NZST 2025

@github-actions
Copy link
Contributor

github-actions bot commented Aug 6, 2025

The latest updates on your projects.

Name Status Preview Updated (UTC)
watch ✅ Ready watch preview Wed Aug 6 12:26:38 NZST 2025

@stage-branch-merger
Copy link

I see you added the "on stage" label, I'll get this merged to the stage branch!

@mikeallisonJS mikeallisonJS added this pull request to the merge queue Aug 6, 2025
Merged via the queue into main with commit 3b6993a Aug 6, 2025
46 checks passed
@mikeallisonJS mikeallisonJS deleted the mikeallison/eng-3088-mainyml-nx-cloud-caching branch August 6, 2025 05:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants