Skip to content

chore: exclude generated files from git to eliminate merge conflicts#80

Merged
nitrocode merged 2 commits into
mainfrom
copilot/improve-css-conflict-resolution
Apr 26, 2026
Merged

chore: exclude generated files from git to eliminate merge conflicts#80
nitrocode merged 2 commits into
mainfrom
copilot/improve-css-conflict-resolution

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 26, 2026

  • Diagnose: tests fail because milestones-data.js and script.js are now gitignored (generated files) but tests depend on them
  • Add pretest and pretest:ci lifecycle scripts to package.json so both npm test and npm run test:ci auto-build the needed files
  • Add explicit npm run build:milestones && npm run build:js step in unit-tests.yml before npm run test:ci
  • All 253 tests pass

Summary by CodeRabbit

Release Notes

  • Chores
    • Restructured build process to treat generated files as build outputs rather than committed artifacts.
    • Updated CI/CD workflows to automatically generate required files during testing and deployment pipelines.
    • Updated documentation to reflect new build workflow requirements for local development.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 26, 2026

📝 Walkthrough

Walkthrough

Remove several generated frontend artifacts from source control, update CI/workflows and npm scripts to build those artifacts during CI and preview runs, add build artifacts to .gitignore, and update docs to require local build before E2E/testing. Deleted large generated JS/CSS runtime files.

Changes

Cohort / File(s) Summary
CI / Workflow changes
.github/workflows/e2e-tests.yml, .github/workflows/preview.yml, .github/workflows/unit-tests.yml
Add/replace steps so workflows run npm run build (or build:milestones + build:js) before tests/preview, ensuring generated artifacts are produced during CI and preview deployments.
NPM scripts
package.json
Add pretest and pretest:ci scripts to run npm run build:milestones && npm run build:js before test commands.
Generated artifacts removed
changelog-data.js, milestones-data.js, project-stats-data.js, script.js, styles.css
Delete auto-generated data and frontend runtime/CSS files from the repo; their runtime exports and UI/CSS definitions are removed.
Gitignore & docs
.gitignore, AGENTS.md
Update .gitignore to ignore generated build outputs (script.js, styles.css, *-data.js, etc.) and update AGENTS.md to require local npm run build before running E2E/testing and to stop committing generated outputs.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Suggested reviewers

  • nitrocode
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'chore: exclude generated files from git to eliminate merge conflicts' accurately and specifically describes the main objective of the pull request: removing generated artifacts from version control to prevent merge conflicts.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch copilot/improve-css-conflict-resolution

Comment @coderabbitai help to get the list of available commands and usage tips.

@nitrocode nitrocode self-requested a review as a code owner April 26, 2026 15:39
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 26, 2026

👁️ PR Preview

🚀 Open Preview

Deployed from commit b5f8b47 · Updates on every push to this PR
(Preview is removed automatically when the PR is closed.)

Copy link
Copy Markdown
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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.github/workflows/e2e-tests.yml (1)

34-55: ⚠️ Potential issue | 🟠 Major

Build step is good, but the E2E trigger filter now misses real site changes.

Line 36 gates the whole job, and current filters don’t include CHANGELOG.md, milestones.yaml, or project-stats.yaml. With generated files no longer committed, those inputs can change runtime content without running E2E.

🛠️ Suggested filter update
       - name: Detect relevant file changes
         uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1
         id: filter
         with:
           filters: |
             code:
               - '**/*.js'
               - '**/*.ts'
               - '**/*.css'
+              - 'CHANGELOG.md'
+              - 'milestones.yaml'
+              - 'project-stats.yaml'
               - 'tests/**'
               - 'package*.json'
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/e2e-tests.yml around lines 34 - 55, The test-e2e job is
gated by "if: needs.changes.outputs.code == 'true'" which misses non-code files
(CHANGELOG.md, milestones.yaml, project-stats.yaml); update the workflow so
test-e2e runs when those files change as well by either (A) extending the
condition on the test-e2e job (replace "if: needs.changes.outputs.code ==
'true'" with a compound check ORing outputs for the
changelog/milestones/project-stats e.g. needs.changes.outputs.code == 'true' ||
needs.changes.outputs.changelog == 'true' || needs.changes.outputs.milestones ==
'true' || needs.changes.outputs.project_stats == 'true'), or (B) modify the
changes-detection step that produces needs.changes outputs to emit additional
outputs for CHANGELOG.md, milestones.yaml, and project-stats.yaml so the
existing if can reference them; locate "test-e2e" and the "if:
needs.changes.outputs.code" line to implement the change.
🧹 Nitpick comments (1)
AGENTS.md (1)

322-336: One instruction still conflicts with the new E2E requirement.

Line 134 now correctly requires npm run build && npm run test:e2e, but Line 330 still says only npm run test:e2e. Please align the “What NOT to Do” bullet to avoid mixed guidance.

🛠️ Suggested wording fix
-- Do **not** finish a session without running `npm run test:ci` and `npm run test:e2e` to confirm both suites pass.
+- Do **not** finish a session without running `npm run test:ci` and `npm run build && npm run test:e2e` to confirm both suites pass.

As per coding guidelines: "Document and maintain agent specifications in AGENTS.md file".

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@AGENTS.md` around lines 322 - 336, The "What NOT to Do" bullet that currently
instructs running only `npm run test:e2e` conflicts with the updated requirement
to run a build first; edit the AGENTS.md bullet that reads "Do not finish a
session without running `npm run test:ci` and `npm run test:e2e`" to require the
build step by changing it to require `npm run build && npm run test:e2e` (or
mirror the existing line that requires `npm run build && npm run test:e2e`) so
both bullets consistently mandate the build before e2e tests.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In @.github/workflows/e2e-tests.yml:
- Around line 34-55: The test-e2e job is gated by "if:
needs.changes.outputs.code == 'true'" which misses non-code files (CHANGELOG.md,
milestones.yaml, project-stats.yaml); update the workflow so test-e2e runs when
those files change as well by either (A) extending the condition on the test-e2e
job (replace "if: needs.changes.outputs.code == 'true'" with a compound check
ORing outputs for the changelog/milestones/project-stats e.g.
needs.changes.outputs.code == 'true' || needs.changes.outputs.changelog ==
'true' || needs.changes.outputs.milestones == 'true' ||
needs.changes.outputs.project_stats == 'true'), or (B) modify the
changes-detection step that produces needs.changes outputs to emit additional
outputs for CHANGELOG.md, milestones.yaml, and project-stats.yaml so the
existing if can reference them; locate "test-e2e" and the "if:
needs.changes.outputs.code" line to implement the change.

---

Nitpick comments:
In `@AGENTS.md`:
- Around line 322-336: The "What NOT to Do" bullet that currently instructs
running only `npm run test:e2e` conflicts with the updated requirement to run a
build first; edit the AGENTS.md bullet that reads "Do not finish a session
without running `npm run test:ci` and `npm run test:e2e`" to require the build
step by changing it to require `npm run build && npm run test:e2e` (or mirror
the existing line that requires `npm run build && npm run test:e2e`) so both
bullets consistently mandate the build before e2e tests.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 97ff9992-3881-4b92-8049-29d7d40fe524

📥 Commits

Reviewing files that changed from the base of the PR and between a0b3ce4 and 06f9dbf.

📒 Files selected for processing (9)
  • .github/workflows/e2e-tests.yml
  • .github/workflows/preview.yml
  • .gitignore
  • AGENTS.md
  • changelog-data.js
  • milestones-data.js
  • project-stats-data.js
  • script.js
  • styles.css
💤 Files with no reviewable changes (5)
  • project-stats-data.js
  • styles.css
  • milestones-data.js
  • changelog-data.js
  • script.js

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 26, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (a0b3ce4) to head (b5f8b47).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##              main       #80   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            1         1           
  Lines          233       233           
  Branches       107       107           
=========================================
  Hits           233       233           
Flag Coverage Δ
unit 100.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a0b3ce4...b5f8b47. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
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.

🧹 Nitpick comments (2)
package.json (1)

8-10: Extract the shared pre-test build chain, fool.

Line 8 and Line 10 duplicate the same command. Put that chain in one script so local and CI hooks don’t drift later.

♻️ Suggested cleanup
   "scripts": {
     "typecheck": "tsc --noEmit",
-    "pretest": "npm run build:milestones && npm run build:js",
+    "build:test-artifacts": "npm run build:milestones && npm run build:js",
+    "pretest": "npm run build:test-artifacts",
     "test": "jest --coverage",
-    "pretest:ci": "npm run build:milestones && npm run build:js",
+    "pretest:ci": "npm run build:test-artifacts",
     "test:ci": "jest --ci --coverage",
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@package.json` around lines 8 - 10, The pretest build chain is duplicated in
the "pretest" and "pretest:ci" scripts; add a single shared script (e.g.,
"pretest:build") with the command "npm run build:milestones && npm run
build:js", then update both "pretest" and "pretest:ci" to call "npm run
pretest:build" so the build chain is centralized and cannot drift.
.github/workflows/unit-tests.yml (1)

51-58: I pity the fool who makes CI do the same work twice, sucka!

Line 52 runs npm run build:milestones && npm run build:js, and then line 58 calls npm run test:ci while your package.json already defines pretest:ci with that exact same build chain. When you run npm run test:ci, npm automatically runs pretest:ci first — that's how npm lifecycle scripts work, jive turkey! You be doublin' the build work for no reason!

Remove the explicit build step and let pretest:ci handle it. Your CI gonna move faster, I guarantee it!

🧹 Remove the redundant build step
-      - name: Build generated files needed for tests
-        run: npm run build:milestones && npm run build:js
-
       - name: Run type check
         run: npm run typecheck
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/unit-tests.yml around lines 51 - 58, The workflow
currently runs the build twice: the explicit step named "Build generated files
needed for tests" runs npm run build:milestones && npm run build:js, and then
the "Run tests with coverage" step runs npm run test:ci which already triggers
pretest:ci (containing the same build chain). Remove the entire explicit build
step (the job step that runs npm run build:milestones && npm run build:js) so
tests rely on npm lifecycle pretest:ci, keeping the "Run tests with coverage"
step that runs npm run test:ci unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In @.github/workflows/unit-tests.yml:
- Around line 51-58: The workflow currently runs the build twice: the explicit
step named "Build generated files needed for tests" runs npm run
build:milestones && npm run build:js, and then the "Run tests with coverage"
step runs npm run test:ci which already triggers pretest:ci (containing the same
build chain). Remove the entire explicit build step (the job step that runs npm
run build:milestones && npm run build:js) so tests rely on npm lifecycle
pretest:ci, keeping the "Run tests with coverage" step that runs npm run test:ci
unchanged.

In `@package.json`:
- Around line 8-10: The pretest build chain is duplicated in the "pretest" and
"pretest:ci" scripts; add a single shared script (e.g., "pretest:build") with
the command "npm run build:milestones && npm run build:js", then update both
"pretest" and "pretest:ci" to call "npm run pretest:build" so the build chain is
centralized and cannot drift.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: ed5930d3-4c50-480e-a1ab-6c88f9368743

📥 Commits

Reviewing files that changed from the base of the PR and between 06f9dbf and b5f8b47.

📒 Files selected for processing (2)
  • .github/workflows/unit-tests.yml
  • package.json

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.

2 participants