Skip to content

chore(deps): update optnix dependency to v0.3.0#137

Merged
water-sucks merged 1 commit intonix-community:mainfrom
water-sucks:update-optnix-dep
Nov 22, 2025
Merged

chore(deps): update optnix dependency to v0.3.0#137
water-sucks merged 1 commit intonix-community:mainfrom
water-sucks:update-optnix-dep

Conversation

@water-sucks
Copy link
Copy Markdown
Collaborator

@water-sucks water-sucks commented Nov 22, 2025

This updates the optnix dependency to v0.3.0 in order to bring in some fixes and enhancements to nixos option.

This release brings support for multiple "scopes", which is not relevant in our case; as such, this PR just mimics the original functionality of only being able to browse a single list of options at one time.

Closes #136.

Summary by CodeRabbit

  • Chores
    • Updated core dependencies including UI framework, CLI tools (cobra, pflag), configuration management, and security packages for improved stability and security
    • Updated build configuration metadata

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Nov 22, 2025

Walkthrough

Upgrades multiple dependencies including optnix v0.2 → v0.3, and refactors the interactive option UI configuration from flat single-scope to scope-based multi-scope architecture with loader callbacks. Updates Nix package vendorHash to reflect new dependencies.

Changes

Cohort / File(s) Summary
Option UI API Migration
cmd/option/option.go
Migrates option UI initialization from flat configuration (Options, ScopeName, Evaluator directly) to scope-based architecture using Scopes array with Loader functions and SelectedScopeName field
Dependency Updates
go.mod
Updates direct dependencies: bubbletea (v1.3.6 → v1.3.10), koanf (v2.2.2 → v2.3.0), cobra (v1.9.1 → v1.10.1), pflag (v1.0.6 → v1.0.10), optnix (v0.2.0 → v0.3.0), and golang.org/{crypto,sys,term} packages; updates indirect dependencies across charmbracelet, golang.org, and other transitive packages; replaces coreos/go-systemd with water-sucks/go-systemd
Nix Package Hash
nix/package.nix
Updates vendorHash value to match new Go dependencies

Sequence Diagram(s)

sequenceDiagram
    autonumber
    participant Caller
    participant OptionTUI
    participant Scope as Scope Loader
    participant OptionSource
    
    rect rgb(220, 240, 255)
    Note over Caller,Scope: New scope-based initialization (v0.3)
    Caller->>OptionTUI: NewOptionTUI(Scopes, SelectedScopeName, ...)
    activate OptionTUI
    OptionTUI->>Scope: Call Loader() when scope selected
    activate Scope
    Scope->>OptionSource: Load options
    OptionSource-->>Scope: Return options
    Scope-->>OptionTUI: Return loaded options
    deactivate Scope
    OptionTUI-->>Caller: UI ready
    deactivate OptionTUI
    end
    
    rect rgb(240, 220, 220)
    Note over Caller: Old flat initialization (v0.2)
    Caller->>OptionTUI: NewOptionTUI(Options, ScopeName, Evaluator, ...)
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • cmd/option/option.go: API surface change requires careful verification that the scope-based Loader function correctly wraps existing option initialization and that SelectedScopeName is properly set. Review scope structure, Loader callback, and any downstream impact on option retrieval flow.
  • go.mod: Multiple dependency bumps require checking for breaking changes, especially the optnix v0.2 → v0.3 upgrade that triggered the API migration. The replace directive change from coreos/go-systemd to water-sucks/go-systemd fork may introduce behavioral differences and warrants validation.
  • nix/package.nix: Verify vendorHash matches actual vendored code after dependency updates; this is typically low-risk but should be validated against actual build output.

Pre-merge checks and finishing touches

✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title accurately describes the main change: updating the optnix dependency to v0.3.0. The title is concise and clearly communicates the primary objective of the changeset.
Linked Issues check ✅ Passed The PR successfully addresses issue #136 by upgrading optnix to v0.3.0 and migrating the code to the new API structure that uses scopes instead of flat configuration.
Out of Scope Changes check ✅ Passed All changes are directly related to the optnix upgrade: code migration to new API, dependency updates in go.mod, and vendorHash update in nix/package.nix. No unrelated changes are present.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
cmd/option/option.go (1)

192-215: Single-scope migration to optnix v0.3.0 looks correct; minor DRY nit

The new Scopes + SelectedScopeName wiring preserves the previous behavior (same options, evaluator, minScore, debounce, and initial input) while adapting to the multi-scope API. To avoid future drift, you could put "nixos" in a small const and reuse it for both Name and SelectedScopeName.

Please sanity-check the interactive nixos option TUI (including <Esc> handling) against v0.3.0 docs / behavior to confirm there are no regressions from the upstream API change.

go.mod (1)

100-100: Systemd fork replace is fine mechanically; consider documenting rationale

The replace from github.com/coreos/go-systemd/v22 to github.com/water-sucks/go-systemd/v22 at a pinned commit is syntactically correct and will transparently redirect existing imports.

Given this affects low-level systemd integration, it’d be helpful to document briefly (e.g., in CONTRIBUTING or a module comment) why the fork is needed and how it tracks upstream, and to verify that all systemd-related usages still build and behave as expected with this replacement.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d9d29cb and 06a8f13.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (3)
  • cmd/option/option.go (1 hunks)
  • go.mod (2 hunks)
  • nix/package.nix (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Build/Test
🔇 Additional comments (3)
nix/package.nix (1)

27-27: Vendor hash update is consistent with dependency changes

This looks like the expected vendorHash refresh after bumping Go dependencies; nothing stands out as incorrect here.

go.mod (2)

9-27: Direct dependency bumps align with the optnix upgrade; confirm runtime compatibility

The version bumps for bubbletea, koanf/v2, cobra, pflag, optnix, and the golang.org/x/* modules look consistent with adopting optnix v0.3.0 and newer TUI stacks. No obvious red flags from the versions alone; remaining risk is behavioral.

Please ensure you’ve run the full test suite and exercised the interactive UIs (especially nixos option) to catch any regressions from these library upgrades.


33-44: Transitive dependency refresh looks tidy; keep module files in sync

These indirect bumps (Charmbracelet stack, Chroma, Clippehouse, Goldmark, golang.org/x/*, etc.) are what I’d expect from the direct upgrades. They look mechanically fine.

Just confirm go mod tidy produces no further changes so future contributors don’t see unexpected diffs stemming from this refresh.

Also applies to: 50-60, 67-67, 90-90, 92-95

@water-sucks water-sucks merged commit c764622 into nix-community:main Nov 22, 2025
2 checks passed
@water-sucks water-sucks deleted the update-optnix-dep branch November 22, 2025 12:40
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.

upgrade optnix 0.2 -> 0.3

1 participant