Add a repository dirtiness indicator to the auto-generated version information #3899
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.
Change Description
This change makes a small modification to the version auto-coder script
generate_version_info.py
to include the--dirty
flag when callinggit describe
. This will show whether a build has any un-committed changes in its repository or any of its dependencies.for example:
Rationale
This change is useful for an operator to see whether or not the binary that is running was built from a dirty repository or with dirty dependencies, and creates useful breadcrumbs in the version telemetry.
Testing/Review Recommendations
Should hopefully be straightforward to test, create a build from a clean repository and compare to a build created from a dirty repository.
Future Work
One thing to consider might be this note from the
git describe
manual:Is it worth supporting this functionality for a corrupt repository? If so, it might be useful to include the
--broken
flag in this command as well.