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

docs: Config overview improvement #28209

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

benjimin
Copy link

@benjimin benjimin commented Apr 1, 2024

Minor docs updates, which resulted from the docs additions in #28035 being tested in #28097.

This concerns the configuration overview. Attempts to clarify terminology (or relate to different terminology used elsewhere in the docs), and expand on how environment variables may be used in renovate.

@CLAassistant
Copy link

CLAassistant commented Apr 1, 2024

CLA assistant check
All committers have signed the CLA.

@viceice viceice changed the title Config overview docs test docs: Config overview improvement Apr 2, 2024
Copy link
Collaborator

@HonkingGoose HonkingGoose left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some style and clarity changes. Please check for technical accuracy! 🙂

- Default config (bot defaults)
- Global config (admin settings)
- Inherited config (org-level settings)
- Repository config (repo-specific customisation)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Repository config (repo-specific customisation)
- Repository config (repo-specific customization)

We use American English, so this is with a z. 🙂

Global config can contain config which is "global only" as well as any configuration options which are valid in Inherited config or Repository config.

Global config must be supplied when you run renovate locally or "self-host" renovate.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Global config must be supplied when you run renovate locally or "self-host" renovate.
Global config must be supplied when you run Renovate locally or "self-host" Renovate.

Capitalize proper nouns.

Maybe this sentence needs to be moved down a bit? We mention below how users of the Mend hosted app don't need to worry about global config. But this sentence almost sounds like all users must configure global config.

@@ -47,20 +48,28 @@ By default Renovate allows the config file to be _missing_ and does not error if
But if you have configured `RENOVATE_CONFIG_FILE` and the path you specified is not found then Renovate will error and exit, because it assumes you have a configuration problem.
If the file is found but cannot be parsed then Renovate will also error and exit.

Global config files can be `.js` or `.json` files.
Global config files can be `.js` or `.json` or `.yaml` files, and must accordingly be formatted using JavaScript, JSON or YAML syntax.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Global config files can be `.js` or `.json` or `.yaml` files, and must accordingly be formatted using JavaScript, JSON or YAML syntax.
Global config files can be `.js`, `.json` or `.yaml` files.
You must use the correct syntax for the file format, so JavaScript, JSON or YAML.

But we recommend you still check the documentation for the field `env` for each option to make sure.
If the configuration option lacks a `env` field, the config option also lacks a Environment config variable name.
As some environment variable names differ from the usual pattern, we recommend you still check the `env` field of the documentation for each config option to make sure.
If the configuration option lacks the `env` field, that config option may lack the facility to be configured by a separate environment variable.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
If the configuration option lacks the `env` field, that config option may lack the facility to be configured by a separate environment variable.
If the configuration option does not have the `env` field, that config option can not be configured by a separate environment variable.

I think something like this is easier to understand?

If the configuration option lacks the `env` field, that config option may lack the facility to be configured by a separate environment variable.

The values assigned to the environment variables may be strings, numbers, booleans, or stringified JSON.
If using stringified JSON then be careful to use appropriate escaping.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
If using stringified JSON then be careful to use appropriate escaping.
When you use stringified JSON check if you're escaping it properly.

The values assigned to the environment variables may be strings, numbers, booleans, or stringified JSON.
If using stringified JSON then be careful to use appropriate escaping.
Key names should be quoted using double quotes, as these are strings in JSON.
If environment variables are being set from a shell console or shell script, it is generally simplest to wrap the entire stringified JSON in single quotes to prevent the shell interpreter from parsing (and removing) the escaping or punctuation.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
If environment variables are being set from a shell console or shell script, it is generally simplest to wrap the entire stringified JSON in single quotes to prevent the shell interpreter from parsing (and removing) the escaping or punctuation.
If environment variables are being set from a shell console or shell script: wrap the entire stringified JSON in _single_ quotes.
This prevents the shell interpreter from parsing (and removing) the escaping or punctuation.

If using stringified JSON then be careful to use appropriate escaping.
Key names should be quoted using double quotes, as these are strings in JSON.
If environment variables are being set from a shell console or shell script, it is generally simplest to wrap the entire stringified JSON in single quotes to prevent the shell interpreter from parsing (and removing) the escaping or punctuation.
If the environment variables are being set from a file (such as a docker env-file or in a Kubernetes manifest YAML) then those outermost single-quotes should usually be removed, otherwise renovate may interpret the entire value as a simple string instead of as a compound JSON object.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
If the environment variables are being set from a file (such as a docker env-file or in a Kubernetes manifest YAML) then those outermost single-quotes should usually be removed, otherwise renovate may interpret the entire value as a simple string instead of as a compound JSON object.
If the environment variables are being set from a file (such as a Docker env-file or in a Kubernetes manifest YAML) then those _outermost_ single-quotes should be removed.
This prevents Renovate from wrongly interpreting the entire value as a simple string.

Copy link
Collaborator

@HonkingGoose HonkingGoose left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two small fixes to resolve a linter complaint.

The config options that you can use in environment variables all have the prefix `RENOVATE_`.
Most config options can be set using environment variables.
The environment variable name is usually found by adding the prefix `RENOVATE_` to the config option name in all-uppercase.
(This prefix can be changed by setting the environment variable `ENV_PREFIX`.)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
(This prefix can be changed by setting the environment variable `ENV_PREFIX`.)
(This prefix can be changed by setting the environment variable `ENV_PREFIX`.)

You may use synchronous or asynchronous methods inside a `.js` file, including even to fetch config information from remote hosts.

#### Environment config

Global config can be defined using environment variables.
The config options that you can use in environment variables all have the prefix `RENOVATE_`.
Most config options can be set using environment variables.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Most config options can be set using environment variables.
Most config options can be set using environment variables.

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.

None yet

3 participants