Skip to content

DOCS-3043: Add override mechanism for known-stale upstream Felix config doc text - #3019

Merged
ctauchen merged 3 commits into
tigera:mainfrom
ctauchen:DOCS-3043-felix-config-overrides
Sep 9, 2026
Merged

ctauchen merged 3 commits into
tigera:mainfrom
ctauchen:DOCS-3043-felix-config-overrides

Conversation

@ctauchen

@ctauchen ctauchen commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

FlowLogsDynamicAggregationEnabled has always defaulted to false in Felix, but the doc comment feeding config-params.json said "Default is true." on every release branch -- a table-vs-prose contradiction visible on the live reference page. tigera/calico-private#12538 fixed the comment on master only, incidental to unrelated fluentd-removal work, and it was never backported to any release branch.

This adds a small, reusable mechanism so update-felix-config.sh can patch known upstream doc-text bugs like this at sync time, instead of silently re-importing them on every run:

  • scripts/felix-config-overrides.json: known upstream doc-text bugs, keyed by NameConfigFile
  • scripts/patch-felix-config-overrides.sh: jq-based, field-scoped patch that also warns if an override becomes a no-op (upstream already fixed it) or stale (upstream reworded it differently) -- both signal it's safe to review/remove
  • Wired into the shared update_felix_config() function, right before the file replaces the checked-in copy

Also applies the fix now to every currently-published version that has it (CE 3.21-2 through 3.24-2, CC 23-2, and CC/CE "next").

Separately (DOCS-3043 doesn't cover this): the one-line comment fix needs to be cherry-picked from calico-private master into release-calient-v3.24-1, release-calient-v3.24, and other active branches, so this override eventually becomes unnecessary.

Jira: https://tigera.atlassian.net/browse/DOCS-3043

Preview (once it builds): https://deploy-preview-3019--tigera.netlify.app/calico-enterprise/latest/reference/resources/felixconfig#flowLogsDynamicAggregationEnabled

…ig doc text

FlowLogsDynamicAggregationEnabled has always defaulted to false in Felix,
but the doc comment feeding config-params.json said "Default is true."
on every release branch. calico-private#12538 fixed the comment on
master only, incidental to unrelated fluentd-removal work, and it was
never backported.

Add scripts/felix-config-overrides.json (known upstream doc-text bugs,
keyed by NameConfigFile) and scripts/patch-felix-config-overrides.sh
(jq-based, field-scoped patch that warns when an override becomes a
no-op or stale), wired into update_felix_config() so every future sync
patches it consistently. Apply it now to fix the currently-published
files.
Copilot AI lite review requested due to automatic review settings September 9, 2026 11:29
@ctauchen
ctauchen requested a review from a team as a code owner September 9, 2026 11:29
@netlify

netlify Bot commented Sep 9, 2026

Copy link
Copy Markdown

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

Name Link
🔨 Latest commit 52bc0c7
🔍 Latest deploy log https://app.netlify.com/projects/calico-docs-preview-next/deploys/6aa172cfa7895e0009d7f433
😎 Deploy Preview https://deploy-preview-3019--calico-docs-preview-next.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

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

@netlify

netlify Bot commented Sep 9, 2026

Copy link
Copy Markdown

Deploy Preview succeeded!

Built without sensitive environment variables

Name Link
🔨 Latest commit 52bc0c7
🔍 Latest deploy log https://app.netlify.com/projects/tigera/deploys/6aa172cff63a0a00080d9612
😎 Deploy Preview https://deploy-preview-3019--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: 72 (🟢 up 7 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
🤖 Make changes Run an agent on this branch

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The new override patch script needs small robustness fixes (argument/target validation and ensuring jq failures propagate correctly) before it’s safe to rely on during sync.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR introduces a small, reusable override mechanism to correct known-stale upstream Felix config documentation text during sync, preventing incorrect prose from being re-imported into config-params.json on every update.

Changes:

  • Wire an override patch step into scripts/update-felix-config.sh immediately before replacing the checked-in config-params.json.
  • Add scripts/patch-felix-config-overrides.sh (jq-based, field/key-scoped patching + reporting) and scripts/felix-config-overrides.json (override definitions keyed by NameConfigFile).
  • Apply the corrected default text for FlowLogsDynamicAggregationEnabled across the currently published CE/CC versions affected.
File summaries
File Description
scripts/update-felix-config.sh Runs the override patcher on the freshly downloaded JSON before moving it into place.
scripts/patch-felix-config-overrides.sh Implements field/key-scoped override application and emits warnings/notices about override status.
scripts/felix-config-overrides.json Declares the known-stale upstream doc-text override(s) keyed by NameConfigFile.
calico-enterprise_versioned_docs/version-3.24-2/_includes/components/FelixConfig/config-params.json Fixes the incorrect “Default is true.” prose to “Default is false.” for the affected field.
calico-enterprise_versioned_docs/version-3.24-1/_includes/components/FelixConfig/config-params.json Same doc-text correction for this published version.
calico-enterprise_versioned_docs/version-3.23-2/_includes/components/FelixConfig/config-params.json Same doc-text correction for this published version.
calico-enterprise_versioned_docs/version-3.22-2/_includes/components/FelixConfig/config-params.json Same doc-text correction for this published version.
calico-enterprise_versioned_docs/version-3.21-2/_includes/components/FelixConfig/config-params.json Same doc-text correction for this published version.
calico-cloud/_includes/components/FelixConfig/config-params.json Same doc-text correction for “next” (unversioned) Cloud docs.
calico-cloud_versioned_docs/version-23-2/_includes/components/FelixConfig/config-params.json Same doc-text correction for the published Cloud version.
Review details

Suppressed comments (1)

scripts/patch-felix-config-overrides.sh:51

  • With set -e, failures inside process substitution (done < <(jq ...)) don't reliably terminate the script, which can hide problems generating the report. Feeding the loop with a here-string from command substitution makes jq failures propagate correctly.
done < <(jq -r --slurpfile overrides "$OVERRIDES_FILE" '
    $overrides[0] as $ovs
    | [ .Groups[].Fields[] as $f
        | $ovs[] as $ov
        | select($ov.field == $f.NameConfigFile)
  • Files reviewed: 10/10 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread scripts/patch-felix-config-overrides.sh
Addresses Copilot review feedback on PR 3019: a missing or non-JSON
target previously surfaced as a raw jq error instead of a clear one.
Copilot AI review requested due to automatic review settings September 9, 2026 14:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The sync-time override mechanism and the versioned doc updates are straightforward and low-risk, with only a minor maintainability suggestion outstanding.

Review details

Suppressed comments (1)

Previously missed (1) — in code that hasn't changed since the last review.

scripts/patch-felix-config-overrides.sh:49

  • The override reporting/apply logic only iterates over overrides that match a NameConfigFile present in the target JSON. If an override’s field is renamed/removed upstream (or otherwise not present), it becomes silently ignored, which makes it easy to miss that an override is now obsolete or misconfigured. Add an explicit warning for override entries whose field does not exist in the target JSON.
  • Files reviewed: 10/10 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

Two issues from an independent review of PR 3019:

- The diagnostics jq ran inside a process substitution consumed by a
  while-read loop; under set -e a failure there was silently swallowed
  instead of aborting the script.
- The diagnostics pass and the apply pass were two separately-written
  jq programs (one comparing against the pristine field, the other
  folding patches through a reduce accumulator). They agree today, but
  nothing enforced that as more overrides accumulate over time.

Replaced both with a single jq invocation that computes each patch's
status against the original document once, and applies exactly those
decisions -- so the notices and the applied document share one source
of truth and can't disagree, and the target file is only parsed once.
Copilot AI review requested due to automatic review settings September 9, 2026 14:53

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The functional changes are straightforward and the only issue found is a minor misleading comment in the new patch script.

Review details
  • Files reviewed: 10/10 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment on lines +49 to +52
# --- Decide every patch's status against the ORIGINAL document, once, then apply exactly
# those decisions. The notices and the applied document come from the same "ops" list
# inside a single jq invocation, so they cannot disagree with each other, and the
# (multi-thousand-line) target file is only parsed once. ---
@ctauchen
ctauchen merged commit 5ae6e05 into tigera:main Sep 9, 2026
11 checks passed
@ctauchen

ctauchen commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator Author

CC @hjiawei

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