Attempt to fix develop branch build error#3661
Conversation
📝 WalkthroughWalkthroughUpdated GitHub Actions workflows to use actions/setup-node@v5. Adjusted TypeScript typing in base-provider.tsx by casting apiFetch options to Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Warning Review ran into problems🔥 ProblemsErrors were encountered while retrieving linked issues. Errors (1)
✨ Finishing Touches
🧪 Generate unit tests
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: 0
🧹 Nitpick comments (5)
.github/workflows/node.js.yml (1)
31-34: Upgrade to setup-node v5 looks good; consider minor hardening.Add check-latest and cache-dependency-path to stabilize CI across runners and monorepos.
Apply this diff:
- - name: Use Node.js ${{ env.NODE_VERSION }} - uses: actions/setup-node@v5 - with: - node-version: ${{ env.NODE_VERSION }} - cache: npm + - name: Use Node.js ${{ env.NODE_VERSION }} + uses: actions/setup-node@v5 + with: + node-version: ${{ env.NODE_VERSION }} + check-latest: true + cache: npm + cache-dependency-path: | + package-lock.json + **/package-lock.json.github/workflows/e2e-tests.yml (1)
34-37: setup-node v5: add cache-dependency-path and check-latest for reproducibility.This helps avoid stale caches and patch-level drift during Playwright/E2E runs.
Apply this diff:
- - name: Use Node.js ${{ env.NODE_VERSION }} - uses: actions/setup-node@v5 - with: - node-version: ${{ env.NODE_VERSION }} - cache: npm + - name: Use Node.js ${{ env.NODE_VERSION }} + uses: actions/setup-node@v5 + with: + node-version: ${{ env.NODE_VERSION }} + check-latest: true + cache: npm + cache-dependency-path: | + package-lock.json + **/package-lock.jsonsrc/content-helper/common/providers/base-provider.tsx (2)
140-141: Good @SInCE note; align JSDoc types and optional-param syntax.Update JSDoc to match the signature and WP JS docs: use APIFetchOptions, Promise, and optional param as [id].
Suggested JSDoc block (outside the changed hunk):
/** * Fetches data from the API. Either resolves with the data or rejects with an error. * * This method is a wrapper around apiFetch() that automatically adds the AbortController signal. * * @since 3.15.0 * @since 3.20.7 Using APIFetchOptions<true> to avoid a type error when building on GitHub. * * @param {APIFetchOptions<true>} options Options to pass to apiFetch. * @param {string} [id] Optional request ID used for cancellation. * * @return {Promise<T>} The fetched data. */
151-154: Redundant type cast; let the function signature carry the type.options is already APIFetchOptions; the extra cast is noise.
Apply this diff:
- const response = await apiFetch<ContentHelperAPIResponse<T>>( - options as APIFetchOptions<true> - ); + const response = await apiFetch<ContentHelperAPIResponse<T>>( options );.github/workflows/build-plugin.yml (1)
55-58: setup-node v5: enable check-latest and broaden cache key.Prevents Node patch skew and improves cache hits when multiple package-lock.json files exist.
Apply this diff:
- - name: Use Node.js ${{ env.NODE_VERSION }} - uses: actions/setup-node@v5 - with: - node-version: ${{ env.NODE_VERSION }} - cache: npm + - name: Use Node.js ${{ env.NODE_VERSION }} + uses: actions/setup-node@v5 + with: + node-version: ${{ env.NODE_VERSION }} + check-latest: true + cache: npm + cache-dependency-path: | + package-lock.json + **/package-lock.json
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
.github/workflows/build-plugin.yml(1 hunks).github/workflows/e2e-tests.yml(1 hunks).github/workflows/node.js.yml(1 hunks)src/content-helper/common/providers/base-provider.tsx(2 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{js,ts,tsx,jsx}
⚙️ CodeRabbit configuration file
**/*.{js,ts,tsx,jsx}: "Perform a detailed review of the provided code with following key aspects in mind:
- Review the code to ensure it is well-structured and adheres to best practices.
- Verify compliance with WordPress coding standards.
- Ensure the code is well-documented.
- Check for security vulnerabilities and confirm the code is secure.
- Optimize the code for performance, removing any unnecessary elements.
- Validate JSDoc comments for accuracy, currency, and adherence to WordPress coding standards.
- Ensure each line comment concludes with a period.
- Confirm every JSDoc comment includes a @SInCE tag indicating the next version of the plugin to include the code.
- Guarantee compatibility with the latest version of WordPress, avoiding deprecated functions or features."
Files:
src/content-helper/common/providers/base-provider.tsx
🧬 Code graph analysis (1)
src/content-helper/common/providers/base-provider.tsx (1)
src/content-helper/common/providers/base-wordpress-provider.tsx (1)
apiFetch(145-189)
⏰ 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). (1)
- GitHub Check: E2E against WordPress latest
Description
When we updated api-fetch to 7.30, we started getting this error when
npm run buildwas being called. From here:We fixed the error with 0a6834b, but then
developplugin builds started failing. This doesn't happen for the PRs themselves. We're getting the error only after merging intodevelopThis PR is an attempt to fix this issue.
Summary by CodeRabbit