Skip to content

ci: a code change must come with a new version (#63) - #65

Merged
compot-dev merged 1 commit into
masterfrom
ci/version-check
Oct 17, 2026
Merged

compot-dev merged 1 commit into
masterfrom
ci/version-check

Conversation

@compot-dev

Copy link
Copy Markdown
Collaborator

Closes #63.

What changes

  • .github/check-version.sh: the script of OpenIPC/vectis (vectis#42), so the check is the same across the repositories; only the version macro (CAMEX_VERSION in src/version.h) and the code paths differ. It fails when:

    • src/, android/, Makefile, ci/ or scripts/ changed against the base, but the version did not;
    • the version is not MAJOR.MINOR.PATCH without leading zeros, or not greater than the base one (sort -V);
    • CHANGELOG.md has no ## X.Y.Z — YYYY-MM-DD section for it, or the section is already on the base branch.

    Docs, tests, screenshots and the workflows in .github/ need no new version. ci/ counts as build, because ci/build-musl.sh produces the release binaries.

  • build.yml: a "Version bump" job on pull requests (fetch-depth: 0, the base branch passed through the environment).

  • README (en/ru/zh-CN, one commit): a "When to bump" section in "Versioning & Release Process" — PATCH/MINOR/MAJOR, which paths need a bump, what CI checks, and that the check is red until the bump commit is pushed.

Checked locally (scratch clone, base origin/master at 3.0.2)

Case Result
no changes pass
src/ changed, version 3.0.2 fail: still 3.0.2
3.0.3, no CHANGELOG section fail
3.0.3 with ## 3.0.3 — 2026-10-18 pass
3.0.01 fail: not MAJOR.MINOR.PATCH
3.0.1 fail: not greater than 3.0.2
README and tests/ only pass
ci/build-musl.sh only fail: still 3.0.2

This PR changes only .github/ and the READMEs, so its own "Version bump" job should pass without a new version.

.github/check-version.sh, the script of OpenIPC/vectis with camex's
version macro and paths: a pull request that changes src/, android/,
the Makefile, ci/ or scripts/ must raise CAMEX_VERSION (MAJOR.MINOR.PATCH
without leading zeros, greater than the base) and add its new
'## X.Y.Z — YYYY-MM-DD' section to CHANGELOG.md. Docs, tests,
screenshots and .github/ need no new version. The "Version bump" job
runs it on every pull request.

READMEs: a "When to bump" section with the rule.
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Summary by Qodo

Require version bumps for code and build changes in pull requests

✨ Enhancement ⚙️ Configuration changes 📝 Documentation 🕐 10-20 Minutes

Grey Divider

AI Description

• Add a pull-request check requiring code and build changes to include a higher version and new
 changelog section.
• Exempt documentation, tests, screenshots, and workflow-only changes from version bumps.
• Document bump rules and CI behavior in the English, Russian, and Chinese READMEs.
Diagram

graph TD
  PR["Pull request"] --> CHECK["Version check"] --> CHANGED{"Version changed?"} -->|yes| VALID{"Valid higher version?"} -->|yes| NOTES{"New changelog section?"} -->|yes| PASS["Pass"]
  CHANGED -->|no| CODE{"Code or build changed?"} -->|yes| FAIL["Fail"]
  CODE -->|no| PASS
  VALID -->|no| FAIL
  NOTES -->|no| FAIL
Loading
High-Level Assessment

A dedicated pull-request check fits the stated policy: it compares against the actual base branch and leaves documentation and workflow-only PRs unblocked. Requiring bumps for every PR would remove those intended exemptions without improving enforcement for covered paths.

Files changed (5) +130 / -0

Enhancement (1) +65 / -0
check-version.shValidate version bumps against the PR base +65/-0

Validate version bumps against the PR base

• Adds a shell check for changes under src/, android/, ci/, scripts/, or Makefile. When the version changes, it requires a well-formed, greater CAMEX_VERSION and a dated CHANGELOG.md section not already present on the base branch.

.github/check-version.sh

Documentation (3) +46 / -0
README.mdExplain version-bump rules in English +16/-0

Explain version-bump rules in English

• Documents PATCH, MINOR, and MAJOR guidance, which paths require a bump, and what the CI check expects before merge.

README.md

README.ru.mdExplain version-bump rules in Russian +16/-0

Explain version-bump rules in Russian

• Adds Russian guidance for version levels, covered and exempt paths, changelog entries, and the pull-request check.

README.ru.md

README.zh-CN.mdExplain version-bump rules in Chinese +14/-0

Explain version-bump rules in Chinese

• Adds Simplified Chinese guidance for version levels, covered and exempt paths, changelog entries, and the pull-request check.

README.zh-CN.md

Other (1) +19 / -0
build.ymlRun the version check on pull requests +19/-0

Run the version check on pull requests

• Adds a pull-request-only Version bump job. It fetches full Git history and passes the pull request's base branch to the checker.

.github/workflows/build.yml

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Tip of the day
💡 Did you know, you can see how risky a PR is at a glance with blast radius labels

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@compot-dev
compot-dev merged commit 6178916 into master Oct 17, 2026
17 checks passed
@compot-dev
compot-dev deleted the ci/version-check branch October 17, 2026 20:29
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.

CI: require a version bump when code changes

1 participant