Skip to content

feat: report narinfo storage deprecated and must be migrated - #961

Merged
kalbasit merged 1 commit into
mainfrom
02-22-feat_report_narinfo_storage_deprecated_and_must_be_migrated
Feb 22, 2026
Merged

kalbasit merged 1 commit into
mainfrom
02-22-feat_report_narinfo_storage_deprecated_and_must_be_migrated

Conversation

@kalbasit

Copy link
Copy Markdown
Owner

The narinfo stored in the storage is deprecated and this is the last
release that will support their migration from storage to the database.
Include this messaging in the next release so I can clean up the code in
the following one.

@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. enhancement New feature or request go Pull requests that update go code labels Feb 22, 2026
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @kalbasit, 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 introduces proactive messaging to inform users about the upcoming deprecation of file-based narinfo storage. It integrates checks within the local and S3 storage initialization processes to detect existing 'narinfo' directories and, if found, logs a clear warning with migration instructions. This change is essential for guiding users through the transition to database-backed narinfo storage before file-based support is fully removed in a subsequent release.

Highlights

  • Deprecation Warning for Narinfo Storage: Introduced a warning message that will be logged if file-based narinfo directories are detected in local or S3 storage, indicating that this method is deprecated and will be removed in the next release.
  • Narinfo Directory Detection: Added new methods (HasNarinfoDir) to both local and S3 storage implementations to efficiently check for the existence of the 'narinfo' directory.
  • Storage Type and Mode Constants: Refactored hardcoded string literals for storage types ('local', 's3') and storage modes ('cdc', 'whole') into named constants for improved maintainability and readability.
  • Migration Instructions: The warning message includes instructions for users to migrate their narinfo data to the database using ncps migrate-narinfo --help.
Changelog
  • pkg/ncps/serve.go
    • Added constants for storage types and modes.
    • Implemented checks for existing 'narinfo' directories in local and S3 storage, logging a warning if found.
    • Updated attribute detection to use new constants for storage type and mode.
  • pkg/storage/local/local.go
    • Added HasNarinfoDir method to check for the existence of the local 'narinfo' directory.
  • pkg/storage/local/local_test.go
    • Added unit tests for the HasNarinfoDir method, covering various scenarios.
  • pkg/storage/s3/s3.go
    • Added HasNarinfoDir method to check for the existence of the S3 'narinfo' directory using ListObjects.
    • Refactored narInfoPath to utilize a new storeNarInfoPath helper function.
  • pkg/storage/s3/s3_test.go
    • Added unit and integration tests for the HasNarinfoDir method, including error handling and presence checks.
Activity
  • The pull request was created by kalbasit.
  • The title 'feat: report narinfo storage deprecated and must be migrated' clearly states the intent.
  • The description explains that this is the last release supporting migration from storage to database for narinfo, and the messaging is included to allow code cleanup in the following release.
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. ↩

Copy link
Copy Markdown
Owner Author

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

Comment thread pkg/storage/s3/s3_test.go Fixed

@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 introduces a deprecation warning for file-based narinfo storage, which is slated for removal. The changes add checks during application startup for both local and S3 storage to detect the old narinfo directory structure and log a warning if it exists. The implementation is solid, with new helper methods and thorough tests. My primary feedback is to enhance the error handling for these new checks to log any potential errors, such as permission issues or network problems, rather than ignoring them silently. This will ensure the deprecation message is reliably communicated to users.

Comment thread pkg/ncps/serve.go Resolved
Comment thread pkg/ncps/serve.go Resolved
@dosubot

dosubot Bot commented Feb 22, 2026 •

Copy link
Copy Markdown

Documentation Updates

1 document(s) were updated by changes in this PR:

Cache and Storage Configuration Flags
View Changes
@@ -13,11 +13,15 @@
 
 ## Deprecated: File-Based Narinfo Storage
 
-**⚠️ Important: File-based narinfo storage is deprecated and will be removed in the next release.**
+**⚠️ URGENT: This is the LAST RELEASE that supports migration from file-based narinfo storage.**
 
-File-based narinfo storage, which stores narinfo metadata in local `narinfo` directories (for local storage) or S3 `narinfo` directories (for S3 storage), is deprecated. This is the **last release** that supports automatic migration from file-based storage to the database.
+File-based narinfo storage, which stores narinfo metadata in local `narinfo` directories (for local storage) or S3 `narinfo` directories (for S3 storage), is deprecated and will be removed in the next release. 
 
-When the server starts and detects existing narinfo directories, it will display deprecation warnings:
+**Critical:** This is the **final release** that includes the migration capability. The next release will remove both file-based storage support AND the migration tooling. You must migrate your data now.
+
+### Automatic Detection and Warnings
+
+The server automatically detects existing narinfo directories at startup for both local and S3 storage backends. When detected, warning messages are logged to alert you of the deprecation:
 
 **For local storage:**
 ```
@@ -29,9 +33,26 @@
 S3 'narinfo' directory detected. S3-based narinfo storage is deprecated and will be removed in the next release.
 ```
 
-Both warnings include instructions to run `ncps migrate-narinfo --help` to learn how to migrate your data.
+Both warning messages include structured logging fields:
+- `component`: "storage"
+- `action_required`: "Migrate narinfo to database"
+- `instructions`: "Run `ncps migrate-narinfo --help`"
 
-**Action Required:** If you have existing deployments using file-based narinfo storage, you must migrate to database-backed storage as soon as possible. Run the migration command before upgrading to future releases.
+### Required Action
+
+**You MUST migrate immediately if:**
+- You have existing deployments using file-based narinfo storage
+- The server logs either of the above warning messages at startup
+
+**To migrate your data:**
+1. Run `ncps migrate-narinfo --help` to see migration options
+2. Execute the migration command before upgrading to the next release
+3. Verify the migration completed successfully
+
+**Failure to migrate before the next release will result in:**
+- Loss of ability to automatically migrate narinfo data
+- Potential data accessibility issues
+- Manual recovery procedures may be required
 
 ## Storage Configuration: Local vs S3
 You must configure either local storage or S3 storage, but not both. Attempting to set both will result in an error. The required flags and configuration options are as follows:

How did I do? Any feedback?  Join Discord

@kalbasit
kalbasit force-pushed the 02-22-feat_report_narinfo_storage_deprecated_and_must_be_migrated branch from 1931dea to fd988bc Compare February 22, 2026 20:19
Comment thread pkg/storage/s3/s3_test.go Dismissed
@kalbasit kalbasit added the backport release-0.9 Backport PR automatically label Feb 22, 2026
@kalbasit
kalbasit force-pushed the 02-22-feat_report_narinfo_storage_deprecated_and_must_be_migrated branch from fd988bc to c9db4f0 Compare February 22, 2026 21:29
The narinfo stored in the storage is deprecated and this is the last
release that will support their migration from storage to the database.
Include this messaging in the next release so I can clean up the code in
the following one.
@kalbasit
kalbasit force-pushed the 02-22-feat_report_narinfo_storage_deprecated_and_must_be_migrated branch from c9db4f0 to cdafcc2 Compare February 22, 2026 21:32
@codecov

codecov Bot commented Feb 22, 2026 •

Copy link
Copy Markdown

Codecov Report

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

Additional details and impacted files
@@          Coverage Diff          @@
##            main    #961   +/-   ##
=====================================
  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 e32ee09 into main Feb 22, 2026
16 checks passed
@kalbasit
kalbasit deleted the 02-22-feat_report_narinfo_storage_deprecated_and_must_be_migrated branch February 22, 2026 21:44
kalbasit added a commit that referenced this pull request Feb 22, 2026
The narinfo stored in the storage is deprecated and this is the last
release that will support their migration from storage to the database.
Include this messaging in the next release so I can clean up the code in
the following one.

(cherry picked from commit e32ee09)
@kalbasit

Copy link
Copy Markdown
Owner Author

Successfully created backport PR for release-0.9:

kalbasit added a commit that referenced this pull request Feb 22, 2026
…#961] (#964)

Bot-based backport to `release-0.9`, triggered by a label in #961.

The narinfo stored in the storage is deprecated and this is the last
release that will support their migration from storage to the database.
Include this messaging in the next release so I can clean up the code in
the following one.
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 go Pull requests that update go code size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants