Add end-to-end testing for fdm-app for critical user journeys#210
Add end-to-end testing for fdm-app for critical user journeys#210BoraIneviNMI wants to merge 15 commits into
Conversation
|
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the """ WalkthroughA Playwright-based end-to-end (E2E) testing setup has been introduced for the Changes
Sequence Diagram(s)sequenceDiagram
participant CI as GitHub Actions (test-app job)
participant Docker as Node.js 22 Container
participant Postgres as PostgreSQL Service
participant App as fdm-app Web Server
participant Playwright as Playwright Test Runner
CI->>Docker: Start container & install dependencies
Docker->>Postgres: Start PostgreSQL service
Docker->>App: Build and start fdm-app server (with coverage)
Docker->>Playwright: Run Playwright E2E tests
Playwright->>App: Execute browser-based tests (e.g., sign-in)
Playwright->>Docker: Generate coverage reports
Docker->>CI: Upload coverage to Codecov
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~15–20 minutes Possibly related issues
Poem
✨ Finishing touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 5
🧹 Nitpick comments (2)
fdm-app/package.json (1)
85-86: Remove duplicate Playwright packagesYou usually need either
@playwright/test(includes browsers) orplaywright, not both. Keeping both risks version drift.Drop
playwrightunless you have a specific reason.Also applies to: 101-103
fdm-app/.gitignore (1)
9-14: Keep ignore-pattern style consistent (add leading/to new directories)Earlier entries such as
/buildand/.cacheuse a leading slash to scope the ignore rule to the package root. The newly-added patterns omit the slash, which causes them to matchdist,coverage, etc. at any depth infdm-app/. That’s harmless but inconsistent and may hide similarly-named directories inside src or test fixtures.Diff to align with existing style:
- dist - dist-ssr - playwright-report - test-results - coverage + /dist + /dist-ssr + /playwright-report + /test-results + /coverage(Optional) You could also add a trailing
/to signal they are directories, but that’s stylistic.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (6)
.github/workflows/tests.yml(1 hunks)fdm-app/.c8rc(1 hunks)fdm-app/.gitignore(1 hunks)fdm-app/package.json(3 hunks)fdm-app/playwright.config.ts(1 hunks)fdm-app/tests/signin._index.test.ts(1 hunks)
🧰 Additional context used
🧠 Learnings (7)
📓 Common learnings
Learnt from: SvenVw
PR: SvenVw/fdm#71
File: fdm-app/app/routes/farm.create.$b_id_farm.cultivations.$b_lu_catalogue.crop.harvest._index.tsx:111-135
Timestamp: 2025-02-13T09:03:11.890Z
Learning: When adding multiple harvests in fdm-app, use Promise.all instead of Promise.allSettled to ensure atomic behavior - if one harvest addition fails, all should fail and rollback to maintain data consistency.
Learnt from: SvenVw
PR: SvenVw/fdm#65
File: fdm-core/src/global-setup.ts:7-9
Timestamp: 2025-01-29T14:33:41.822Z
Learning: In the fdm project, tests should be organized per file to maintain separation of concerns, rather than consolidating them into a centralized location.
Learnt from: SvenVw
PR: SvenVw/fdm#6
File: fdm-app/vite.config.ts:5-9
Timestamp: 2024-11-25T12:42:32.783Z
Learning: In the `fdm-app` project, SvenVw is preparing for migration to Remix v3 and may include type declarations or configurations for v3 features in advance, such as in `vite.config.ts`.
Learnt from: SvenVw
PR: SvenVw/fdm#95
File: fdm-core/src/catalogues.ts:134-170
Timestamp: 2025-03-06T15:23:48.352Z
Learning: When writing tests for fdm-core, avoid using Vitest's `vi` mocking utilities and prefer manual JavaScript mocks.
Learnt from: SvenVw
PR: SvenVw/fdm#9
File: fdm-data/src/cultivations/index.test.ts:57-59
Timestamp: 2024-11-27T12:15:36.425Z
Learning: In `fdm-data/src/cultivations/index.test.ts`, the `fdm` object created by `drizzle` does not have an `.end()` method. Cleanup code should not attempt to call `fdm.end();`.
Learnt from: SvenVw
PR: SvenVw/fdm#95
File: fdm-core/src/cultivation.ts:67-73
Timestamp: 2025-03-06T14:58:48.603Z
Learning: When writing unit tests for the fdm project, avoid using Vitest's mocking utilities (vi) as it has caused problems in the past not related to the actual code. Instead, use simple object literals with methods that throw errors to test error handling.
Learnt from: SvenVw
PR: SvenVw/fdm#20
File: fdm-app/tsconfig.json:8-9
Timestamp: 2024-12-11T12:09:35.540Z
Learning: In the `fdm-app/tsconfig.json` file, the include path `.react-router/types/**/*` refers to a build-time generated directory which is intentionally not included in the repository.
Learnt from: SvenVw
PR: SvenVw/fdm#163
File: fdm-app/app/routes/farm.$b_id_farm.$calendar.field._index.tsx:27-29
Timestamp: 2025-06-10T15:05:38.163Z
Learning: In the fdm-app codebase, the component directory structure is intentionally organized with `~/components/custom/` containing small reusable components that can be used in both blocks and pages, while `~/components/blocks/` contains larger block-level components. Not all components should be migrated from custom to blocks - the custom directory serves as a library of smaller utility components.
Learnt from: SvenVw
PR: SvenVw/fdm#95
File: fdm-core/src/cultivation.ts:67-73
Timestamp: 2025-03-06T14:38:52.315Z
Learning: When writing unit tests for the fdm project, avoid using vi.mock() as it has caused implementation problems in the past. Use direct mock functions with vi.fn() instead.
fdm-app/.gitignore (3)
Learnt from: SvenVw
PR: #20
File: fdm-app/tsconfig.json:8-9
Timestamp: 2024-12-11T12:09:35.540Z
Learning: In the fdm-app/tsconfig.json file, the include path .react-router/types/**/* refers to a build-time generated directory which is intentionally not included in the repository.
Learnt from: SvenVw
PR: #6
File: fdm-app/vite.config.ts:5-9
Timestamp: 2024-11-25T12:42:32.783Z
Learning: In the fdm-app project, SvenVw is preparing for migration to Remix v3 and may include type declarations or configurations for v3 features in advance, such as in vite.config.ts.
Learnt from: SvenVw
PR: #65
File: fdm-core/src/global-setup.ts:7-9
Timestamp: 2025-01-29T14:33:41.822Z
Learning: In the fdm project, tests should be organized per file to maintain separation of concerns, rather than consolidating them into a centralized location.
fdm-app/package.json (7)
Learnt from: SvenVw
PR: #6
File: fdm-app/vite.config.ts:5-9
Timestamp: 2024-11-25T12:42:32.783Z
Learning: In the fdm-app project, SvenVw is preparing for migration to Remix v3 and may include type declarations or configurations for v3 features in advance, such as in vite.config.ts.
Learnt from: SvenVw
PR: #95
File: fdm-core/src/catalogues.ts:134-170
Timestamp: 2025-03-06T15:23:48.352Z
Learning: When writing tests for fdm-core, avoid using Vitest's vi mocking utilities and prefer manual JavaScript mocks.
Learnt from: SvenVw
PR: #9
File: fdm-data/src/cultivations/index.test.ts:57-59
Timestamp: 2024-11-27T12:15:36.425Z
Learning: In fdm-data/src/cultivations/index.test.ts, the fdm object created by drizzle does not have an .end() method. Cleanup code should not attempt to call fdm.end();.
Learnt from: SvenVw
PR: #20
File: fdm-app/tsconfig.json:8-9
Timestamp: 2024-12-11T12:09:35.540Z
Learning: In the fdm-app/tsconfig.json file, the include path .react-router/types/**/* refers to a build-time generated directory which is intentionally not included in the repository.
Learnt from: SvenVw
PR: #147
File: fdm-docs/package.json:39-39
Timestamp: 2025-05-28T07:57:19.217Z
Learning: In pnpm workspaces, the syntax "typescript": "catalog:" is valid and correct. It references the version defined in the workspace's catalog section in pnpm-workspace.yaml, allowing consistent dependency versions across packages in a monorepo.
Learnt from: SvenVw
PR: #124
File: fdm-app/app/components/custom/farm/farm-title.tsx:3-3
Timestamp: 2025-04-18T13:49:17.029Z
Learning: In the fdm project, NavLink and other routing components can be imported from either "react-router" or "react-router-dom" as react-router-dom is included in react-router.
Learnt from: SvenVw
PR: #147
File: fdm-docs/package.json:39-39
Timestamp: 2025-05-28T07:57:19.217Z
Learning: In pnpm workspaces, the syntax "typescript": "catalog:" is valid and correct. It references the version defined in the workspace's catalog section in pnpm-workspace.yaml, allowing consistent dependency versions across packages in a monorepo. The catalog: syntax without a package name is the shorthand for referencing the default catalog.
fdm-app/.c8rc (2)
Learnt from: SvenVw
PR: #6
File: fdm-app/vite.config.ts:5-9
Timestamp: 2024-11-25T12:42:32.783Z
Learning: In the fdm-app project, SvenVw is preparing for migration to Remix v3 and may include type declarations or configurations for v3 features in advance, such as in vite.config.ts.
Learnt from: SvenVw
PR: #20
File: fdm-app/tsconfig.json:8-9
Timestamp: 2024-12-11T12:09:35.540Z
Learning: In the fdm-app/tsconfig.json file, the include path .react-router/types/**/* refers to a build-time generated directory which is intentionally not included in the repository.
fdm-app/tests/signin._index.test.ts (2)
Learnt from: SvenVw
PR: #151
File: fdm-app/app/routes/signin._index.tsx:101-101
Timestamp: 2025-06-02T10:31:27.097Z
Learning: In fdm-app/app/routes/signin._index.tsx, the redirect destinations are intentionally inconsistent by design: the component defaults new sign-ins to "/welcome" (line 101) while the loader redirects authenticated users to "/farm" (line 80) and the action uses "/farm" as fallback (line 434). This creates appropriate user flows where new users complete their profile via the welcome page, while existing authenticated users bypass it and go directly to the main application.
Learnt from: SvenVw
PR: #23
File: fdm-app/app/routes/app.addfarm.new.tsx:15-17
Timestamp: 2024-12-19T13:20:44.152Z
Learning: Authentication for the “app.addfarm.new” route is already handled globally in “fdm-app/app/routes/app.tsx,” automatically redirecting unauthenticated users to the SignIn page.
fdm-app/playwright.config.ts (2)
Learnt from: SvenVw
PR: #6
File: fdm-app/vite.config.ts:5-9
Timestamp: 2024-11-25T12:42:32.783Z
Learning: In the fdm-app project, SvenVw is preparing for migration to Remix v3 and may include type declarations or configurations for v3 features in advance, such as in vite.config.ts.
Learnt from: SvenVw
PR: #65
File: fdm-core/src/global-setup.ts:7-9
Timestamp: 2025-01-29T14:33:41.822Z
Learning: In the fdm project, tests should be organized per file to maintain separation of concerns, rather than consolidating them into a centralized location.
.github/workflows/tests.yml (1)
Learnt from: SvenVw
PR: #65
File: .github/workflows/check.yml:67-76
Timestamp: 2025-01-29T14:32:14.684Z
Learning: For temporary test databases that are created and destroyed within GitHub Actions workflows and run in isolated containers, using default credentials (like postgres/postgres) is acceptable as they pose no security risk.
🔇 Additional comments (3)
.github/workflows/tests.yml (1)
326-346: Coverage upload path may be empty – CI will error out.The step runs
pnpm testbut the upload expects./fdm-app/coverage/tmp/*.json.
Confirm that thetestscript invokesc8/nycwith--report-dir coverage/tmp; otherwise the Codecov step will fail with “no matching files”.
Consider renaming the step toRun tests with coverageand using the samepnpm test-coverageconvention as the other jobs for consistency.fdm-app/package.json (1)
13-14:testscript won’t start a built server
playwright.config.tslaunchesreact-router-serve ./build/..., butpnpm run testnever runspnpm buildfirst, so the server file may be missing locally.Consider:
-"test": "dotenvx run playwright test", +"test": "pnpm build && dotenvx run playwright test",or point
webServer.commandatreact-router devin non-CI runs.fdm-app/playwright.config.ts (1)
45-52: Ensure build exists before server start
react-router-serve ./build/server/index.jswill fail if./buildhasn’t been produced. Confirm your local/CI workflow builds the app before Playwright starts, or switch toreact-router devfor local runs.
| "**.d.ts", | ||
| "*.config.ts", |
There was a problem hiding this comment.
Fix incorrect glob pattern
"**.d.ts" should be "**/*.d.ts" to actually exclude declaration files.
Same applies if you intend "**/*.d.ts?(x)" for both js/ts declarations.
🤖 Prompt for AI Agents
In fdm-app/.c8rc around lines 8 to 9, the glob pattern "**.d.ts" is incorrect
and does not properly match declaration files. Change it to "**/*.d.ts" to
correctly exclude all declaration files in any subdirectory. If you want to
exclude both .d.ts and .d.tsx files, use the pattern "**/*.d.ts?(x)" instead.
| const message = page.getByText("aanmelden...") | ||
| expect(message).toBeDefined() | ||
|
|
There was a problem hiding this comment.
🛠️ Refactor suggestion
Assertion does not verify visibility
expect(message).toBeDefined() always passes because the locator is always defined. Use:
- expect(message).toBeDefined()
+ await expect(message).toBeVisible()📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| const message = page.getByText("aanmelden...") | |
| expect(message).toBeDefined() | |
| const message = page.getByText("aanmelden...") | |
| - expect(message).toBeDefined() | |
| + await expect(message).toBeVisible() |
🤖 Prompt for AI Agents
In fdm-app/tests/signin._index.test.ts around lines 26 to 28, the assertion uses
expect(message).toBeDefined(), which only checks if the locator exists but does
not verify if the element is visible on the page. Replace this with an assertion
that checks the visibility of the element, such as
expect(message).toBeVisible(), to ensure the element is actually displayed to
the user.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## development #210 +/- ##
============================================
Coverage 93.07% 93.07%
============================================
Files 81 81
Lines 13118 13118
Branches 1326 1326
============================================
Hits 12209 12209
Misses 907 907
Partials 2 2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
.github/workflows/tests.yml (1)
318-321: Add a cache for Playwright browser binaries to cut ~50-60 s off every run.
pnpm exec playwright install --with-depsdownloads ~100 MB of browsers every job.
The binaries are architecture-stable and can be cached safely between runs.+ - name: Cache Playwright browsers + uses: actions/cache@v4 + with: + path: ~/.cache/ms-playwright + key: ${{ runner.os }}-playwright-${{ hashFiles('fdm-app/pnpm-lock.yaml', 'pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-playwright- + - name: Install Playwright browsers - run: pnpm exec playwright install --with-deps + run: pnpm exec playwright install --with-deps working-directory: ./fdm-app
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.github/workflows/tests.yml(1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: SvenVw
PR: SvenVw/fdm#71
File: fdm-app/app/routes/farm.create.$b_id_farm.cultivations.$b_lu_catalogue.crop.harvest._index.tsx:111-135
Timestamp: 2025-02-13T09:03:11.890Z
Learning: When adding multiple harvests in fdm-app, use Promise.all instead of Promise.allSettled to ensure atomic behavior - if one harvest addition fails, all should fail and rollback to maintain data consistency.
Learnt from: SvenVw
PR: SvenVw/fdm#65
File: fdm-core/src/global-setup.ts:7-9
Timestamp: 2025-01-29T14:33:41.822Z
Learning: In the fdm project, tests should be organized per file to maintain separation of concerns, rather than consolidating them into a centralized location.
Learnt from: SvenVw
PR: SvenVw/fdm#95
File: fdm-core/src/catalogues.ts:134-170
Timestamp: 2025-03-06T15:23:48.352Z
Learning: When writing tests for fdm-core, avoid using Vitest's `vi` mocking utilities and prefer manual JavaScript mocks.
Learnt from: SvenVw
PR: SvenVw/fdm#6
File: fdm-app/vite.config.ts:5-9
Timestamp: 2024-11-25T12:42:32.783Z
Learning: In the `fdm-app` project, SvenVw is preparing for migration to Remix v3 and may include type declarations or configurations for v3 features in advance, such as in `vite.config.ts`.
Learnt from: SvenVw
PR: SvenVw/fdm#9
File: fdm-data/src/cultivations/index.test.ts:57-59
Timestamp: 2024-11-27T12:15:36.425Z
Learning: In `fdm-data/src/cultivations/index.test.ts`, the `fdm` object created by `drizzle` does not have an `.end()` method. Cleanup code should not attempt to call `fdm.end();`.
Learnt from: SvenVw
PR: SvenVw/fdm#95
File: fdm-core/src/cultivation.ts:67-73
Timestamp: 2025-03-06T14:58:48.603Z
Learning: When writing unit tests for the fdm project, avoid using Vitest's mocking utilities (vi) as it has caused problems in the past not related to the actual code. Instead, use simple object literals with methods that throw errors to test error handling.
Learnt from: SvenVw
PR: SvenVw/fdm#20
File: fdm-app/tsconfig.json:8-9
Timestamp: 2024-12-11T12:09:35.540Z
Learning: In the `fdm-app/tsconfig.json` file, the include path `.react-router/types/**/*` refers to a build-time generated directory which is intentionally not included in the repository.
Learnt from: SvenVw
PR: SvenVw/fdm#163
File: fdm-app/app/routes/farm.$b_id_farm.$calendar.field._index.tsx:27-29
Timestamp: 2025-06-10T15:05:38.163Z
Learning: In the fdm-app codebase, the component directory structure is intentionally organized with `~/components/custom/` containing small reusable components that can be used in both blocks and pages, while `~/components/blocks/` contains larger block-level components. Not all components should be migrated from custom to blocks - the custom directory serves as a library of smaller utility components.
Learnt from: SvenVw
PR: SvenVw/fdm#95
File: fdm-core/src/cultivation.ts:67-73
Timestamp: 2025-03-06T14:38:52.315Z
Learning: When writing unit tests for the fdm project, avoid using vi.mock() as it has caused implementation problems in the past. Use direct mock functions with vi.fn() instead.
.github/workflows/tests.yml (11)
Learnt from: SvenVw
PR: #65
File: .github/workflows/check.yml:67-76
Timestamp: 2025-01-29T14:32:14.684Z
Learning: For temporary test databases that are created and destroyed within GitHub Actions workflows and run in isolated containers, using default credentials (like postgres/postgres) is acceptable as they pose no security risk.
Learnt from: SvenVw
PR: #6
File: fdm-app/vite.config.ts:5-9
Timestamp: 2024-11-25T12:42:32.783Z
Learning: In the fdm-app project, SvenVw is preparing for migration to Remix v3 and may include type declarations or configurations for v3 features in advance, such as in vite.config.ts.
Learnt from: SvenVw
PR: #9
File: fdm-data/src/cultivations/index.test.ts:57-59
Timestamp: 2024-11-27T12:15:36.425Z
Learning: In fdm-data/src/cultivations/index.test.ts, the fdm object created by drizzle does not have an .end() method. Cleanup code should not attempt to call fdm.end();.
Learnt from: SvenVw
PR: #95
File: fdm-core/src/catalogues.ts:134-170
Timestamp: 2025-03-06T15:23:48.352Z
Learning: When writing tests for fdm-core, avoid using Vitest's vi mocking utilities and prefer manual JavaScript mocks.
Learnt from: SvenVw
PR: #20
File: fdm-app/tsconfig.json:8-9
Timestamp: 2024-12-11T12:09:35.540Z
Learning: In the fdm-app/tsconfig.json file, the include path .react-router/types/**/* refers to a build-time generated directory which is intentionally not included in the repository.
Learnt from: SvenVw
PR: #45
File: fdm-app/app/routes/farm.$b_id_farm._index.tsx:1-1
Timestamp: 2025-01-14T16:06:24.294Z
Learning: In the fdm-app codebase, the redirect function should be imported from react-router, not react-router-dom.
Learnt from: SvenVw
PR: #9
File: fdm-core/src/cultivation.d.ts:3-13
Timestamp: 2024-11-27T09:58:24.047Z
Learning: In the fdm-core TypeScript codebase, interface names should not be prefixed with 'I'; interface names should be meaningful without the 'I' prefix.
Learnt from: SvenVw
PR: #71
File: fdm-app/app/routes/farm.create.$b_id_farm.cultivations.$b_lu_catalogue.crop.harvest._index.tsx:111-135
Timestamp: 2025-02-13T09:03:11.890Z
Learning: When adding multiple harvests in fdm-app, use Promise.all instead of Promise.allSettled to ensure atomic behavior - if one harvest addition fails, all should fail and rollback to maintain data consistency.
Learnt from: SvenVw
PR: #65
File: fdm-core/src/global-setup.ts:7-9
Timestamp: 2025-01-29T14:33:41.822Z
Learning: In the fdm project, tests should be organized per file to maintain separation of concerns, rather than consolidating them into a centralized location.
Learnt from: SvenVw
PR: #45
File: fdm-app/app/routes/farm.$b_id_farm.settings._index.tsx:1-1
Timestamp: 2025-01-14T16:06:21.832Z
Learning: In the fdm project, redirect and other routing utilities should be imported from react-router instead of react-router-dom.
Learnt from: SvenVw
PR: #95
File: fdm-core/src/cultivation.ts:67-73
Timestamp: 2025-03-06T14:58:48.603Z
Learning: When writing unit tests for the fdm project, avoid using Vitest's mocking utilities (vi) as it has caused problems in the past not related to the actual code. Instead, use simple object literals with methods that throw errors to test error handling.
🔇 Additional comments (1)
.github/workflows/tests.yml (1)
334-336: Possible duplicate compile – reconsider the explicitpnpm build fdm-app.If
playwright.config.tsstarts the dev server via thewebServeroption (common pattern), a priorpnpm buildis unnecessary and just costs CI time.
Consider removing this step or comment why a production build is required here.
| # The hostname used to communicate with the PostgreSQL service container | ||
| POSTGRES_HOST: postgres | ||
| # The default PostgreSQL port | ||
| POSTGRES_PORT: 5432 | ||
| # the default usernam | ||
| POSTGRES_USER: postgres | ||
| # the default password | ||
| POSTGRES_PASSWORD: postgres | ||
| # the default database | ||
| POSTGRES_DB: postgres | ||
|
|
||
| # Public name of the application displayed in the UI. | ||
| PUBLIC_FDM_NAME: MINAS4 | ||
| # Base URL of the application (used for API calls, etc.). | ||
| PUBLIC_FDM_URL: http://localhost:3000 | ||
| # URL to the privacy policy document. | ||
| PUBLIC_FDM_PRIVACY_URL: http://localhost:3000/privacy | ||
| # Secret key used to sign session cookies. MUST be a strong, random string. | ||
| FDM_SESSION_SECRET: blablabla1 | ||
| # Authentication (Better Auth & OAuth Providers) | ||
| BETTER_AUTH_SECRET: blablabla2 | ||
| # Full base URL of this application (used for redirects by better-auth). | ||
| BETTER_AUTH_URL: http://localhost:3000 |
There was a problem hiding this comment.
🛠️ Refactor suggestion
Move hard-coded secrets to repository/organization secrets.
FDM_SESSION_SECRET, BETTER_AUTH_SECRET and other secrets are embedded in the workflow file.
Even though the runner is ephemeral, keeping real-looking secrets in plain text is a bad habit and may be copied into other contexts.
Store them in Secrets → Actions and reference with ${{ secrets.FDM_SESSION_SECRET }} etc.
🤖 Prompt for AI Agents
In .github/workflows/tests.yml around lines 342 to 364, the secrets like
FDM_SESSION_SECRET and BETTER_AUTH_SECRET are hard-coded in plain text, which is
insecure. Move these secret values to the repository or organization secrets
under GitHub Actions Secrets, then replace the hard-coded values in the workflow
file with references to these secrets using the syntax ${{ secrets.SECRET_NAME
}} to securely inject them during runtime.
| - name: fdm-app - Upload results to Codecov | ||
| uses: codecov/codecov-action@v5 | ||
| with: | ||
| files: ./fdm-app/coverage/tmp/*.json | ||
| flags: fdm-app | ||
| token: ${{ secrets.CODECOV_TOKEN }} |
There was a problem hiding this comment.
🛠️ Refactor suggestion
Codecov step might miss files when the glob expands to multiple paths.
files: ./fdm-app/coverage/tmp/*.json expands to a space-separated list which Codecov v5 does not parse.
Either:
- Merge coverage first (
npx playwright merge-coverage→ singlecoverage-final.json) - Pass a newline-separated list via the multiline YAML literal.
Example fix:
- files: ./fdm-app/coverage/tmp/*.json
+ files: |
+ ./fdm-app/coverage/tmp/**/coverage*.json📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| - name: fdm-app - Upload results to Codecov | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| files: ./fdm-app/coverage/tmp/*.json | |
| flags: fdm-app | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| - name: fdm-app - Upload results to Codecov | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| files: | | |
| ./fdm-app/coverage/tmp/**/coverage*.json | |
| flags: fdm-app | |
| token: ${{ secrets.CODECOV_TOKEN }} |
🤖 Prompt for AI Agents
In .github/workflows/tests.yml around lines 370 to 375, the Codecov upload step
uses a glob pattern that expands to a space-separated list of files, which
Codecov v5 does not handle correctly. To fix this, either merge the coverage
files into a single file before uploading or change the files input to a
newline-separated list using YAML multiline literal syntax to ensure Codecov
correctly processes all coverage files.
…creation wizards only once
fdm-app/testsdirectory. Since they are not unit tests they aren't added next to the source files unlike in other packages.Summary by CodeRabbit
New Features
Chores
Tests