Skip to content

feat: add fsck CronJob to Helm Chart - #999

Merged
kalbasit merged 1 commit into
mainfrom
02-28-feat_add_fsck_cronjob_to_helm_chart
Mar 1, 2026
Merged

kalbasit merged 1 commit into
mainfrom
02-28-feat_add_fsck_cronjob_to_helm_chart

Conversation

@kalbasit

@kalbasit kalbasit commented Mar 1, 2026

Copy link
Copy Markdown
Owner

Added a CronJob to the Helm chart to run periodic integrity checks (fsck). This allows users to automate the consistency checks between the database and storage.

The implementation includes:

  • New 'fsck' section in values.yaml with comprehensive configuration options.
  • Added JSON schema validation for all new fsck fields in values.schema.json.
  • Created a new fsck-cronjob.yaml template that uses 'ncps fsck' with configurable '--repair' and '--verified-since' flags.
  • Added a full suite of unit tests in fsck_cronjob_test.yaml to verify template rendering.

Verification:

  • All 98 helm-unittest cases passed.
  • Manual template rendering verified correct flag propagation and default behavior (disabled by default).

@dosubot dosubot Bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Mar 1, 2026
@dosubot dosubot Bot added enhancement New feature or request helm labels Mar 1, 2026

kalbasit commented Mar 1, 2026 •

Copy link
Copy Markdown
Owner Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@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 enhances the Helm chart by integrating a new fsck CronJob, enabling automated periodic integrity checks between the database and storage. This feature provides users with robust tools to maintain data consistency, offering extensive configuration options and ensuring proper deployment through comprehensive testing.

Highlights

  • New fsck CronJob: Added a new fsck CronJob to the Helm chart, enabling automated periodic integrity checks for the database and storage.
  • Comprehensive Configuration: Introduced a dedicated fsck section in values.yaml with extensive configuration options for scheduling, repair, and resource management.
  • JSON Schema Validation: Implemented JSON schema validation for all new fsck related fields in values.schema.json to ensure proper configuration.
  • Configurable fsck Template: Created a new fsck-cronjob.yaml template that utilizes ncps fsck with configurable --repair and --verified-since flags.
  • Unit Test Coverage: Developed a full suite of unit tests in fsck_cronjob_test.yaml to verify the correct rendering and behavior of the fsck CronJob template.
Changelog
  • charts/ncps/templates/fsck-cronjob.yaml
    • Added a new Kubernetes CronJob definition for running ncps fsck.
    • Included conditional logic for initContainers when using SQLite.
    • Configured environment variables for S3 and Redis secrets.
    • Defined volume mounts and volumes for configuration, temporary storage, and persistent storage.
    • Added configurable backoffLimit and ttlSecondsAfterFinished for the job.
  • charts/ncps/tests/fsck_cronjob_test.yaml
    • Added tests to verify the CronJob is not created by default.
    • Included tests to confirm CronJob creation when enabled, checking name, schedule, and default arguments.
    • Verified correct propagation of --repair and --verified-since flags.
    • Tested configuration of backoffLimit, ttlSecondsAfterFinished, schedule, and timezone.
  • charts/ncps/values.schema.json
    • Added a new top-level fsck object with properties for enabled, schedule, timezone, repair, verifiedSince, resources, securityContext, and job.
    • Defined types, descriptions, and validation patterns (e.g., for verifiedSince) for each fsck field.
    • Included sub-properties for job such as backoffLimit, ttlSecondsAfterFinished, annotations, nodeSelector, tolerations, and affinity.
  • charts/ncps/values.yaml
    • Introduced a new fsck section with default values.
    • Set enabled to false by default.
    • Provided default schedule ("0 1 * * *") and timezone ("Local").
    • Set repair to false and verifiedSince to an empty string by default.
    • Included commented-out examples for resources.
    • Defined default securityContext settings.
    • Configured default job settings like backoffLimit (1) and ttlSecondsAfterFinished (3600).
Activity
  • All 98 helm-unittest cases passed, ensuring the Helm templates render correctly.
  • Manual template rendering was performed to verify the correct propagation of flags and default behavior.
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. ↩

@dosubot

dosubot Bot commented Mar 1, 2026

Copy link
Copy Markdown

Related Documentation

Checked 7 published document(s) in 1 knowledge base(s). No updates required.

How did I do? Any feedback?  Join Discord

@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 adds a fsck CronJob to the Helm chart, which is a great feature for automating integrity checks. However, there are critical security vulnerabilities, including potential command injection in an initContainer and YAML injection in volume mount configurations, due to unquoted user-supplied values in the Helm templates. These issues align with the repository's rule to prevent unsafe configurations in Helm charts. Additionally, the default timezone value is invalid, and the template logic for backoffLimit and ttlSecondsAfterFinished does not correctly handle the value 0. Please review the detailed comments for suggestions on addressing these issues, including applying the quote function where necessary and adding a test case for zero-value scenarios.

Comment thread charts/ncps/templates/fsck-cronjob.yaml Resolved
Comment thread charts/ncps/values.yaml Resolved
Comment thread charts/ncps/templates/fsck-cronjob.yaml Resolved
Comment thread charts/ncps/templates/fsck-cronjob.yaml Resolved
Comment thread charts/ncps/templates/fsck-cronjob.yaml Resolved
@kalbasit
kalbasit force-pushed the 02-28-feat_add_fsck_cronjob_to_helm_chart branch from 2fe3a9e to 0723eab Compare March 1, 2026 05:57
@kalbasit
kalbasit force-pushed the 02-28-perf_optimize_fsck_with_verified_at_timestamp branch from 44278a1 to eb32c1b Compare March 1, 2026 05:57
Base automatically changed from 02-28-perf_optimize_fsck_with_verified_at_timestamp to main March 1, 2026 06:20
@dosubot dosubot Bot added size:XL This PR changes 500-999 lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Mar 1, 2026
Added a CronJob to the Helm chart to run periodic integrity checks (fsck). This allows users to automate the consistency checks between the database and storage.

The implementation includes:
- New 'fsck' section in values.yaml with comprehensive configuration options.
- Added JSON schema validation for all new fsck fields in values.schema.json.
- Created a new fsck-cronjob.yaml template that uses 'ncps fsck' with configurable '--repair' and '--verified-since' flags.
- Added a full suite of unit tests in fsck_cronjob_test.yaml to verify template rendering.

Verification:
- All 98 helm-unittest cases passed.
- Manual template rendering verified correct flag propagation and default behavior (disabled by default).
@kalbasit
kalbasit force-pushed the 02-28-feat_add_fsck_cronjob_to_helm_chart branch from 0723eab to 4d51400 Compare March 1, 2026 06:21
@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:XL This PR changes 500-999 lines, ignoring generated files. labels Mar 1, 2026
@codecov

codecov Bot commented Mar 1, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 5.04%. Comparing base (fb770a8) to head (4d51400).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@          Coverage Diff          @@
##            main    #999   +/-   ##
=====================================
  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 added the backport release-0.9 Backport PR automatically label Mar 1, 2026
@kalbasit
kalbasit merged commit 802523e into main Mar 1, 2026
18 checks passed
@kalbasit
kalbasit deleted the 02-28-feat_add_fsck_cronjob_to_helm_chart branch March 1, 2026 06:35
kalbasit added a commit that referenced this pull request Mar 1, 2026
Added a CronJob to the Helm chart to run periodic integrity checks
(fsck). This allows users to automate the consistency checks between the
database and storage.

The implementation includes:
- New 'fsck' section in values.yaml with comprehensive configuration
  options.
- Added JSON schema validation for all new fsck fields in
  values.schema.json.
- Created a new fsck-cronjob.yaml template that uses 'ncps fsck' with
  configurable '--repair' and '--verified-since' flags.
- Added a full suite of unit tests in fsck_cronjob_test.yaml to verify
  template rendering.

Verification:
- All 98 helm-unittest cases passed.
- Manual template rendering verified correct flag propagation and
  default behavior (disabled by default).

(cherry picked from commit 802523e)
@kalbasit

kalbasit commented Mar 1, 2026

Copy link
Copy Markdown
Owner Author

Successfully created backport PR for release-0.9:

kalbasit added a commit that referenced this pull request Mar 1, 2026
Bot-based backport to `release-0.9`, triggered by a label in #999.

Added a CronJob to the Helm chart to run periodic integrity checks
(fsck). This allows users to automate the consistency checks between the
database and storage.

The implementation includes:
- New 'fsck' section in values.yaml with comprehensive configuration
options.
- Added JSON schema validation for all new fsck fields in
values.schema.json.
- Created a new fsck-cronjob.yaml template that uses 'ncps fsck' with
configurable '--repair' and '--verified-since' flags.
- Added a full suite of unit tests in fsck_cronjob_test.yaml to verify
template rendering.

Verification:
- All 98 helm-unittest cases passed.
- Manual template rendering verified correct flag propagation and
default behavior (disabled by default).
kalbasit added a commit that referenced this pull request Jun 8, 2026
## Summary

The `[Unreleased]` section was populated in #1309 but skewed toward the
recent CDC-drain, in-flight-staging, and Ent-migration work, omitting
several user-facing features and fixes that also landed since v0.9.4.
This backfills the missing notable changes, each cross-referenced by PR.

**Added**
- `ncps fsck` command + Helm fsck CronJob (#975, #996, #998, #999,
#1000, #1004, #1006, #1176)
- Closure pinning HTTP endpoints `POST`/`DELETE /pin/{hash}.narinfo`,
`GET /pins` (#1108)
- pprof server via `--pprof-addr` (#1063)
- CDC lazy chunking as a feature + `--cache-cdc-lazy-cleanup-schedule` +
recovery cron (#1082, #1083, #1089, #1096)
- Helm: auto `GOMEMLIMIT` (#1061), configurable temp volume /
`volumeClaimTemplate` (#1074, #1077), SQLite `Recreate` strategy (#1012)
- Startup storage reporting + deprecated-narinfo warning (#959, #961)
- `docker-dev` image (#1097)

**Fixed**
- `store/tmp` no longer wiped on startup (#1313)
- `nix-hash` NAR verification (#1101)
- Prometheus counters primed at startup (#1337, #1343)
- 404 on un-reassemblable chunked NARs (#1319), purged narinfo no longer
500 (#1318), fail-fast tmp validation (#1086)
- Further CDC/cache reliability fixes (#1317, #1346, #1341, #1342,
#1331, #1347)

**Changed**
- CDC config now persisted in the DB config table (#971)

Dependency bumps, CI/test-only changes, and the internal Ent-conversion
PRs are intentionally excluded; the existing Ent-migration entry already
covers that work.

## Test plan

- [x] `nix fmt` reports no changes (docs-only edit)
- [x] CHANGELOG section structure intact
(Added/Fixed/Changed/Removed/Migration/CI)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport release-0.9 Backport PR automatically enhancement New feature or request helm size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant