Repository navigation
Include git commit hash in version output for git checkouts - #3530
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev #3530 +/- ##
=====================================
+ Coverage 91% 91% +1%
=====================================
Files 463 463
Lines 49758 49811 +53
=====================================
+ Hits 44890 44942 +52
- Misses 4868 4869 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
📊 Performance Benchmark Report
📈 Detailed Results (All Benchmarks)
🎯 Performance Summary✅ No significant performance changes detected (all changes <10%) 🐍 Python Version 3.11.17 |
liquidsec
added a commit
that referenced
this pull request
Oct 17, 2026
en0f
approved these changes
Oct 19, 2026
Draft
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.
Closes #3520
When BBOT runs from a git checkout,
__version__is the staticversionfrompyproject.toml(currently3.0.2), so a dev checkout looks exactly like a release. Dev builds published to PyPI and Docker Hub already get a distinct version (e.g.3.0.2.123rc) from the CI version step, so this only affects editable installs.This adds
bbot.__full_version__, which appends the short commit hash when the package is inside a git checkout:3.0.23.0.2 (git:ac2cee8b0)3.0.2 (git:ac2cee8b0-dirty)The hash comes from a single
git describe --always --dirty --exclude=*call, which runs only when a.gitexists next to the package (a directory or, in worktrees, a file). If git is missing or fails, it falls back to__version__.__full_version__is used in the CLI banner,--version, the scan'sRan BBOT ...trace line indebug.log, and a newBBOT version: ...INFO line at the start of every scan, so it also ends up at the top ofscan.log.__version__is unchanged and still used for the User-Agent, the nmap XML output, and the deps installer cache key, where a commit hash would be wrong or would force a reinstall on every commit.