docs: document the variable-substitution templating language#11913
Conversation
Merge Protections🟢 All 6 merge protections satisfied — ready to merge. Show 6 satisfied protections🟢 🤖 Continuous Integration
🟢 👀 Review Requirements
🟢 Enforce conventional commitMake sure that we follow https://www.conventionalcommits.org/en/v1.0.0/
🟢 🔎 Reviews
🟢 📕 PR description
🟢 🚦 Auto-queueWhen all merge protections are satisfied, this pull request will be queued automatically. |
There was a problem hiding this comment.
Pull request overview
This PR documents Mergify’s new variable-substitution templating behavior in the docs and introduces a TemplateVariablesTable React component to render each templated field’s allowed variables directly from the configuration JSON schema.
Changes:
- Adds a “Variable substitution” concept section to
/configuration/data-types, including limitations and a short Jinja2 migration mapping. - Updates several workflow action pages to reference variable substitution and to render an “Available variables” table per field.
- Adds schema-driven variable extraction/rendering utilities, and adjusts options-table rendering to avoid duplicating “Allowed variables” text.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 13 comments.
Show a summary per file
| File | Description |
|---|---|
| src/util/templateVariables.ts | Adds recursive extraction of x-mergify-template-variables from JSON Schema fragments. |
| src/util/templateVariables.test.ts | Adds Vitest coverage for the extractor across common schema shapes. |
| src/components/Tables/TemplateVariablesTable.tsx | New table component to render published variables for a schema field. |
| src/components/Tables/OptionsTable.tsx | Strips duplicated “Allowed variables” text for simple-template descriptions (now expected to be shown via the variables table). |
| src/components/Tables/ConfigOptions.tsx | Links simple-template value types to the new docs concept section. |
| src/content/docs/configuration/data-types.mdx | Adds “Variable substitution” section and clarifies that Jinja2 remains only for specific fields. |
| src/content/docs/workflow/actions/comment.mdx | Adds “Available variables” section and Jinja2 deprecation note for message. |
| src/content/docs/workflow/actions/review.mdx | Adds “Available variables” section and Jinja2 deprecation note for message. |
| src/content/docs/workflow/actions/close.mdx | Adds “Available variables” section and Jinja2 deprecation note for message. |
| src/content/docs/workflow/actions/copy.mdx | Updates templating guidance and adds variable table + deprecation note for title/body. |
| src/content/docs/workflow/actions/backport.mdx | Updates templating guidance and examples; adds variable table + deprecation note for title/body. |
| src/content/docs/workflow/actions/github_actions.mdx | Adds variable table + deprecation note for templated workflow inputs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
9d6355c to
82d1dc7
Compare
Revision history
|
82d1dc7 to
01457dd
Compare
01457dd to
0e1688c
Compare
0e1688c to
428c7da
Compare
Document each templated field's variable set as a named data type in data-types.mdx (Message template, Copy title template, Copy body template, Workflow input template), each rendering its variables from the JSON schema via a new TemplateVariablesTable component that reads the x-mergify-template-variables annotation. The simple-template field type in each action's Parameters table shows its data-type title and links to it (getValueType: title->anchor, plus 'map of' for the github_actions inputs map), so feature pages reference the variable set rather than replicating a table. Adds a Variable substitution concept section with a Jinja2 migration cheat-sheet, and re-scopes the legacy Jinja2 Template section to the fields that still use it (post_check, merge). Change-Id: I530a11f43adb18ff3fdc964199e00d52d105a2b7
428c7da to
2128558
Compare
|
This pull request is part of a Mergify stack:
|
|
Queued — the merge queue status continues in this comment ↓. |
Merge Queue Status
This pull request spent 2 minutes 38 seconds in the queue, including 1 minute 59 seconds running CI. Required conditions to merge
|
Document each templated field's variable set as a named data type in
data-types.mdx (Message template, Copy title template, Copy body template,
Workflow input template), each rendering its variables from the JSON schema via a
new TemplateVariablesTable component that reads the x-mergify-template-variables
annotation. The simple-template field type in each action's Parameters table shows
its data-type title and links to it (getValueType: title->anchor, plus 'map of'
for the github_actions inputs map), so feature pages reference the variable set
rather than replicating a table. Adds a Variable substitution concept section with
a Jinja2 migration cheat-sheet, and re-scopes the legacy Jinja2 Template section to
the fields that still use it (post_check, merge).