Skip to content
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

(#1645) fix for errant cookie generation #1656

Merged
merged 1 commit into from
Aug 4, 2019
Merged

Conversation

drewbanin
Copy link
Contributor

closes #1645

This PR fixes an issue where dbt generated a profiles/.user.yml file if the --profiles-dir flag (or $DBT_PROFILES_DIR env var) was set to a path which did not contain a profiles.yml file. There remains an inconsistency between how --profiles-dir and $DBT_PROFILES_DIR operate when users run dbt from a subdirectory of the project. We should resolve this issue in a future PR, potentially by deferring the loading of the user config until dbt understands more of the project structure. See #1645 for more information on this approach.

Ultimately, if a user points dbt to a profile dir which does not contain a profile, dbt is going to fail pretty hard. This PR fixes a symptom of that problem -- dbt will no longer create user cookies in directories which are not already identified by profiles.yml files. Note: this means that the user cookie id may be inconsistent for the first couple of runs for a user, or between runs when the profile dir is being changed dynamically with --profiles-dir or $DBT_PROFILES_DIR. I am happy to trade a little bit of noise in the anonymous event data to prevent these cookies from being errantly littered across the users' filesystems.

@drewbanin drewbanin force-pushed the fix/bad-profile-dir branch from 72307b7 to 57c6b11 Compare August 3, 2019 18:14
@drewbanin drewbanin requested a review from beckjake August 3, 2019 18:14
@drewbanin drewbanin merged commit f3baa69 into dev/0.14.1 Aug 4, 2019
@drewbanin drewbanin deleted the fix/bad-profile-dir branch August 4, 2019 23:13
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.

dbt sometimes writes a .user.yml and ignores configs
2 participants