Conversation
MISP re-imports a galaxy only when its version is higher than the one an instance already holds, so content that changes without the version moving never reaches instances that have the old copy. Nothing warns about it, and it happens routinely: walking first-parent history and hashing each file's content with version removed (excluding the ~429 pure-reformat commits), 685 commits across 70 files changed content without bumping -- threat-actor 315, ransomware 76, tool 53, rat 29. Add tools/chk_version_bump.py, which diffs the working tree against a baseline revision and, for each changed cluster or galaxy, requires version to have strictly increased when the content (serialised with version removed) differs. It inspects only the files a change touches, so it never fails for history it did not cause -- no backfill and no permanently-red CI. Ignoring version during the comparison also means a version-only bump is not read as a content change, and a pure reformat does not demand one. The CI step runs it against the PR base branch, reading GITHUB_BASE_REF as an environment variable rather than interpolating it into the script, and checkout gains fetch-depth: 0 so the baseline is reachable. Verified across four cases: clean tree passes; content change without a bump fails with exit 1; the same change with a bump passes; a version-only bump passes with no false positive. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HZGwPoa8MMfkhCw47rDLA4
Member
Author
|
Note for merging: #1283 also adds a step to |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
BLUF — CI now requires a
versionbump whenever a cluster or galaxy's content changes in a PRversionis higher than the one an instance holds, but nothing here enforces that: 685 commits across 70 files changed content without bumpingversion, so those edits never reached instances with the old copy.tools/chk_version_bump.py, which re-serialises each changed file withversionremoved, compares it to the base branch and requires a strict increase when content differs, wired into.github/workflows/pytest.yml.versionon any content change to a cluster or galaxy, or the PR fails CI.Problem
MISP synchronises galaxies by
version: an instance only re-imports a file whose version is higher than the one it already holds. So content that changes without the version moving is committed here and never reaches any instance that already has the old copy — the edit is invisible everywhere it matters, and nothing warns about it.It happens routinely. Walking first-parent history and hashing each file's content with
versionremoved (so the ~429 pure-reformat commits are excluded):Fix
tools/chk_version_bump.pycompares the working tree against a baseline revision. For each changed cluster or galaxy it re-serialises the document withversionremoved and compares that against the baseline's; if the content differs,versionmust have strictly increased.Two properties keep it from being noisy:
versionwhen comparing content means a version-only bump is not mistaken for a content change, and a reformat that leaves content identical does not demand a bump.The CI step runs it against the PR's base branch.
GITHUB_BASE_REFis an Actions-provided branch name rather than user-authored text, and it is read as an environment variable rather than interpolated into the script.Verification
All four cases:
The workflow YAML parses and the step is ordered after
validate_all.sh.Note
Two clusters currently sit below a version they have already published (
tidal-software.jsonat 1 against a historic 2,nace.jsonat 2 against a historic 2.1), which this check cannot see because it only looks at the diff. That is fixed separately.🤖 Generated with Claude Code