-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
ci: fix file parsing in conditional-skip script #21343
Conversation
for dir in "${skipped_directories[@]}"; do | ||
if [[ "$file_to_check" == "$dir"* ]] || [[ "$file_to_check" == *.md && "$dir" == *"/" ]]; then |
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.
Note: I've removed the && "$dir" == *"/"
bit from this .md
check, as I don't think it had any functional impact (all of the skipped directories end in /
, and those are already skipped on their own without regard to file type). consul-dataplane
and consul-k8s
seem to be working without it.
files_to_check_array=($files_to_check) | ||
for file_to_check in "${files_to_check_array[@]}"; 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.
This bit parses the git diff
output into an array so we can iterate through each file individually:
# Before
bash-3.2$ export SKIP_CHECK_BRANCH=main
bash-3.2$ files_to_check=$(git diff --name-only "$(git merge-base origin/$SKIP_CHECK_BRANCH HEAD~)"...HEAD)
bash-3.2$ for file_to_check in "${files_to_check[@]}"; do echo "file: $file_to_check"; done
file: .github/scripts/check_skip_ci.sh
.github/workflows/go-tests.yml
.github/workflows/security-scan.yml
.github/workflows/test-integrations.yml
README.md
agent/acl_ce.go
# After
bash-3.2$ files_to_check_array=($files_to_check)
bash-3.2$ for file_to_check in "${files_to_check_array[@]}"; do echo "file: $file_to_check"; done
file: .github/scripts/check_skip_ci.sh
file: .github/workflows/go-tests.yml
file: .github/workflows/security-scan.yml
file: .github/workflows/test-integrations.yml
file: README.md
file: agent/acl_ce.go
Ensure files are split rather than compared as a single list for accuracy and easier debugging. Also adopt minor changes and file name from introduction of similar check `consul-dataplane` and `consul-k8s` for clarity.
42ca78d
to
a9ce440
Compare
@zalimeni, a backport is missing for this PR [21343] for versions [1.15] please perform the backport manually and add the following snippet to your backport PR description:
|
6 similar comments
@zalimeni, a backport is missing for this PR [21343] for versions [1.15] please perform the backport manually and add the following snippet to your backport PR description:
|
@zalimeni, a backport is missing for this PR [21343] for versions [1.15] please perform the backport manually and add the following snippet to your backport PR description:
|
@zalimeni, a backport is missing for this PR [21343] for versions [1.15] please perform the backport manually and add the following snippet to your backport PR description:
|
@zalimeni, a backport is missing for this PR [21343] for versions [1.15] please perform the backport manually and add the following snippet to your backport PR description:
|
@zalimeni, a backport is missing for this PR [21343] for versions [1.15] please perform the backport manually and add the following snippet to your backport PR description:
|
@zalimeni, a backport is missing for this PR [21343] for versions [1.15] please perform the backport manually and add the following snippet to your backport PR description:
|
@zalimeni, a backport is missing for this PR [21343] for versions [1.15,1.16,1.18] please perform the backport manually and add the following snippet to your backport PR description:
|
4 similar comments
@zalimeni, a backport is missing for this PR [21343] for versions [1.15,1.16,1.18] please perform the backport manually and add the following snippet to your backport PR description:
|
@zalimeni, a backport is missing for this PR [21343] for versions [1.15,1.16,1.18] please perform the backport manually and add the following snippet to your backport PR description:
|
@zalimeni, a backport is missing for this PR [21343] for versions [1.15,1.16,1.18] please perform the backport manually and add the following snippet to your backport PR description:
|
@zalimeni, a backport is missing for this PR [21343] for versions [1.15,1.16,1.18] please perform the backport manually and add the following snippet to your backport PR description:
|
@zalimeni, a backport is missing for this PR [21343] for versions [1.15,1.16,1.18] please perform the backport manually and add the following snippet to your backport PR description:
|
2 similar comments
@zalimeni, a backport is missing for this PR [21343] for versions [1.15,1.16,1.18] please perform the backport manually and add the following snippet to your backport PR description:
|
@zalimeni, a backport is missing for this PR [21343] for versions [1.15,1.16,1.18] please perform the backport manually and add the following snippet to your backport PR description:
|
@zalimeni, a backport is missing for this PR [21343] for versions [1.15,1.16,1.18] please perform the backport manually and add the following snippet to your backport PR description:
|
@zalimeni, a backport is missing for this PR [21343] for versions [1.15,1.16,1.18] please perform the backport manually and add the following snippet to your backport PR description:
|
6 similar comments
@zalimeni, a backport is missing for this PR [21343] for versions [1.15,1.16,1.18] please perform the backport manually and add the following snippet to your backport PR description:
|
@zalimeni, a backport is missing for this PR [21343] for versions [1.15,1.16,1.18] please perform the backport manually and add the following snippet to your backport PR description:
|
@zalimeni, a backport is missing for this PR [21343] for versions [1.15,1.16,1.18] please perform the backport manually and add the following snippet to your backport PR description:
|
@zalimeni, a backport is missing for this PR [21343] for versions [1.15,1.16,1.18] please perform the backport manually and add the following snippet to your backport PR description:
|
@zalimeni, a backport is missing for this PR [21343] for versions [1.15,1.16,1.18] please perform the backport manually and add the following snippet to your backport PR description:
|
@zalimeni, a backport is missing for this PR [21343] for versions [1.15,1.16,1.18] please perform the backport manually and add the following snippet to your backport PR description:
|
@zalimeni, a backport is missing for this PR [21343] for versions [1.15,1.17,1.19] please perform the backport manually and add the following snippet to your backport PR description:
|
1 similar comment
@zalimeni, a backport is missing for this PR [21343] for versions [1.15,1.17,1.19] please perform the backport manually and add the following snippet to your backport PR description:
|
Ensure files are split rather than compared as a single list for accuracy and easier debugging. This was sneaky and it took me a while to notice even after testing some other changes!
Also adopt minor changes and file name from introduction of similar check
consul-dataplane
andconsul-k8s
for clarity.PR Checklist