Skip to content

Keep only major.minor in Processor#version - #2109

Open
MahinAnowar wants to merge 2 commits into
postcss:mainfrom
MahinAnowar:version-major-minor
Open

Keep only major.minor in Processor#version#2109
MahinAnowar wants to merge 2 commits into
postcss:mainfrom
MahinAnowar:version-major-minor

Conversation

@MahinAnowar

@MahinAnowar MahinAnowar commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Fixes #2101

Processor#version now holds only major.minor ('8.5'), so patch releases no longer require the manual lib/processor.js sync (the repo is currently on the 8.5.16 tag while the file said 8.5.15 — exactly the chore this removes).

Details:

  • The only functional consumer, the plugin-compatibility warning in lib/lazy-result.js, already compares just split('.')[0]/[1], so it works unchanged with a two-segment version.
  • test/version.js still guards against drift: it now compares Processor#version against package.json's major.minor, so a minor/major bump without updating lib/processor.js still fails CI, while patch releases no longer trip it.
  • Updated the two format assertions (test/processor.test.ts, test/postcss.test.ts) to /^\d+\.\d+$/ — they fail on the previous three-segment value and pass now — and the Processor#version JSDoc.

All checks pass locally: 652/652 unit tests, lint, types, version guard.

Summary by CodeRabbit

  • Changes
    • Updated the reported processor version to use major.minor format.
    • Updated version validation and related checks to match the shortened format.
    • Clarified version documentation to describe the new format.

@ai

ai commented Jul 5, 2026

Copy link
Copy Markdown
Member

We haven’t started v9 branch yet.

I can keep your PR until we will start v9 development, but you need to fix merge conflict.

@MahinAnowar
MahinAnowar force-pushed the version-major-minor branch from 984730e to 504e8f1 Compare July 5, 2026 12:15
@MahinAnowar

Copy link
Copy Markdown
Contributor Author

Rebased onto main and resolved the conflict — kept '8.5' over the new 8.5.16 bump (the version guard now checks against package.json's major.minor, so it stays green). Happy to have this parked until v9 development starts.

@MahinAnowar
MahinAnowar force-pushed the version-major-minor branch 3 times, most recently from 7062542 to fd22449 Compare July 15, 2026 17:38
@MahinAnowar
MahinAnowar force-pushed the version-major-minor branch 3 times, most recently from 5a3314d to a9251e3 Compare July 25, 2026 03:54
@MahinAnowar
MahinAnowar force-pushed the version-major-minor branch from a9251e3 to 4274f3c Compare July 28, 2026 14:17
@MahinAnowar
MahinAnowar force-pushed the version-major-minor branch from 4274f3c to cb4d956 Compare August 1, 2026 08:52
Hardcoding the full patch version forces a manual lib/processor.js edit
on every patch release. Only major.minor is ever consumed (lazy-result's
plugin compatibility warning), so store just that. The test/version.js
guard still catches drift against package.json on minor/major bumps.

Fixes postcss#2101
main released 8.5.28; kept the major.minor value this PR introduces.
@MahinAnowar

Copy link
Copy Markdown
Contributor Author

Merged main in — this had drifted into a conflict, so it wasn't getting CI at all.

The conflict was just the version line: main is on 8.5.28 now, and this PR replaces that with '8.5', so I kept the major.minor value. Worth flagging that this'll re-conflict on every patch release, so it's probably worth merging or closing rather than leaving to drift.

pnpm unit is 701/701 locally, test:version and check-dts both pass.

@coderabbitai

coderabbitai Bot commented Sep 3, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Team

Run ID: 019cfef5-af10-4594-a3b1-a27d620e952b

📥 Commits

Reviewing files that changed from the base of the PR and between e544bff and eace9fe.

📒 Files selected for processing (5)
  • lib/processor.d.ts
  • lib/processor.js
  • test/postcss.test.ts
  • test/processor.test.ts
  • test/version.js

Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

Processor.version now contains only the package major and minor version. Documentation, runtime validation, and tests use the major.minor format.

Changes

Processor version format

Layer / File(s) Summary
Version contract and validation
lib/processor.d.ts, lib/processor.js, test/version.js, test/postcss.test.ts, test/processor.test.ts
The processor reports 8.5 instead of 8.5.28. Documentation, validation, and tests now require a two-component major.minor version.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Merge Risk: ⚪ Minimal · up to eace9

Processor.version now reports major.minor rather than a patch-specific version, with its validation, tests, and documentation aligned. The change is ready to merge.

Suggested reviewers: ai

🚥 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 clearly and concisely describes the primary change: limiting Processor.version to the major.minor format.
Linked Issues check ✅ Passed The pull request satisfies issue #2101 by changing Processor.version from the full patch version to major.minor and updating the related documentation, tests, and version guard.
Out of Scope Changes check ✅ Passed All changes support the linked issue. The documentation, implementation, version guard, and format assertions are directly related to the Processor.version update.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 5…
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 5 files.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@lbesecker195 lbesecker195 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Removes the manual patch-version sync that had already drifted (8.5.28 vs the released tag), and the documented usage of version only ever splits on the major. Tests updated to match. LGTM.

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.

Put opnly major.minor in Processor.version

4 participants