Skip to content

chore: stop creating the config path in the store - #763

Merged
kalbasit merged 1 commit into
mainfrom
02-05-chore_stop_creating_the_config_path_in_the_store
Feb 5, 2026
Merged

kalbasit merged 1 commit into
mainfrom
02-05-chore_stop_creating_the_config_path_in_the_store

Conversation

@kalbasit

@kalbasit kalbasit commented Feb 5, 2026

Copy link
Copy Markdown
Owner

The config path is no longer used but is still needed in case
PutSecretKey() is called. Create it then as-needed.

The config path is no longer used but is still needed in case
PutSecretKey() is called. Create it then as-needed.
@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 refactors the directory creation strategy within the local storage implementation. It transitions from eagerly creating certain directories during store initialization to a more efficient, on-demand approach. Directories like the configuration path and NAR information path are now only created when the specific functions that require them are called, optimizing resource usage and streamlining the initial setup process.

Highlights

  • Lazy Directory Creation for Config Path: The configuration path is no longer created during the initial store setup. Instead, it is now created on-demand specifically when the PutSecretKey function is invoked, ensuring the directory exists only when needed.
  • Lazy Directory Creation for NarInfo Path: Similarly, the directory for storing NAR information (storeNarInfoPath) is now created on-demand within the PutNarInfo function, rather than during the initial setup phase.
  • Refactored Initial Directory Setup: The setupDirs function has been updated to remove the configPath from the list of directories it proactively creates, aligning with the new on-demand creation strategy.
  • Updated Unit Tests: The unit tests in local_test.go have been adjusted to reflect these changes, specifically by no longer expecting the 'config' directory to exist immediately after the store's initialization.
Changelog
  • pkg/storage/local/local.go
    • Modified PutSecretKey to include os.MkdirAll(s.configPath(), dirMode) to create the config directory only when a secret key is being stored.
    • Modified PutNarInfo to include os.MkdirAll(s.storeNarInfoPath(), dirMode) to create the NAR info directory only when NAR info is being stored.
    • Removed s.configPath() from the allPaths slice in setupDirs, preventing its creation during initial store setup.
  • pkg/storage/local/local_test.go
    • Removed the 'config' entry from the dirs slice in TestNew, reflecting that the config directory is no longer expected to be created by default.
Activity
  • No specific activity (comments, reviews, etc.) 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. ↩

kalbasit commented Feb 5, 2026

Copy link
Copy Markdown
Owner Author

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

@kalbasit kalbasit added the backport release-0.8 Backport PR automatically label Feb 5, 2026
@kalbasit
kalbasit enabled auto-merge (squash) February 5, 2026 23:19
@dosubot dosubot Bot added size:S This PR changes 10-29 lines, ignoring generated files. go Pull requests that update go code labels Feb 5, 2026

@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 correctly refactors the local storage to create the config directory on-demand when needed, which is a good improvement. The related changes in setupDirs and the tests are consistent with this. However, a similar change made to PutNarInfo introduces a redundant directory creation call, as the necessary directory structure is already being created later in the function. I've left a specific comment with a suggestion to remove the redundant code.

Comment thread pkg/storage/local/local.go Resolved
@codecov

codecov Bot commented Feb 5, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.41%. Comparing base (3c412d9) to head (8ef54a6).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #763   +/-   ##
=======================================
  Coverage   85.41%   85.41%           
=======================================
  Files           2        2           
  Lines         480      480           
=======================================
  Hits          410      410           
  Misses         65       65           
  Partials        5        5           

☔ 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 7a462f6 into main Feb 5, 2026
17 checks passed
@kalbasit
kalbasit deleted the 02-05-chore_stop_creating_the_config_path_in_the_store branch February 5, 2026 23:33
kalbasit added a commit that referenced this pull request Feb 5, 2026
The config path is no longer used but is still needed in case
PutSecretKey() is called. Create it then as-needed.

(cherry picked from commit 7a462f6)
@kalbasit

kalbasit commented Feb 5, 2026

Copy link
Copy Markdown
Owner Author

Successfully created backport PR for release-0.8:

kalbasit added a commit that referenced this pull request Feb 5, 2026
Bot-based backport to `release-0.8`, triggered by a label in #763.

The config path is no longer used but is still needed in case
PutSecretKey() is called. Create it then as-needed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport release-0.8 Backport PR automatically go Pull requests that update go code 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