Skip to content

refactor(config): separate config dir from data dir on unix#580

Merged
skevetter merged 1 commit into
mainfrom
pathmanager-consistency
Jul 4, 2026
Merged

refactor(config): separate config dir from data dir on unix#580
skevetter merged 1 commit into
mainfrom
pathmanager-consistency

Conversation

@skevetter

@skevetter skevetter commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Unix path managers resolved ConfigDir and DataDir to the same ~/.devsy
path, so config.yaml piled into the data root alongside contexts and
bind-mount sources. Move ConfigDir to ~/.config/devsy, matching Windows'
already-distinct layout. DataDir/StateDir/CacheDir are unchanged.

Also unify the pm self-reference assignment (pm.pm = pm) across darwin
and windows to match linux and clear the staticcheck finding.

Summary by CodeRabbit

  • Bug Fixes
    • Standardized default config and config file locations on macOS and Linux to use the common ~/.config/<AppName> path.
    • Updated Windows path initialization to ensure path resolution works correctly across platforms.
  • Tests
    • Added and updated platform-specific tests to verify config, data, and config file paths resolve as expected.

Unix path managers resolved ConfigDir and DataDir to the same ~/.devsy
path, so config.yaml piled into the data root alongside contexts and
bind-mount sources. Move ConfigDir to ~/.config/devsy, matching Windows'
already-distinct layout. DataDir/StateDir/CacheDir are unchanged.

Also unify the pm self-reference assignment (pm.pm = pm) across darwin
and windows to match linux and clear the staticcheck finding.
@netlify

netlify Bot commented Jul 3, 2026

Copy link
Copy Markdown

Deploy Preview for devsydev canceled.

Name Link
🔨 Latest commit 4517bfe
🔍 Latest deploy log https://app.netlify.com/projects/devsydev/deploys/6a47dcd112b2990008f96d23

@coderabbitai

coderabbitai Bot commented Jul 3, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 9482441a-3aeb-4eab-8cb1-4740386d11b6

📥 Commits

Reviewing files that changed from the base of the PR and between 316bfe6 and 4517bfe.

📒 Files selected for processing (5)
  • pkg/config/pathmanager_darwin.go
  • pkg/config/pathmanager_darwin_test.go
  • pkg/config/pathmanager_linux.go
  • pkg/config/pathmanager_linux_test.go
  • pkg/config/pathmanager_windows.go

📝 Walkthrough

Walkthrough

This PR changes ConfigDir() resolution on Darwin and Linux to use the XDG-style ~/.config/<RepoName> path instead of ~/.<RepoName>, adjusts pm back-reference assignment in Darwin and Windows constructors, and updates/adds corresponding tests.

Changes

XDG Config Directory Migration

Layer / File(s) Summary
Darwin ConfigDir path and constructor fix
pkg/config/pathmanager_darwin.go, pkg/config/pathmanager_darwin_test.go
ConfigDir() now resolves to ~/.config/<RepoName> instead of ~/.<RepoName>, newPlatformPathManager assigns pm.pm directly, and new tests validate ConfigDir(), DataDir(), and ConfigFilePath() behavior.
Linux ConfigDir path change
pkg/config/pathmanager_linux.go, pkg/config/pathmanager_linux_test.go
ConfigDir() now joins home with .config and RepoName instead of "."+RepoName, with test expectations updated accordingly.
Windows constructor field assignment fix
pkg/config/pathmanager_windows.go
newPlatformPathManager assigns pm.pm directly instead of pm.basePathManager.pm.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • devsy-org/devsy#74: Both PRs modify the pkg/config PathManager implementations, specifically the newPlatformPathManager wiring and ConfigDir() location logic.
  • devsy-org/devsy#416: Both PRs modify pkg/config/pathmanager_darwin.go's HOME-based ConfigDir()/DataDir() path resolution.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: Unix config paths are separated from data paths.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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.

@github-actions github-actions Bot added the size/m label Jul 3, 2026
@netlify

netlify Bot commented Jul 3, 2026

Copy link
Copy Markdown

Deploy Preview for images-devsy-sh canceled.

Name Link
🔨 Latest commit 4517bfe
🔍 Latest deploy log https://app.netlify.com/projects/images-devsy-sh/deploys/6a47dcd176fb4b000861e708

@skevetter
skevetter marked this pull request as ready for review July 3, 2026 17:08
@skevetter
skevetter merged commit 78ea1a1 into main Jul 4, 2026
60 checks passed
@skevetter
skevetter deleted the pathmanager-consistency branch July 4, 2026 14:34
skevetter added a commit that referenced this pull request Jul 5, 2026
PR #580 moved unix ConfigDir from ~/.devsy to ~/.config/devsy, but config.yaml
holds each provider's Initialized flag and the state it references (contexts,
providers) stayed under DataDir at ~/.devsy. After upgrade devsy read an empty
config from the new dir and every workspace failed with "provider is not
initialized".

Restore ConfigDir to ~/.devsy on darwin and linux so config.yaml sits with the
data it configures again. Keeps the pm.pm self-reference cleanup from #580.
Windows is unaffected (ConfigDir already differs from DataDir there).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant