Skip to content

Commit 079c4f0

Browse files
committed
add schema strict mode documentation
1 parent e735671 commit 079c4f0

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

docs/docs/reference/configuration.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ Here are a few common methods of setting environmental variables:
9494
| INFRAHUB_MISC_PRINT_QUERY_DETAILS | | | | |
9595
| INFRAHUB_MISC_START_BACKGROUND_RUNNER | | | | |
9696
| INFRAHUB_PRODUCTION | "Enable or disable the production mode, in production mode the logs are generated in JSON format" | FALSE | | |
97+
| INFRAHUB_SCHEMA_STRICT_MODE | Enable or disable schema strict mode | TRUE | | |
9798
| INFRAHUB_SECURITY_ACCESS_TOKEN_LIFETIME | Lifetime of access token in seconds | | | |
9899
| INFRAHUB_SECURITY_SECRET_KEY | The secret key used to validate authentication tokens | | | |
99100
| INFRAHUB_SECURITY_REFRESH_TOKEN_LIFETIME | Lifetime of refresh token in seconds | | | |

docs/docs/topics/schema.mdx

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1015,3 +1015,26 @@ Most changes to an existing schema are supported but there are a few properties
10151015

10161016
* When updating the identifier on a relationship, the existing relationships won't be impacted or updated even if it was the last relationship using a given identifier. [ISSUE-2472](https://github.com/opsmill/infrahub/issues/2472)
10171017
* Updating Nodes when Generics are updated [ISSUE-5793](https://github.com/opsmill/infrahub/issues/5793)
1018+
1019+
## Schema strict mode
1020+
1021+
By default, Infrahub operates in schema strict mode. This means that all the schema validators will be run every time we make a schema change, or when the CI pipeline runs schema validation checks.
1022+
1023+
There are certain scenarios, where Infrahub introduces new schema validators in new versions. This may happen because new features are introduced or because we didn't have a validator in place for certain scenarios. This may mean that you have to make changes to the existing data or schema in your instance of Infrahub before you can upgrade to a newer version. In some situations it might not be possible to make these changes immediately.
1024+
1025+
For this reason we allow you to disable schema strict mode, using the `INFRAHUB_SCHEMA_STRICT_MODE` environment variable.
1026+
1027+
The following schema validators will be disabled when the environment variable `INFRAHUB_SCHEMA_STRICT_MODE` is set to `false`:
1028+
1029+
* relationships same parent constraint validator
1030+
* `min_length` less than `max_length` attribute parameter validator
1031+
* `min_value` less than `max_value` attribute parameter validator
1032+
* HFID uses only unique attribute validator
1033+
1034+
We recommend that you re-enable schema strict mode, after you were able to make the required schema or data changes.
1035+
1036+
:::info
1037+
1038+
Schema strict mode should only be disable temporarily to ease the process of upgrading when new schema validations have been introduced. We recommend that you re-enable schema strict mode as quickly as possible.
1039+
1040+
:::

0 commit comments

Comments
 (0)