Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the moddate for go-bindata to prevent diffs #2756

Merged
merged 1 commit into from Oct 2, 2019

Conversation

@reggieriser
Copy link
Contributor

commented Oct 1, 2019

Description

Now that we've put generated code under source control (see #2697), the pkg/assets/assets.go file can have diffs after a clean build on a machine other than the one it was committed on. This is due to the fact that the timestamps of the assets being recorded in assets.go could be different on every developer machine depending on when the project was cloned.

This PR uses the -modtime option of go-bindata to fix the timestamp to a time from earlier today. That way, the time will stay fixed on every generation regardless of the actual timestamp on the asset file, so no diffs should occur.

Reviewer Notes

I don't believe we have any code that relies on the timestamp of the asset for anything, but I'm going to tag a few people who I see as committers on asset-related code for their insight.

Setup

make clean server_build, then do a git status to verify that there are no local modifications to any files under source control.

Code Review Verification Steps

  • Request review from a member of a different team.
Copy link
Contributor

left a comment

🚀

@gidjin

This comment has been minimized.

Copy link
Contributor

commented Oct 1, 2019

Nice find, the docs https://godoc.org/github.com/shuLhan/go-bindata seem to imply there is a NoMetadata flag can we use that instead of a random time?

Copy link
Contributor

left a comment

:shipit: was wondering about some of this on my own branch. Awesome catch.

@reggieriser

This comment has been minimized.

Copy link
Contributor Author

commented Oct 2, 2019

Nice find, the docs https://godoc.org/github.com/shuLhan/go-bindata seem to imply there is a NoMetadata flag can we use that instead of a random time?

I had explored the -nometadata flag too but it zeros out the file size and file mode in addition to the modtime. I went with -modtime since it kept those the first two so seemed a little less risky.

BTW, the fork of go-bindata that we're using (assuming you're installing it via homebrew) is https://github.com/kevinburke/go-bindata .

@reggieriser reggieriser merged commit dfd5b08 into master Oct 2, 2019
17 checks passed
17 checks passed
ci/circleci: acceptance_tests_experimental Your tests passed on CircleCI!
Details
ci/circleci: acceptance_tests_local Your tests passed on CircleCI!
Details
ci/circleci: acceptance_tests_staging Your tests passed on CircleCI!
Details
ci/circleci: build_app Your tests passed on CircleCI!
Details
ci/circleci: build_migrations Your tests passed on CircleCI!
Details
ci/circleci: build_tasks Your tests passed on CircleCI!
Details
ci/circleci: build_tools Your tests passed on CircleCI!
Details
ci/circleci: check_generated_code Your tests passed on CircleCI!
Details
ci/circleci: client_test Your tests passed on CircleCI!
Details
ci/circleci: integration_tests Your tests passed on CircleCI!
Details
ci/circleci: pre_deps_golang Your tests passed on CircleCI!
Details
ci/circleci: pre_deps_yarn Your tests passed on CircleCI!
Details
ci/circleci: pre_test Your tests passed on CircleCI!
Details
ci/circleci: server_test Your tests passed on CircleCI!
Details
ci/circleci: server_test_coverage Your tests passed on CircleCI!
Details
codecov/patch/go Coverage not affected when comparing 2650719...ccf524e
Details
codecov/project/go 57.3% remains the same compared to 2650719
Details
@reggieriser reggieriser deleted the rr-set-modtime-go-bindata branch Oct 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
4 participants
You can’t perform that action at this time.