-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature] On Linux: respect XDG_CONFIG_HOME
and don't store config in user's home directory
#2515
Comments
Thanks for opening this issue @sethwoodworth. Looping in @beckjake to take a look :) |
I'm surprised we don't have an issue about this yet, thanks for writing it up! I agree, also Windows should write to The problem here is going to be migration. This fix is going to break stuff for a lot of people! We should do it before 1.0. We can fall back to |
I was unaware of the
in your |
This issue has been marked as Stale because it has been open for 180 days with no activity. If you would like the issue to remain open, please remove the stale label or comment on the issue, or it will be closed in 7 days. |
This issue has been marked as Stale because it has been open for 180 days with no activity. If you would like the issue to remain open, please remove the stale label or comment on the issue, or it will be closed in 7 days. |
Although we are closing this issue as stale, it's not gone forever. Issues can be reopened if there is renewed community interest; add a comment to notify the maintainers. |
I found this trying to figure out why dbt didn't support xdg properly. It really should. |
@dbeatty10 you closed the issue as "not planned" but didn't touch my PR (#11108). Did you mean to reject it? If so, was this like a "Yeah, that'd be nice but we don't have time to do this and make sure it's 100% correct just now" kinda thing? Or was there some reason why y'all didn't like it? |
Hey @dradetsky ! Quick explanation: the stale bot closed this as "completed" (done, closed, fixed, resolved) on Jun 23, 2022, but it should have closed it as "not planned" (won't fix, can't repro, duplicate, stale): (This affects a lot of older issues that were closed by the stale bot, but it is does not affect more recent issues closed by the stale bot.) So I made a quick fix to reflect that it was not completed, but I probably should have also then immediately re-opened for further triage due to your linked PR. Re-opening now 👍 |
@dradetsky I removed the OverviewThe folder location where dbt searches for connection profiles is absolutely fundamental to how dbt operates, so any changes in this area of code introduce substantial risk of regressions. So it isn't a change we can take lightly. WorkaroundDid you consider or try out the suggestion in #2515 (comment)? export DBT_PROFILES_DIR="$(XDG_CONFIG_HOME)/dbt" This looks like a pretty lightweight approach to look in the conventional XDG folder without needing to make any changes to dbt itself. Unless overridden by the |
Yes, a proper fix for this would probably involve automatic migration of legacy profile dirs, or falling back to the legacy dir if the primary dir doesn't have the profiles, or both. I didn't really want to write all that without talking to someone given that this was likely going to involve talking to DX peoples anyhow.
I mean, no, but I saw it and I'm sure it would work if all I wanted was to fix this for me asap. I just did this on the grounds that using xdg dirs is the Correct Thing(tm) and dbt should do the Correct Thing(tm) if possible. I also thought (but didn't know for sure) that the defaults used by Using the env var is probably what you should recommend in the short term. I would still recommend that the change in my PR (along with necessary migration changes) should be made. However, that will involve getting some stakeholders to agree on what kinds of migration/fallback/testing is necessary to get For that reason, I think I'll pull out the change that fixes the circular import issue & induces copypasta and submit that. That will make any 2nd PR smaller & simpler, which is always good. |
XDG_CONFIG_HOME
and don't store config in user's home directory
XDG_CONFIG_HOME
and don't store config in user's home directoryXDG_CONFIG_HOME
and don't store config in user's home directory
Describe the feature
The XDG Base Directory standard states that user config files should respect the
XDG_CONFIG_HOME
environment variable, which defaults$HOME/.config
.Currently, dbt defaults the PROFILE_DIR to
~/.dbt
and doesn't attempt to read from XDG_CONFIG_HOME or ~/.config.Describe alternatives you've considered
I can locally symlink my ~/.config/dbt directory to ~/.dbt, but it's not my preference to put additional directories in my home directory. Alternately, I could set a global
DBT_PROFILES_DIR
variable.Additional context
This is only relevant to Linux users. The
appdirs
pypi package makes the XDG_Base_directory standard simple to implement.Who will this benefit?
Linux users who have far too many files/folders in their home directories.
The text was updated successfully, but these errors were encountered: