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

Table of global configs (user configs, env var, and cli flag) #4366

Closed
1 task done
dbeatty10 opened this issue Oct 29, 2023 · 3 comments · Fixed by #4814
Closed
1 task done

Table of global configs (user configs, env var, and cli flag) #4366

dbeatty10 opened this issue Oct 29, 2023 · 3 comments · Fixed by #4814
Assignees
Labels
content Improvements or additions to content improvement Use this when an area of the docs needs improvement as it's currently unclear priority: high Technical inaccuracy, missing/incorrect information, or broken links. Negatively affects workflows size: small This change will take 1 to 2 days to address

Comments

@dbeatty10
Copy link
Contributor

dbeatty10 commented Oct 29, 2023

Proposed solution

It would be awesome if there were dense table of all the global configs and their associated user configs, environment variables, and CLI flags.

Maybe like this (the content of which I have only partially verified):

YAML User Config Full Environment Variable Command Line Flag
send_anonymous_usage_stats DBT_SEND_ANONYMOUS_USAGE_STATS --send-anonymous-usage-stats
use_colors DBT_USE_COLORS --use-colors
use_colors_file DBT_USE_COLORS_FILE --use-colors-file
partial_parse DBT_PARTIAL_PARSE --partial-parse
write_json DBT_WRITE_JSON --write-json
warn_error DBT_WARN_ERROR --warn-error
debug DBT_DEBUG --debug
version_check DBT_VERSION_CHECK --version-check
fail_fast DBT_FAIL_FAST --fail-fast
use_experimental_parser DBT_USE_EXPERIMENTAL_PARSER --use-experimental-parser
static_parser DBT_STATIC_PARSER --static-parser
printer_width DBT_PRINTER_WIDTH --printer-width
log_format DBT_LOG_FORMAT --log-format
log_format_file DBT_LOG_FORMAT_FILE --log-format-file
log_level DBT_LOG_LEVEL --log-level
log_level_file DBT_LOG_LEVEL_FILE --log-level-file
log_cache_events DBT_LOG_CACHE_EVENTS --log-cache-events
indirect_selection DBT_INDIRECT_SELECTION --indirect-selection
quiet DBT_QUIET --quiet
print DBT_PRINT --print
cache_selected_only DBT_CACHE_SELECTED_ONLY --cache-selected-only
populate_cache DBT_POPULATE_CACHE --populate-cache
full_refresh DBT_FULL_REFRESH --full-refresh
introspect DBT_INTROSPECT --introspect
store_failures DBT_STORE_FAILURES --store-failures
target DBT_TARGET --target
profile DBT_PROFILE --profile

Not within dbt_project.yml

YAML User Config Full Environment Variable Command Line Flag
N/A DBT_PROJECT_DIR --project-dir
N/A DBT_PROFILES_DIR --profiles-dir

Within dbt_project.yml as top-level configs instead of under flags:

YAML User Config Full Environment Variable Command Line Flag
target-path DBT_TARGET_PATH --target-path
log-path DBT_LOG_PATH --log-path

Caveats

Further verification needed

As noted in #3264, some of the configs listed in the "YAML User Config" column may only work as environment variables and/or CLI flags and might not work within YAML config (like profiles.yml).

Missing docs

The row for log_cache_events above does not have hyperlinks because I didn't see any relevant documentation for this config.

Opened #4664 as a result.

Problem

The big idea is that there are a lot of global flags and/or global configs that can be specified in three different ways (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.

But it's not always easy to see what the different options are. In particular, the relevant environment variable is often a guessing game, and the user config name is not always clear either. The CLI flag is the thing that is most consistently included in the documentation and examples, but even that is not always searchable.

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

Either this page or some other page:

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

See proposed solution above.

Contributions

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

Additional information

No response

@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 29, 2023
@graciegoheen
Copy link
Collaborator

bump on this! @matthewshaver

@graciegoheen graciegoheen added priority: high Technical inaccuracy, missing/incorrect information, or broken links. Negatively affects workflows size: small This change will take 1 to 2 days to address labels Jan 2, 2024
@mirnawong1
Copy link
Contributor

mirnawong1 commented Jan 12, 2024

hey @dbeatty10 , this issue isn't similar to this one, right? i think they are slightly different and if so, I'll keep the other open. if they are the same -- what do you think about consolidating it and i can add my write up in yours as yours is more comprehensive?

@dbeatty10
Copy link
Contributor Author

Yeah similar, but slightly different!

So agreed to keep them both open.

Both of these could easily get stale and out-of-date when changes are made to dbt-core.

Here is a script that uses click to determine which CLI flags (and environment variables) are relevant to each sub-command.

We could use a script like this to auto-generate the relationship between CLI flags and sub-commands.

I don't think it would cover the relationship between the user config name (for profiles.yml) and the CLI flag though.

dbeatty10 added a commit that referenced this issue Jan 30, 2024
[Preview](https://docs-getdbt-com-git-dbeatty-log-cache-events-config-dbt-labs.vercel.app/reference/global-configs/logs#logging-relational-cache-events)

resolves #4664

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

As noted in #4366, there is currently not any documentation for the
`log_cache_events` config.

When `True`, this flag enables verbose logging for [relational
cache](https://docs.getdbt.com/reference/global-configs/cache) events
(which can be helpful when debugging) (default to `False`).

Because it has existed since at least
[2018-11-15](dbt-labs/dbt-core#1139) (prior to
dbt v1.0), no version blocks are applicable.

## Checklist
- [x] Review the [Content style
guide](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/content-style-guide.md)
so my content adheres to these guidelines.
@jtcohen6 jtcohen6 self-assigned this Feb 21, 2024
matthewshaver added a commit that referenced this issue Feb 27, 2024
#4814)

resolves #4366
resolves #4709
resolves #4787

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

- Reframe "global configs" → "flags"
- Settable in `dbt_project.yml` instead of `profiles.yml`
- Subcategory of flags for legacy behaviors / behavior change migrations

<details>
<summary>

### Previews
</summary>

Most important changes:
-
[website/docs/reference/global-configs/about-global-configs.md](https://docs-getdbt-com-git-jerco-flags-behavior-changes-dbt-labs.vercel.app/reference/global-configs/about-global-configs)
-
[website/docs/reference/global-configs/project-flags.md](https://docs-getdbt-com-git-jerco-flags-behavior-changes-dbt-labs.vercel.app/reference/global-configs/project-flags)
-
[website/docs/reference/dbt_project.yml.md](https://docs-getdbt-com-git-jerco-flags-behavior-changes-dbt-labs.vercel.app/reference/dbt_project.yml)
-
[website/docs/reference/global-configs/legacy-behaviors.md](https://docs-getdbt-com-git-jerco-flags-behavior-changes-dbt-labs.vercel.app/reference/global-configs/legacy-behaviors)
-
[website/docs/docs/core/connect-data-platform/profiles.yml.md](https://docs-getdbt-com-git-jerco-flags-behavior-changes-dbt-labs.vercel.app/docs/core/connect-data-platform/profiles.yml)

Other new pages:
-
[website/docs/reference/global-configs/record-timing-info.md](https://docs-getdbt-com-git-jerco-flags-behavior-changes-dbt-labs.vercel.app/reference/global-configs/record-timing-info)
-
[website/docs/reference/global-configs/indirect-selection.md](https://docs-getdbt-com-git-jerco-flags-behavior-changes-dbt-labs.vercel.app/reference/global-configs/indirect-selection)

Other significant edits:
-
[website/docs/reference/global-configs/logs.md](https://docs-getdbt-com-git-jerco-flags-behavior-changes-dbt-labs.vercel.app/reference/global-configs/logs)
-
[website/docs/reference/global-configs/parsing.md](https://docs-getdbt-com-git-jerco-flags-behavior-changes-dbt-labs.vercel.app/reference/global-configs/parsing)
-
[website/docs/reference/global-configs/version-compatibility.md](https://docs-getdbt-com-git-jerco-flags-behavior-changes-dbt-labs.vercel.app/reference/global-configs/version-compatibility)
-
[website/docs/reference/global-configs/json-artifacts.md](https://docs-getdbt-com-git-jerco-flags-behavior-changes-dbt-labs.vercel.app/reference/global-configs/json-artifacts)
- website/sidebars.js
- website/vercel.json
- website/dbt-versions.js

Edited links:
-
[website/docs/docs/dbt-versions/core-upgrade/08-upgrading-to-v1.2.md](https://docs-getdbt-com-git-jerco-flags-behavior-changes-dbt-labs.vercel.app/docs/dbt-versions/core-upgrade/upgrading-to-v1.2)
-
[website/docs/docs/dbt-versions/core-upgrade/10-upgrading-to-v1.0.md](https://docs-getdbt-com-git-jerco-flags-behavior-changes-dbt-labs.vercel.app/docs/dbt-versions/core-upgrade/upgrading-to-v1.0)
-
[website/docs/docs/dbt-cloud-apis/sl-manifest.md](https://docs-getdbt-com-git-jerco-flags-behavior-changes-dbt-labs.vercel.app/docs/dbt-cloud-apis/sl-manifest)
-
[website/docs/reference/artifacts/dbt-artifacts.md](https://docs-getdbt-com-git-jerco-flags-behavior-changes-dbt-labs.vercel.app/reference/artifacts/dbt-artifacts)
-
[website/docs/reference/events-logging.md](https://docs-getdbt-com-git-jerco-flags-behavior-changes-dbt-labs.vercel.app/reference/events-logging)
-
[website/docs/reference/parsing.md](https://docs-getdbt-com-git-jerco-flags-behavior-changes-dbt-labs.vercel.app/reference/parsing)
-
[website/docs/reference/project-configs/clean-targets.md](https://docs-getdbt-com-git-jerco-flags-behavior-changes-dbt-labs.vercel.app/reference/project-configs/clean-targets)
-
[website/docs/reference/resource-configs/severity.md](https://docs-getdbt-com-git-jerco-flags-behavior-changes-dbt-labs.vercel.app/reference/resource-configs/severity)

Deleted:
- website/docs/reference/global-cli-flags.md
- website/docs/reference/global-configs/yaml-configurations.md
- website/docs/reference/project-configs/log-path.md
- website/docs/reference/project-configs/target-path.md

Minor edits (moved and re-titled):
- website/docs/reference/global-configs/command-line-options.md

Other:
- .github/pull_request_template.md

</details>

## Checklist

Adding or removing pages (delete if not applicable):
- [x] Add/remove page in `website/sidebars.js`
- [x] Provide a unique filename for new pages
- [x] Add an entry for deleted pages in `website/vercel.json`
- [x] Run link testing locally with `npm run build` to update the links
that point to deleted pages
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 priority: high Technical inaccuracy, missing/incorrect information, or broken links. Negatively affects workflows size: small This change will take 1 to 2 days to address
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants