Skip to content

Fix CI lint and test failures#396

Merged
hotlong merged 3 commits intomainfrom
copilot/fix-ci-build-and-test-again
Feb 8, 2026
Merged

Fix CI lint and test failures#396
hotlong merged 3 commits intomainfrom
copilot/fix-ci-build-and-test-again

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 8, 2026

CI was failing on both the Lint and Test jobs. Lint had 13+ errors across 4 packages from React Compiler rules (react-hooks/preserve-manual-memoization, react-hooks/rules-of-hooks, react-hooks/static-components). Tests had a TypeError from MSW mock handlers returning raw records instead of the { record: ... } envelope the ObjectStackAdapter expects.

Lint fixes

  • plugin-detail/DetailView.tsx — Use schema in useCallback deps instead of individual schema.* properties, satisfying react-hooks/preserve-manual-memoization
  • plugin-view/index.tsx — Replace conditional useContext with a FallbackContext so the hook is always called unconditionally
  • plugin-form/ObjectForm.tsx — Extract SimpleObjectForm component so useState/useEffect/useCallback aren't called after early returns
  • components/action-menu.tsx, components/layout/page.tsx — Render dynamic component references as memoized elements to satisfy react-hooks/static-components
  • plugin-report/package.json — Drop --max-warnings 0 (unique to this package, inconsistent with all others)
  • components/__tests__/view-compliance.test.tsxletconst

Test fixes

  • apps/console/src/mocks/server.ts — Wrap create/get/update MSW responses in { record: ... }:
// Before: adapter.findOne() → result.record → undefined
return HttpResponse.json(response, { status: 201 });

// After: matches ObjectStackClient.unwrapResponse → adapter.record extraction
return HttpResponse.json({ record: response }, { status: 201 });
  • plugin-form/ObjectForm.msw.test.tsx — Same envelope fix for plugin-form's standalone MSW handler

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@vercel
Copy link
Copy Markdown

vercel Bot commented Feb 8, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
objectui Ready Ready Preview, Comment Feb 8, 2026 3:18am
objectui-console Ready Ready Preview, Comment Feb 8, 2026 3:18am
objectui-storybook Ready Ready Preview, Comment Feb 8, 2026 3:18am

Request Review

…ditional hook), plugin-report (max-warnings), and fix MSW mock response format for tests

Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
…nst), plugin-form (hooks after early returns), and fix MSW test mock handler

Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix CI build and test issues Fix CI lint and test failures Feb 8, 2026
Copilot AI requested a review from hotlong February 8, 2026 03:18
@hotlong hotlong marked this pull request as ready for review February 8, 2026 03:36
Copilot AI review requested due to automatic review settings February 8, 2026 03:36
@hotlong hotlong merged commit 20282c0 into main Feb 8, 2026
8 checks passed
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes CI failures by addressing new eslint-plugin-react-hooks React Compiler rules violations and aligning MSW mock responses with the ObjectStackAdapter response envelope expectations.

Changes:

  • Refactors several React components to satisfy React Compiler-related lint rules (hooks ordering, conditional hooks, static component references, manual memoization preservation).
  • Updates MSW handlers to wrap record responses in { record: ... } for findOne/create/update compatibility with ObjectStackAdapter.
  • Normalizes @object-ui/plugin-report lint script to match other packages.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/plugin-view/src/index.tsx Introduces a fallback context so useContext is never called conditionally.
packages/plugin-report/package.json Aligns lint script to eslint . for consistency across packages.
packages/plugin-form/src/ObjectForm.tsx Extracts default/simple form variant into a separate component to avoid hooks after early returns.
packages/plugin-form/src/ObjectForm.msw.test.tsx Wraps MSW get handler response as { record: ... }.
packages/plugin-detail/src/DetailView.tsx Adjusts useCallback dependency arrays to satisfy lint rules.
packages/components/src/renderers/layout/page.tsx Memoizes layout element rendering to satisfy react-hooks/static-components.
packages/components/src/renderers/action/action-menu.tsx Memoizes dynamic icon rendering to satisfy react-hooks/static-components.
packages/components/src/tests/view-compliance.test.tsx Minor test lint fix (letconst).
apps/console/src/mocks/server.ts Wraps MSW create/get/update responses in { record: ... } to match adapter expectations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants