Skip to content

Fix Vale CI file scoping and remove dead eBPF tutorial link#2580

Merged
ctauchen merged 2 commits intotigera:mainfrom
ctauchen:vale-deadlink-fix
Mar 10, 2026
Merged

Fix Vale CI file scoping and remove dead eBPF tutorial link#2580
ctauchen merged 2 commits intotigera:mainfrom
ctauchen:vale-deadlink-fix

Conversation

@ctauchen
Copy link
Collaborator

Summary

  • Fix Vale CI workflow to pass changed files as a JSON array, avoiding getInput().trim() stripping the separator
  • Scope all Vale workflow steps to only run when changed files exist
  • Remove dead tigera.io/tutorials eBPF link from high-connection-workloads pages (4 files)

Test plan

  • Verify Vale CI runs only on changed .md/.mdx files, not the entire repo
  • Confirm the workflow skips cleanly when no markdown files are changed
  • Check high-connection-workloads pages render without the removed link

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings March 10, 2026 14:54
@ctauchen ctauchen requested a review from a team as a code owner March 10, 2026 14:54
@netlify
Copy link

netlify bot commented Mar 10, 2026

Deploy Preview succeeded!

Built without sensitive environment variables

Name Link
🔨 Latest commit f67332f
🔍 Latest deploy log https://app.netlify.com/projects/tigera/deploys/69b0314855d7f80008822972
😎 Deploy Preview https://deploy-preview-2580--tigera.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 89 (🟢 up 22 from production)
Accessibility: 98 (no change from production)
Best Practices: 92 (no change from production)
SEO: 100 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@netlify
Copy link

netlify bot commented Mar 10, 2026

Deploy Preview for calico-docs-preview-next ready!

Name Link
🔨 Latest commit f67332f
🔍 Latest deploy log https://app.netlify.com/projects/calico-docs-preview-next/deploys/69b031487007a90008eda5ab
😎 Deploy Preview https://deploy-preview-2580--calico-docs-preview-next.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Add separator: " " to the vale-action step so it correctly parses the
space-separated file list instead of falling back to scanning the entire
repo.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@ctauchen ctauchen force-pushed the vale-deadlink-fix branch from 0a37b5a to f67332f Compare March 10, 2026 14:57
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR makes two unrelated but useful improvements to the repository: it fixes the Vale CI workflow to scope linting to only changed .md/.mdx files (rather than the entire repo), and removes a dead tigera.io/tutorials eBPF workshop link from four high-connection-workloads.mdx documentation files across Calico OSS versions.

Changes:

  • Vale CI workflow (vale.yml) updated to detect changed markdown files, build a JSON array of them, skip all heavy steps when no markdown changed, and pass the file list to the Vale action and the ripgrep pre-processing step.
  • Dead eBPF/XDP tutorial link removed from high-connection-workloads.mdx across three versioned releases (3.29, 3.30, 3.31) and the unversioned (calico/) copy.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
.github/workflows/vale.yml Adds changed-file detection, skip logic, and scopes all steps to only run on changed markdown files
calico/network-policy/extreme-traffic/high-connection-workloads.mdx Removes dead eBPF/XDP tutorial link from unversioned docs
calico_versioned_docs/version-3.29/network-policy/extreme-traffic/high-connection-workloads.mdx Removes dead eBPF/XDP tutorial link from v3.29 docs
calico_versioned_docs/version-3.30/network-policy/extreme-traffic/high-connection-workloads.mdx Removes dead eBPF/XDP tutorial link from v3.30 docs
calico_versioned_docs/version-3.31/network-policy/extreme-traffic/high-connection-workloads.mdx Removes dead eBPF/XDP tutorial link from v3.31 docs

FILES=$(git diff --name-only --diff-filter=d ${{ github.event.pull_request.base.sha }}...${{ github.event.pull_request.head.sha }} -- '*.md' '*.mdx')
if [ -z "$FILES" ]; then
echo "skip=true" >> "$GITHUB_OUTPUT"
echo 'files=all' >> "$GITHUB_OUTPUT"
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When no markdown files are changed (skip=true), the code sets files=all on line 18. However, all subsequent steps that consume this output are gated on steps.changed.outputs.skip == 'false', so this value is never actually used. The string 'all' being stored as a fallback is misleading and potentially dangerous: if the skip condition ever fails to propagate correctly or is evaluated unexpectedly, the Vale action would receive files: all (a literal string, not a valid file path) rather than the intended JSON array, causing unpredictable behavior. The files=all line should simply be omitted from the skip=true branch since it serves no purpose.

Suggested change
echo 'files=all' >> "$GITHUB_OUTPUT"

Copilot uses AI. Check for mistakes.
run: |
sudo apt-get install ripgrep
FILES="${{ steps.changed.outputs.files }}"
FILES=$(echo '${{ steps.changed.outputs.files }}' | jq -r '.[]' | tr '\n' ' ')
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On line 43, ${{ steps.changed.outputs.files }} is interpolated directly into the run shell script. This is a GitHub Actions security anti-pattern: any content in that output is injected verbatim into the shell command before it is executed. While the files output is derived from git diff output (which in a pull_request event is determined by the branch's file paths), it is still best practice to pass step outputs via environment variables rather than direct expression interpolation in run scripts, to prevent shell injection. The value should be passed through an environment variable (e.g., env: FILES_JSON: ${{ steps.changed.outputs.files }}) and then referenced as $FILES_JSON in the shell.

Copilot uses AI. Check for mistakes.
Comment on lines +43 to 45
FILES=$(echo '${{ steps.changed.outputs.files }}' | jq -r '.[]' | tr '\n' ' ')
if [ -n "$FILES" ]; then
rg -l0 '\$\[[^\]]*\]' -- $FILES | xargs -0 perl -i -pe 's/\$\[[^\]]*\]/PICKLEVAR/g' || true
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On line 45, the $FILES variable is unquoted in the rg command. After tr '\n' ' ' converts newlines to spaces, the resulting space-separated list is word-split by the shell when passed to rg. If any filename contains spaces (or glob characters), it will be incorrectly split into multiple arguments, causing rg to fail or search the wrong paths. The variable should either be quoted or the file list should be processed in a way that preserves filenames with spaces (e.g., use readarray/null-delimited processing).

Suggested change
FILES=$(echo '${{ steps.changed.outputs.files }}' | jq -r '.[]' | tr '\n' ' ')
if [ -n "$FILES" ]; then
rg -l0 '\$\[[^\]]*\]' -- $FILES | xargs -0 perl -i -pe 's/\$\[[^\]]*\]/PICKLEVAR/g' || true
FILES=$(echo '${{ steps.changed.outputs.files }}' | jq -r '.[]')
if [ -n "$FILES" ]; then
printf '%s\n' "$FILES" | rg -l0 '\$\[[^\]]*\]' --files-from - | xargs -0 perl -i -pe 's/\$\[[^\]]*\]/PICKLEVAR/g' || true

Copilot uses AI. Check for mistakes.
@ctauchen ctauchen merged commit 1aa4002 into tigera:main Mar 10, 2026
10 of 11 checks passed
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.

2 participants