-
Notifications
You must be signed in to change notification settings - Fork 53
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
add shellcheck, update pre-commit hooks #738
Conversation
The That'll be fixed (and CI unblocked here) once rapidsai/cuvs#750 is merged |
@@ -26,7 +24,7 @@ function sed_runner() { | |||
sed -i.bak ''"$1"'' $2 && rm -f ${2}.bak | |||
} | |||
|
|||
for FILE in $(find . -name Dockerfile); do | |||
find . -name Dockerfile | while IFS= read -r -d '' FILE; do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixes this from shellcheck
:
SC2044 (warning): For loops over find output are fragile. Use find -exec or a while read loop.
for notebook in nb_errors.keys(): | ||
if nb_errors[notebook]: | ||
print(f'Errors during {notebook}') | ||
for notebook_id, errors in nb_errors.items(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixes this from ruff
:
context/test_notebooks.py:200:9: PLC0206 Extracting value from dictionary without calling `.items()
context/test_notebooks.py
Outdated
@@ -35,6 +37,8 @@ | |||
'cuspatial/ZipCodes_Stops_PiP_cuSpatial.ipynb', | |||
# context on this being skipped: https://github.com/rapidsai/docker/issues/726 | |||
'cuspatial/trajectory_clustering.ipynb', | |||
# context on this being skipped: https://github.com/rapidsai/docker/issues/740 | |||
'cuspatial/Taxi_Dropoff_Reverse_Geocoding.ipynb', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seeing the one arm test job here fail with this error from
I think that's related to other ongoing jitify issues |
set -eEuo pipefail | ||
|
||
common_path="$(dirname "$(realpath "$0")")/common.sh" | ||
# shellcheck source=common.sh | ||
source "$common_path" | ||
|
||
cuvs_bench_source_tags=() | ||
cuvs_bench_datasets_source_tags=() | ||
# cuvs_bench_datasets_source_tags=() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This and other things I'm commenting out in this file are unused as long as this other code is commented out:
docker/ci/create-cuvs-multiarch-manifest.sh
Lines 27 to 28 in 5b40771
# check_tag_exists "$CUVS_BENCH_DATASETS_IMAGE_REPO" "$full_cuvs_bench_datasets_tag" | |
# cuvs_bench_datasets_source_tags+=("${org}/${CUVS_BENCH_DATASETS_IMAGE_REPO}:$full_cuvs_bench_datasets_tag") |
as it was in #725
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR mentioned in #725 as a patch was closed, but there is a comment that indicates this might have been fixed in 25.02, though it's unclear, see #723 (review)
Is there an issue or PR in progress tracking this? that we can reference so when it's fixed we can uncomment this back?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, I left a comment about the cuvs commented code. I wasn't able to find an issue or anything suggesting we should fix this, but I think ideally we should leave comment in code referencing an issue on why are we commenting this out.
set -eEuo pipefail | ||
|
||
common_path="$(dirname "$(realpath "$0")")/common.sh" | ||
# shellcheck source=common.sh | ||
source "$common_path" | ||
|
||
cuvs_bench_source_tags=() | ||
cuvs_bench_datasets_source_tags=() | ||
# cuvs_bench_datasets_source_tags=() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR mentioned in #725 as a patch was closed, but there is a comment that indicates this might have been fixed in 25.02, though it's unclear, see #723 (review)
Is there an issue or PR in progress tracking this? that we can reference so when it's fixed we can uncomment this back?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few nits, otherwise LGTM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we pin to SHAs of these actions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we want to switch from tags to SHAs, I think that'd be better done as a RAPIDS-wide thing and not in the scope of this PR.
I'd like to not have to worry, for this PR, about questions I have about that, such as how that'd affect auto-updates from dependabot
/ renovate
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've started a separate (private) discussion about switching to commit SHAs RAPIDS-wide. Let's defer the decision on that to the outcome of that discussion.
I'm going to merge this with these pinned to tags, as other actions in this repo's CI already are.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, just a few minor questions and changes.
Co-authored-by: Bradley Dice <[email protected]>
Co-authored-by: Bradley Dice <[email protected]>
/merge |
Contributes to #667
Expands testing to improve release confidence in these images.
pre-commit
hooks:rapidsai/verify-copyright
= keep copyright notices up to dateshellcheck
= catch issues and enforce consistency in shell scriptspre-commit
hooksrun:
topre-commit/[email protected]
in CI, for faster runs ofpre-commit
and simpler CI configuration