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 file permissions error in style-files pre-commit hook #244

Conversation

jeancochrane
Copy link
Contributor

@jeancochrane jeancochrane commented May 28, 2024

This PR fixes the intermittent errors we see in the style-files hook of the pre-commit workflow by setting require_serial to true for the hook our pre-commit config. This config value prevents pre-commit from running in parallel, which is the root cause of the error.

This change also has the nice side effect of decreasing the runtime of the hook. See here for a workflow run that times style-files when run in parallel (real clock time 5.6s) and here for a workflow run that times it when run serially (real clock time 2.4s). These timings are consistent with what I saw locally, so I think the numbers are solid. My guess is that we have few enough R files in the repo such that the overhead of forking the process outweighs the benefit of styling multiple files in parallel.

@jeancochrane jeancochrane marked this pull request as ready for review May 28, 2024 15:27
@jeancochrane
Copy link
Contributor Author

Tagging @wagnerlmichael in here in case you are interested in knowing more about this fix!

jeancochrane added a commit to ccao-data/assessr that referenced this pull request May 28, 2024
This PR implements the same change as ccao-data/model-res-avm#244 in order to fix the same bug in the `pre-commit` workflow. See that PR for more background on this change.

I didn't test timing for serial execution vs parallel execution in the same way that I did in ccao-data/model-res-avm#244 and ccao-data/model-condo-avm#49 since the results of those two PRs have me convinced that serial execution is likely better and at least no worse.
jeancochrane added a commit to ccao-data/assessr that referenced this pull request May 29, 2024
* Fix file permissions error in `style-files` pre-commit hook

This PR implements the same change as ccao-data/model-res-avm#244 in order to fix the same bug in the `pre-commit` workflow. See that PR for more background on this change.

I didn't test timing for serial execution vs parallel execution in the same way that I did in ccao-data/model-res-avm#244 and ccao-data/model-condo-avm#49 since the results of those two PRs have me convinced that serial execution is likely better and at least no worse.

* Update precommit R hooks to a more recent version
@jeancochrane jeancochrane merged commit 2e92c12 into master May 29, 2024
4 checks passed
@jeancochrane jeancochrane deleted the jeancochrane/fix-file-permissions-error-for-style-files-pre-commit-hook branch May 29, 2024 14:15
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.

None yet

2 participants