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

feature: Allow user to provide their own content hash to minimise IO operation #129

Merged
merged 7 commits into from
May 19, 2022

Conversation

fa93hws
Copy link
Contributor

@fa93hws fa93hws commented May 18, 2022

closing #107

User now can provide an optional argument --contentHashFilepath. It is required to be a json format file with the following shape:

{
  "web/src/pages/login/button/button.tsx": "891ad1e682a7e6538603291963d62740f8fce4244771f66b1f977ad546e88868",
  "foo-services/src/java/com/xx/foo.java": "c09a57550d151625ea9d8d9ffb0344f16f243c74fb4770dcee6a530a14cb5cb5"
}

File path in the file will be relative path from workpsace.

During content hashing phase, if the file is in the map, no IO work will be performed, content hash from the JSON file will be used instead. Otherwise, the existing solution will apply.

N.B. Most of the LOC comes from unit test

Comment on lines +38 to +40
val filenamePath = filenameSubstring.replaceFirst(
":".toRegex(),
if (filenameSubstring.startsWith(":")) "" else "/"
Copy link
Contributor Author

@fa93hws fa93hws May 18, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We want //:foo/bar to be foo/bar instead of /foo/bar.

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