Skip to content

ci: check-version.sh compares with HEAD^1, counts build.yml as build, no-release label (#68, #69) - #71

Merged
compot-dev merged 2 commits into
masterfrom
uni-version-check
Oct 18, 2026
Merged

compot-dev merged 2 commits into
masterfrom
uni-version-check

Conversation

@compot-dev

@compot-dev compot-dev commented Oct 18, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #68. Closes #69.

.github/check-version.sh:

  • compares with HEAD^1, the base side of the pull request's merge commit, as OpenIPC/vtesse, OpenIPC/cerberus and OpenIPC/decoder do (was origin/$BASE);
  • counts .github/workflows/build.yml as build: a workflow edit that changes the build needs a new version like a change to ci/;
  • ignores Markdown files inside the code directories;
  • requires exactly one CAMEX_VERSION definition, however it is spaced (# define counts too), in the plain form the release job reads; checks the format only when the version changes;
  • NO_RELEASE=true (the no-release label) lets a change to the code or the build through without a new version when the release files stay the same, as in ci: a no-release label lets a change that keeps the binaries skip the version; review follow-ups cerberus#39.

The check moves from build.yml to a workflow of its own, .github/workflows/version.yml, which runs on labeled/unlabeled too and passes NO_RELEASE from the label: adding or removing a label re-runs only the check, not the builds. version.yml is CI and needs no new version; build.yml counts as build.

This pull request changes only the check and the workflow, so it carries no-release itself.

Checked locally in Docker (a scratch clone, 14 cases): a code change without a bump fails, with NO_RELEASE=true passes; a workflow-only change fails, with the label passes; Markdown under src/ and other .github/ files pass; a bump with its CHANGELOG section passes; a bump without one, a bad format (03.0.3), a lower version, two definitions (also as # define) and only a spaced definition fail; a version.yml change passes. shellcheck v0.10.0 clean; the workflow parses as YAML.

@compot-dev compot-dev added the no-release Changes the build or the code without changing the binaries: no new version, no release label Oct 18, 2026
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Summary by Qodo

Fix PR version checks and support the no-release label

🐞 Bug fix ✨ Enhancement ⚙️ Configuration changes 🕐 10-20 Minutes

Grey Divider

AI Description

• Compare against the merge commit’s base parent; count build workflow edits but exclude Markdown.
• Allow labeled no-release PRs to leave the version unchanged; retain release checks for bumps.
• Rerun the check when labels change and require one CAMEX_VERSION definition.
Diagram

graph TD
  A["PR events"] --> B["Merge checkout"] --> C["Version script"] --> D{"Version changed?"} -->|Yes| E["Release checks"] --> G["Check result"]
  D -->|No| F["Changes and label"] --> G
Loading
High-Level Assessment

The merge commit’s first parent gives this check a stable PR base, while a label provides an explicit exception for changes that do not warrant a release. Using the moving base ref or permanently exempting build-related paths would weaken those guarantees.

Files changed (2) +51 / -24

Enhancement (1) +41 / -19
check-version.shRefine version policy and add a no-release exception +41/-19

Refine version policy and add a no-release exception

• Counts build.yml as a build change, excludes Markdown within monitored paths, and requires one matching CAMEX_VERSION definition. Allows an unchanged version when NO_RELEASE=true, while applying format, ordering, and changelog checks when the version changes.

.github/check-version.sh

Other (1) +10 / -5
build.ymlRerun version checks on label changes +10/-5

Rerun version checks on label changes

• Adds labeled and unlabeled pull-request events so the check responds to no-release label changes. Passes the label state as NO_RELEASE and uses HEAD^1 as the script’s comparison base.

.github/workflows/build.yml

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

qodo-free-for-open-source-projects Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Remediation recommended

1. Any label change reruns the full build ✓ Resolved
Description
The new labeled and unlabeled triggers start the entire workflow, while only the version job
is restricted to pull requests and the build jobs have no label-event guard. Adding or removing any
label—not just no-release—schedules the build matrices, downloads, tests and artifact uploads; a
subsequent label change can cancel that work through the PR concurrency setting.
Code

.github/workflows/build.yml[21]

+    types: [opened, synchronize, reopened, labeled, unlabeled]
Evidence
The new event types apply to the whole workflow. Linux alone has four build legs, Android downloads
an NDK, and non-master runs cancel earlier runs on the same ref.

.github/workflows/build.yml[18-21]
.github/workflows/build.yml[29-32]
.github/workflows/build.yml[62-82]
.github/workflows/build.yml[168-182]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Label changes trigger every build and test job, not just the version check.
## Fix Focus Areas
- .github/workflows/build.yml[18-21]
- .github/workflows/build.yml[39-59]
- .github/workflows/build.yml[62-69]
## Recommended Fix
Run label-triggered version checks in a lightweight separate workflow, leaving the full build workflow triggered by code-related PR events.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. Extra version definitions evade the check ✓ Resolved
Description
ver counts only lines matching one exact #define CAMEX_VERSION "…" spelling, rather than
counting all version macro definitions. If a header also contains a valid directive such as `#
define CAMEX_VERSION "3.0.4"` after the matched line, the check accepts one definition even though
the compiled userspace version takes the later value and the release workflow reads the earlier one.
Code

.github/check-version.sh[R29-30]

+	v=$(sed -n 's/^#define CAMEX_VERSION "\([^"]*\)"[[:space:]]*$/\1/p')
+	if [ "$(printf '%s\n' "$v" | grep -c .)" -ne 1 ]; then
Evidence
The new anchored pattern misses whitespace between # and define. The userspace code prints the
preprocessed macro value, while the release step uses a separate extractor matching the original
spelling.

.github/check-version.sh[27-35]
src/version.h[12-19]
src/main.c[21-21]
src/main.c[57-60]
.github/workflows/build.yml[509-513]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The extractor ignores valid alternate spellings of version macro directives, allowing a second definition to escape the new count.
## Fix Focus Areas
- .github/check-version.sh[27-35]
## Recommended Fix
Count all preprocessing directives defining CAMEX_VERSION, allowing valid whitespace around `#` and `define`; require exactly one before extracting and validating its quoted value.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Tip of the day
💡 Did you know, you can move or hide resolved findings to focus on what still needs action

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

Comment thread .github/workflows/build.yml Outdated
Comment thread .github/check-version.sh Outdated
@compot-dev

Copy link
Copy Markdown
Collaborator Author

Review follow-ups, e933f1c:

  1. Label changes re-ran the full build: the version check moved to its own workflow, .github/workflows/version.yml, the only one that runs on labeled/unlabeled; build.yml keeps the default pull request events.
  2. Extra definitions: every #define CAMEX_VERSION now counts however it is spaced (# define too), and the one definition must be the plain #define CAMEX_VERSION "X.Y.Z" that the release job reads.

Checked locally in Docker on a scratch clone, 14 cases: a second # define and a spaced-only definition fail, a version.yml-only change passes, the earlier cases unchanged; shellcheck v0.10.0 clean, both workflows parse.

/review

@compot-dev
compot-dev merged commit 63412ea into master Oct 18, 2026
17 checks passed
@compot-dev
compot-dev deleted the uni-version-check branch October 18, 2026 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-release Changes the build or the code without changing the binaries: no new version, no release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Version check: workflow build steps and a no-release label check-version.sh: compare with HEAD^1 and skip Markdown, as in vtesse

1 participant