chore: check if build is dirty and fail#26172
Conversation
bf154ac to
03abf0b
Compare
jdstrand
left a comment
There was a problem hiding this comment.
Thanks! I think your testing is fine but if desired, you could adjust the check build is dirty step in build-dev to cat something to the README.md right before running git diff and give the job failure CircleCI url as a comment to this PR, then revert that change.
03abf0b to
476a209
Compare
That is a good idea - I can do that. |
476a209 to
28f0020
Compare
jdstrand
left a comment
There was a problem hiding this comment.
I see https://app.circleci.com/pipelines/github/influxdata/influxdb/44879/workflows/e3c22709-dfde-4e94-91c8-08203000b6a9/jobs/425044 appropriately failed. Nice! Approving.
This is to enable checking if build is dirty due to changes to git versioned file during the build process. This used to be reported in the
influxdb3 --versionwhich in turn was relying ongit describe. Because,revisionstring to contain-dirtyandgit describedoes more than just report the commit hash used to tag a releaseit was switched to use
git rev-parsein commit.Now with this PR, instead of reporting it's been dirtied the pipeline itself checks and stops the job if it detects any changes.
Test
Tested locally and checked if the script works by manually
sshing into circle ci instance and introducing changes.Given this relies on changes introduced during build this is the best I could come up with for testing it.
Update:
As per @jdstrand idea, I introduced a write before the
git diffcheck and you can see the build failure here,https://app.circleci.com/pipelines/github/influxdata/influxdb/44879/workflows/e3c22709-dfde-4e94-91c8-08203000b6a9/jobs/425044
The actual update to circleci config,