Skip to content

fix(ci): read version for merge commit message from .bitmap instead of npm - #10641

Merged
davidfirst merged 1 commit into
masterfrom
fix-merge-commit-message-version
Aug 20, 2026
Merged

fix(ci): read version for merge commit message from .bitmap instead of npm#10641
davidfirst merged 1 commit into
masterfrom
fix-merge-commit-message-version

Conversation

@davidfirst

Copy link
Copy Markdown
Member

The merge commit message often showed the version of the previous release.

The script read the version from the npm registry. The registry data can stay old for some minutes after a publish. Because of this delay, the script got the old version.

Now the script reads the version of teambit.harmony/bit from the .bitmap file. At commit time, this file already contains the new version. Thus the message always agrees with the committed data, and no network call is necessary. If the file read fails, the script uses the fallback message as before.

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

Copy link
Copy Markdown

PR Summary by Qodo

Use .bitmap version in CI merge commit messages

🐞 Bug fix 🕐 Less than 10 minutes

Grey Divider

AI Description

• Read release versions from committed .bitmap instead of the eventually consistent npm registry.
• Preserve fallback commit messaging when .bitmap parsing or version lookup fails.
Diagram

graph TD
  CI["bit ci merge"] --> Script["Message script"] --> Read["Read .bitmap"] --> Valid{"Valid bit version?"}
  Valid -- Yes --> Versioned["Versioned message"]
  Valid -- No --> Fallback["Fallback message"]
Loading
High-Level Assessment

The PR's approach is appropriate because .bitmap is already committed with the release version when the merge message is generated, avoiding npm registry propagation delays and a network dependency. Continuing to query npm was rejected due to eventual consistency, while retaining the existing fallback safely handles malformed or unavailable local metadata.

Files changed (1) +11 / -4

Bug fix (1) +11 / -4
generate-merge-commit-message.jsRead merge commit version from .bitmap +11/-4

Read merge commit version from .bitmap

• Replaces the npm registry query with local '.bitmap' parsing and reads the 'bit.version' field after removing block comments. It validates the version before generating the release message and retains the existing fallback for read, parse, or lookup failures.

scripts/generate-merge-commit-message.js

@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 copy the agent prompt from any finding and feed it to your IDE agent

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@davidfirst
davidfirst enabled auto-merge (squash) August 20, 2026 12:02
@davidfirst
davidfirst merged commit 0eebefc into master Aug 20, 2026
16 checks passed
@davidfirst
davidfirst deleted the fix-merge-commit-message-version branch August 20, 2026 12:02
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