Skip to content

Commit 2365bea

Browse files
so0kclaude
andcommitted
docs: point the hand-maintained constraint maps at the vendored matrix
providerFeatureConstraints (usage boundaries, packages/cdktn) and SCHEMA_EMISSION_BOUNDARIES (fetching-CLI emission boundaries, @cdktn/provider-schema) now name features-matrix.json as their source, cross-reference each other, and spell out the deliberate OpenTofu provider-functions exception (language support 1.7.0 vs schema emission 1.8.0). The matrix README gains an in-repo consumers section. An automated drift check between the maps and the matrix is tracked in #309. From PR #296 review. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 298ed8f commit 2365bea

3 files changed

Lines changed: 51 additions & 1 deletion

File tree

packages/@cdktn/provider-schema/src/emission-check.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,19 @@ export type SchemaEmissionFamily =
2424
const TARGET_PRODUCTS = ["terraform", "opentofu"] as const;
2525
type TargetProduct = (typeof TARGET_PRODUCTS)[number];
2626

27+
/**
28+
* Hand-maintained from `tools/provider-feature-availability/features-matrix.json`
29+
* — specifically each feature's `documented_emitted_from` /
30+
* `observed_introduced` fields per product (see that directory's README for
31+
* how the dataset itself is produced/regenerated, and its "In-repo
32+
* consumers" section for how this map and `providerFeatureConstraints` in
33+
* `packages/cdktn/src/provider-feature-constraints.ts` relate to the
34+
* matrix and to each other).
35+
*
36+
* There is no automated check that this map stays in sync with the matrix;
37+
* updates must be applied by hand when the matrix changes. An automated
38+
* drift check is tracked in #309.
39+
*/
2740
export const SCHEMA_EMISSION_BOUNDARIES: Record<
2841
SchemaEmissionFamily,
2942
Record<TargetProduct, string>

packages/cdktn/src/provider-feature-constraints.ts

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,23 @@ import { TerraformFeatureVersionConstraints } from "./validations/validate-terra
55
/**
66
* Minimum CLI version per product required for a provider-protocol feature
77
* family, hand-maintained from `tools/provider-feature-availability/features-matrix.json`
8-
* (see that directory's README for how the dataset is produced/regenerated).
8+
* (see that directory's README for how the dataset is produced/regenerated,
9+
* and its "In-repo consumers" section for how this map relates to the
10+
* matrix and to the sibling `SCHEMA_EMISSION_BOUNDARIES` map in
11+
* `packages/@cdktn/provider-schema/src/emission-check.ts`).
12+
*
13+
* These are *usage* (language-support) boundaries, not schema-emission
14+
* boundaries — the two can differ per feature. In particular,
15+
* `providerFunctions.opentofu` is deliberately pinned to `>=1.7.0`, the
16+
* version where OpenTofu's HCL parser started accepting
17+
* `provider::ns::fn()`, even though `tofu providers schema -json` only
18+
* starts emitting the `functions` key from 1.8.0 (see
19+
* `SCHEMA_EMISSION_BOUNDARIES.functions.opentofu`). Do not "fix" this
20+
* mismatch without checking the matrix and the emission-check module first.
21+
*
22+
* There is no automated check that this map stays in sync with the matrix;
23+
* updates must be applied by hand when the matrix changes. An automated
24+
* drift check is tracked in #309.
925
*
1026
* Used by synth-time `ValidateFeatureTargetSupport` checks against a
1127
* project's declared `targetVersions`. Deliberately not exported from

tools/provider-feature-availability/README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,27 @@ Note the provider-functions asymmetry: OpenTofu supports the
1717
validation uses the language boundary, schema acquisition the emission
1818
boundary.
1919

20+
## In-repo consumers
21+
22+
Two hand-maintained maps are derived from this matrix and must be kept in
23+
sync with it by hand:
24+
25+
- `packages/cdktn/src/provider-feature-constraints.ts`
26+
`providerFeatureConstraints`, the _usage_ boundaries (language support) per
27+
feature family, keyed off each feature's `documented_ga`/language-support
28+
version here. This is where the deliberate OpenTofu `providerFunctions`
29+
exception lives: 1.7.0 (language support) rather than 1.8.0 (schema
30+
emission).
31+
- `packages/@cdktn/provider-schema/src/emission-check.ts`
32+
`SCHEMA_EMISSION_BOUNDARIES`, the _schema-emission_ boundaries (when
33+
`providers schema -json` starts including the family's key) per feature
34+
family, keyed off each feature's `documented_emitted_from` /
35+
`observed_introduced` fields here.
36+
37+
There is no automated check today that these two maps agree with
38+
`features-matrix.json` — updates must be applied by hand when the matrix
39+
changes. An automated drift check is tracked in #309.
40+
2041
## Regenerating
2142

2243
Only the matrix JSON is vendored in this repo. The baseline data sweep that

0 commit comments

Comments
 (0)