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

Clear order of precedence for global configs #4362

Closed
1 task done
dbeatty10 opened this issue Oct 28, 2023 · 0 comments · Fixed by #4363
Closed
1 task done

Clear order of precedence for global configs #4362

dbeatty10 opened this issue Oct 28, 2023 · 0 comments · Fixed by #4363
Labels
content Improvements or additions to content improvement Use this when an area of the docs needs improvement as it's currently unclear

Comments

@dbeatty10
Copy link
Contributor

dbeatty10 commented Oct 28, 2023

Contributions

  • I have read the contribution docs, and understand what's expected of me.

Link to the page on docs.getdbt.com requiring updates

https://docs.getdbt.com/reference/global-configs/about-global-configs

What part(s) of the page would you like to see updated?

When I was writing up this design of adding a new global config, there were two things I was looking for on the "About global configs" page:

  1. Clear order of precedence between the three different places the config can be set:
    1. user config, environment variable, CLI flag)
  2. Links to each of those three concepts (user config, environment variable, CLI flag)

The current page does explain the precedence here:

Starting in v1.0, you can set global configs in three places. When all three are set, command line flags take precedence, then environment variables, and last yaml configs (usually profiles.yml).

But it's hard to see when quickly scanning because it appears at the end of the three paragraphs of text, and it doesn't have its own (hyperlinkable) heading.

In an ideal world, it would have it's own heading, and each of the three user config, environment variable, CLI flag pages could link back to that section when explaining its own precedence in relation to the other two.

An idea that solves both

For the order of precedence, something similar to this would be useful:

Global config precedence

dbt will pick the config in the following order (lower takes priority):

  1. user config
  2. environment variable
  3. CLI flag

i.e., if all three are provided, then the CLI flag takes precedence.

Additional information

This was instigated while responding to the feature request in dbt-labs/dbt-core#8936.

Other listings of precedence

Here are some other concepts in dbt that list their precedence order:

@dbeatty10 dbeatty10 added content Improvements or additions to content improvement Use this when an area of the docs needs improvement as it's currently unclear labels Oct 28, 2023
dbeatty10 added a commit that referenced this issue Oct 30, 2023
[Preview](https://docs-getdbt-com-git-dbeatty-global-configs-prec-329ad4-dbt-labs.vercel.app/reference/global-configs/about-global-configs)

resolves #4362

## What are you changing in this pull request and why?

Two things:
1. When quickly scanning docs, make it easy to see the order of
precedence for global configs
1. Include hyperlinks to the three different ways that a global config
can be set ([user
config](https://docs.getdbt.com/reference/global-configs/yaml-configurations),
[environment
variable](https://docs.getdbt.com/reference/global-configs/environment-variable-configs),
[CLI
flag](https://docs.getdbt.com/reference/global-configs/command-line-flags))

### History


[This](https://github.com/dbt-labs/docs.getdbt.com/blob/35a59491ffc6133a26e0c52b9a8e9a3f96d405f3/website/docs/reference/global-configs/about-global-configs.md)
is the current page for "Global Configs", and
[this](https://github.com/dbt-labs/docs.getdbt.com/blob/533637af17b296e17a19eb4582da0123ddc8b572/website/docs/reference/global-configs.md)
was the page prior to
#3332.

### 🎩 

<img width="450" alt="image"
src="https://github.com/dbt-labs/docs.getdbt.com/assets/44704949/2f9657a8-ab70-456e-8cb6-29d7030d1cbb">


## Checklist
- [x] Review the [Content style
guide](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/content-style-guide.md)
and [About
versioning](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/single-sourcing-content.md#adding-a-new-version)
so my content adheres to these guidelines.
- [x] I have verified the preview renders correctly
- [x] I have verified any new links work correctly

---------

Co-authored-by: Matt Shaver <60105315+matthewshaver@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
content Improvements or additions to content improvement Use this when an area of the docs needs improvement as it's currently unclear
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant