zhaohai666 opened a new pull request, #1674:
URL: https://github.com/apache/rocketmq-dashboard/pull/1674

   # PR: ci: gate builds on tests and lint, add dockerignore and buildx cache
   
   **Branch:** `feature/studio-ci-gating`
   **Commit:** `78a628d8` — pushed to `origin/feature/studio-ci-gating`
   **Base:** `apache:rocketmq-studio` @ `990ba092`
   **PR create link:** 
https://github.com/zhaohai666/rocketmq-dashboard/pull/new/feature/studio-ci-gating
   
   ## Summary
   
   Turns CI into an actual gate: the backend test suite and the frontend lint +
   vitest suite now run in CI (previously `mvn -DskipTests` and no lint/test at
   all), Docker build contexts are kept small with `.dockerignore`, the frontend
   Docker build uses Buildx with GHA layer cache, and a concurrency group 
cancels
   superseded runs.
   
   ## Changes
   
   ### `.github/workflows/ci.yml`
   
   - **backend-build**: `mvn -B -ntp clean package` (drop `-DskipTests`) so 
server
     regressions fail the gate.
   - **frontend-build**: adds `npm run lint` and `npm run test` before `npm run
     build`.
   - **frontend-docker-build**: uses `docker/setup-buildx-action` +
     `docker/build-push-action` with `cache-from/to: type=gha` instead of a bare
     `docker build`, so the image build is cached and no longer duplicates the
     frontend-build npm ci + vite build work.
   - Added a `concurrency` group (`cancel-in-progress: true`).
   
   ### `.dockerignore`
   
   - `web/.dockerignore`: excludes `node_modules` (hundreds of MB), `dist`, 
`.git`,
     `.env*`, coverage and logs.
   - `server/.dockerignore`: excludes `target`, `.git`, local repos and IDE 
files.
   
   ### Frontend lint fixes (required for the new lint gate)
   
   Two `react-hooks/set-state-in-effect` errors in 
`web/src/pages/instance/consumer.tsx`
   were blocking the lint step (they exist on the base branch):
   
   - Instance-scoped dialog resets moved to React's render-time adjustment 
pattern
     (`prevInstanceId` comparison) instead of an effect body.
   - Empty-instance list/loading resets now run in a microtask from the effect,
     preserving the previous behavior without effect-body `setState`.
   
   ## Verification
   
   - `eslint .` — 0 errors, 6 pre-existing warnings.
   - `tsc -b` — clean.
   - `ConsumerPage.test.tsx` — 11/11.
   
   ## Notes
   
   - The 6 remaining lint warnings are pre-existing (react-refresh mixed 
exports,
     exhaustive-deps on request-id refs) and tracked for the frontend cleanup 
PR.
   - The full server suite now runs in CI; it passed locally (902 tests) on the
     base commit.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to