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

Refactor global Jib config management #2996

Merged
merged 8 commits into from
Jan 15, 2021
Merged

Conversation

chanseokoh
Copy link
Member

@chanseokoh chanseokoh commented Jan 12, 2021

Refactored out the code from UpdateChecker that handles config.json but with some changes:

  • I am convinced that ATOMIC_MOVE is unnecessary, as @briandealwis pointed out in [gradle] Concurrency issue with many simultaneous builds #1273 (comment). For example, Files.move() is used to rename a file, and it cannot be that it will not do an atomic move when possible. Moreover, I think using ATOMIC_MOVE can actually be problematic, according to the Files.move() Javadoc. The behavior is implementation specific if a file already exists, where this code should deal with:

    ... all other options are ignored. If the target file exists then it is implementation specific if the existing file is replaced or this method fails by throwing an IOException.

  • Previously, any error from handling config.json was a warning and didn't cause a build to fail. Now we consider this as loading a global config, a build will fail if the code cannot load it.
  • Previously, UpdateChecker was always creating config.json.tmp and lastUpdateCheck.tmp. I think it's safer to create a fresh tmp file.

@chanseokoh
Copy link
Member Author

Updated the description. Ready for review.

@chanseokoh chanseokoh merged commit b9907fb into master Jan 15, 2021
@chanseokoh chanseokoh deleted the refactor-global-jib-config branch January 15, 2021 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants