Skip to content

fix: use CLI flag default values instead of manual isset checks - #1099

Merged
kalbasit merged 1 commit into
mainfrom
fix-use-default-values-instead
Mar 17, 2026
Merged

kalbasit merged 1 commit into
mainfrom
fix-use-default-values-instead

Conversation

@kalbasit

Copy link
Copy Markdown
Owner

The serve command was checking !cmd.IsSet() for CDC lazy chunking flags
and manually setting defaults in code. This moves the defaults directly
into the CLI flag definitions using the Value field, making the code
cleaner and consistent with standard Go CLI patterns.

This also updates the Helm chart to default lazyChunkingEnabled to true
instead of null, ensuring the default is explicit in the values.yaml.

The serve command was checking !cmd.IsSet() for CDC lazy chunking flags
and manually setting defaults in code. This moves the defaults directly
into the CLI flag definitions using the Value field, making the code
cleaner and consistent with standard Go CLI patterns.

This also updates the Helm chart to default lazyChunkingEnabled to true
instead of null, ensuring the default is explicit in the values.yaml.
@kalbasit

Copy link
Copy Markdown
Owner Author

@dosubot dosubot Bot added size:S This PR changes 10-29 lines, ignoring generated files. enhancement New feature or request go Pull requests that update go code helm labels Mar 17, 2026
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request refactors the handling of default values for CDC lazy chunking configuration. Instead of relying on conditional checks within the application logic, default values are now directly embedded into the CLI flag definitions. This change simplifies the codebase, improves maintainability, and ensures that the application's behavior regarding lazy chunking is consistent with its declared CLI flags. Additionally, the Helm chart's default for lazy chunking has been made explicit, enhancing clarity for deployments.

Highlights

  • CLI Flag Defaults: The serve command now uses CLI flag default values directly for CDC lazy chunking flags, eliminating manual isset checks and aligning with standard Go CLI patterns.
  • Helm Chart Default: The Helm chart has been updated to explicitly set lazyChunkingEnabled to true in values.yaml, ensuring the default is clear and consistent.
Changelog
  • charts/ncps/tests/configmap_test.yaml
    • Updated a test case to assert that lazy-chunking-enabled: true is rendered by default, instead of asserting its absence.
  • charts/ncps/values.yaml
    • Changed the default value of lazyChunkingEnabled from null to true.
  • docs/docs/User Guide/Installation/Helm Chart/Chart Reference.md
    • Updated the documentation for config.cdc.lazyChunkingEnabled to reflect its default value as true.
  • pkg/ncps/serve.go
    • Added explicit Value fields to the cache-cdc-lazy-chunking-enabled and cache-cdc-background-workers CLI flag definitions.
    • Removed the manual !cmd.IsSet() checks and default value assignments for CDC lazy chunking flags.
Activity
  • No human activity has been recorded for this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request refactors how default values for CDC lazy chunking flags are handled in the serve command. Instead of manually checking if flags are set and applying defaults in the code, this change moves the default values directly into the CLI flag definitions using the Value field. This simplifies the code and aligns with standard Go CLI practices. The corresponding Helm chart and documentation have also been updated to reflect these changes, making the default behavior for lazyChunkingEnabled explicit. The changes are correct and improve code clarity and maintainability. I have no further comments.

@kalbasit
kalbasit enabled auto-merge (squash) March 17, 2026 03:50
@github-actions

Copy link
Copy Markdown
Contributor

@codecov

codecov Bot commented Mar 17, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 5.04%. Comparing base (6ef68f0) to head (d75574d).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@          Coverage Diff          @@
##            main   #1099   +/-   ##
=====================================
  Coverage   5.04%   5.04%           
=====================================
  Files          6       6           
  Lines        436     436           
=====================================
  Hits          22      22           
  Misses       410     410           
  Partials       4       4           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@kalbasit
kalbasit merged commit 9f8df6b into main Mar 17, 2026
20 checks passed
@kalbasit
kalbasit deleted the fix-use-default-values-instead branch March 17, 2026 04:01
kalbasit added a commit that referenced this pull request May 14, 2026
Lazy chunking was made the default in #1099, but enabling it
silently on upgrade is a behavior change: it starts background
workers, a cleanup cron job, and delays compressed NAR deletion
without user consent. Revert the default to false so users must
explicitly opt in.

Changes:
- pkg/ncps/serve.go: Value true->false, fix usage string
- charts/ncps/values.yaml: lazyChunkingEnabled true->false
- charts/ncps/tests/configmap_test.yaml: fix default assertion
- docs: update all references from default true to false

---------

Co-authored-by: Claude Sonnet 4.6 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request go Pull requests that update go code helm size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant