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

ci: fix file parsing in conditional-skip script #21343

Merged
merged 1 commit into from
Jun 18, 2024

Conversation

zalimeni
Copy link
Member

@zalimeni zalimeni commented Jun 17, 2024

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 and consul-k8s for clarity.

PR Checklist

  • updated test coverage
  • external facing docs updated
  • appropriate backport labels added
  • not a security concern

@zalimeni zalimeni added pr/no-changelog PR does not need a corresponding .changelog entry backport/all Apply backports for all active releases per .release/versions.hcl labels Jun 17, 2024
@github-actions github-actions bot added type/ci Relating to continuous integration (CI) tooling for testing or releases theme/contributing Additions and enhancements to community contributing materials labels Jun 17, 2024
for dir in "${skipped_directories[@]}"; do
if [[ "$file_to_check" == "$dir"* ]] || [[ "$file_to_check" == *.md && "$dir" == *"/" ]]; then
Copy link
Member Author

@zalimeni zalimeni Jun 17, 2024

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.

.github/scripts/check_skip_ci.sh Show resolved Hide resolved
Comment on lines +22 to +23
files_to_check_array=($files_to_check)
for file_to_check in "${files_to_check_array[@]}"; do
Copy link
Member Author

@zalimeni zalimeni Jun 17, 2024

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.
@zalimeni zalimeni force-pushed the zalimeni/fix-skip-ci-script-array-parse branch from 42ca78d to a9ce440 Compare June 17, 2024 16:43
@zalimeni zalimeni merged commit 830d1bf into main Jun 18, 2024
82 checks passed
@zalimeni zalimeni deleted the zalimeni/fix-skip-ci-script-array-parse branch June 18, 2024 19:38
@hc-github-team-consul-core hc-github-team-consul-core added backport/1.19 This release series is longer active on CE, use backport/ent/1.19 backport/ent/1.17 This release series is longer active on CE or Ent backport/ent/1.15 Changes are backported to 1.15 ent backport/ent/1.18 Changes are backported to 1.18 ent labels Jun 18, 2024
@hc-github-team-consul-core
Copy link
Collaborator

@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:

<details>
	<summary> Overview of commits </summary>
		- <<backport commit 1>>
		- <<backport commit 2>>
		...
</details>

6 similar comments
@hc-github-team-consul-core
Copy link
Collaborator

@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:

<details>
	<summary> Overview of commits </summary>
		- <<backport commit 1>>
		- <<backport commit 2>>
		...
</details>

@hc-github-team-consul-core
Copy link
Collaborator

@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:

<details>
	<summary> Overview of commits </summary>
		- <<backport commit 1>>
		- <<backport commit 2>>
		...
</details>

@hc-github-team-consul-core
Copy link
Collaborator

@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:

<details>
	<summary> Overview of commits </summary>
		- <<backport commit 1>>
		- <<backport commit 2>>
		...
</details>

@hc-github-team-consul-core
Copy link
Collaborator

@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:

<details>
	<summary> Overview of commits </summary>
		- <<backport commit 1>>
		- <<backport commit 2>>
		...
</details>

@hc-github-team-consul-core
Copy link
Collaborator

@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:

<details>
	<summary> Overview of commits </summary>
		- <<backport commit 1>>
		- <<backport commit 2>>
		...
</details>

@hc-github-team-consul-core
Copy link
Collaborator

@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:

<details>
	<summary> Overview of commits </summary>
		- <<backport commit 1>>
		- <<backport commit 2>>
		...
</details>

@hc-github-team-consul-core
Copy link
Collaborator

@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:

<details>
	<summary> Overview of commits </summary>
		- <<backport commit 1>>
		- <<backport commit 2>>
		...
</details>

4 similar comments
@hc-github-team-consul-core
Copy link
Collaborator

@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:

<details>
	<summary> Overview of commits </summary>
		- <<backport commit 1>>
		- <<backport commit 2>>
		...
</details>

@hc-github-team-consul-core
Copy link
Collaborator

@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:

<details>
	<summary> Overview of commits </summary>
		- <<backport commit 1>>
		- <<backport commit 2>>
		...
</details>

@hc-github-team-consul-core
Copy link
Collaborator

@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:

<details>
	<summary> Overview of commits </summary>
		- <<backport commit 1>>
		- <<backport commit 2>>
		...
</details>

@hc-github-team-consul-core
Copy link
Collaborator

@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:

<details>
	<summary> Overview of commits </summary>
		- <<backport commit 1>>
		- <<backport commit 2>>
		...
</details>

@hc-github-team-consul-core
Copy link
Collaborator

@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:

<details>
	<summary> Overview of commits </summary>
		- <<backport commit 1>>
		- <<backport commit 2>>
		...
</details>

2 similar comments
@hc-github-team-consul-core
Copy link
Collaborator

@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:

<details>
	<summary> Overview of commits </summary>
		- <<backport commit 1>>
		- <<backport commit 2>>
		...
</details>

@hc-github-team-consul-core
Copy link
Collaborator

@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:

<details>
	<summary> Overview of commits </summary>
		- <<backport commit 1>>
		- <<backport commit 2>>
		...
</details>

@zalimeni zalimeni added backport/ent/1.17 This release series is longer active on CE or Ent backport/ent/1.15 Changes are backported to 1.15 ent backport/ent/1.18 Changes are backported to 1.18 ent and removed backport/ent/1.17 This release series is longer active on CE or Ent backport/ent/1.15 Changes are backported to 1.15 ent backport/ent/1.18 Changes are backported to 1.18 ent labels Jul 30, 2024
@hc-github-team-consul-core
Copy link
Collaborator

@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:

<details>
	<summary> Overview of commits </summary>
		- <<backport commit 1>>
		- <<backport commit 2>>
		...
</details>

@zalimeni zalimeni added backport/ent/1.17 This release series is longer active on CE or Ent backport/ent/1.15 Changes are backported to 1.15 ent backport/ent/1.18 Changes are backported to 1.18 ent and removed backport/ent/1.17 This release series is longer active on CE or Ent backport/ent/1.15 Changes are backported to 1.15 ent backport/ent/1.18 Changes are backported to 1.18 ent labels Jul 31, 2024
@NiniOak NiniOak removed their request for review July 31, 2024 19:00
@hc-github-team-consul-core
Copy link
Collaborator

@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:

<details>
	<summary> Overview of commits </summary>
		- <<backport commit 1>>
		- <<backport commit 2>>
		...
</details>

6 similar comments
@hc-github-team-consul-core
Copy link
Collaborator

@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:

<details>
	<summary> Overview of commits </summary>
		- <<backport commit 1>>
		- <<backport commit 2>>
		...
</details>

@hc-github-team-consul-core
Copy link
Collaborator

@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:

<details>
	<summary> Overview of commits </summary>
		- <<backport commit 1>>
		- <<backport commit 2>>
		...
</details>

@hc-github-team-consul-core
Copy link
Collaborator

@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:

<details>
	<summary> Overview of commits </summary>
		- <<backport commit 1>>
		- <<backport commit 2>>
		...
</details>

@hc-github-team-consul-core
Copy link
Collaborator

@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:

<details>
	<summary> Overview of commits </summary>
		- <<backport commit 1>>
		- <<backport commit 2>>
		...
</details>

@hc-github-team-consul-core
Copy link
Collaborator

@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:

<details>
	<summary> Overview of commits </summary>
		- <<backport commit 1>>
		- <<backport commit 2>>
		...
</details>

@hc-github-team-consul-core
Copy link
Collaborator

@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:

<details>
	<summary> Overview of commits </summary>
		- <<backport commit 1>>
		- <<backport commit 2>>
		...
</details>

@hc-github-team-consul-core
Copy link
Collaborator

@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:

<details>
	<summary> Overview of commits </summary>
		- <<backport commit 1>>
		- <<backport commit 2>>
		...
</details>

1 similar comment
@hc-github-team-consul-core
Copy link
Collaborator

@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:

<details>
	<summary> Overview of commits </summary>
		- <<backport commit 1>>
		- <<backport commit 2>>
		...
</details>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/all Apply backports for all active releases per .release/versions.hcl backport/ent/1.15 Changes are backported to 1.15 ent backport/ent/1.17 This release series is longer active on CE or Ent backport/ent/1.18 Changes are backported to 1.18 ent backport/1.19 This release series is longer active on CE, use backport/ent/1.19 pr/no-changelog PR does not need a corresponding .changelog entry theme/contributing Additions and enhancements to community contributing materials type/ci Relating to continuous integration (CI) tooling for testing or releases
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants