feat: link typed template variables to their data type section#12145
Closed
kozlek wants to merge 1 commit into
Closed
Conversation
Template variables whose value is drawn from an enumerated data type now render as a link to the matching data-types section instead of as a free-form string. The engine tags such variables with a `type` token in `x-mergify-template-variables`; the docs map the token to its section (currently `queue_dequeue_reason` -> Queue Dequeue Reason). Keying off the schema-published token replaces the earlier hardcoded variable-name special-case, so a future typed variable needs only its engine annotation plus one entry in the docs token map. The bundled schema update pre-syncs the marker ahead of the automated JSON Schema sync; the bot will reconcile it identically once the engine change lands. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Change-Id: Ib15295d0fa731301b3b8d29b5af205df496f458a
Contributor
Merge Protections🔴 2 of 6 protections blocking · waiting on 👀 reviews
🔴 👀 Review RequirementsWaiting for
This rule is failing.
🔴 🔎 ReviewsWaiting for
This rule is failing.
Show 4 satisfied protections🟢 🤖 Continuous Integration
🟢 Enforce conventional commitMake sure that we follow https://www.conventionalcommits.org/en/v1.0.0/
🟢 📕 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 updates the docs rendering pipeline so template variables that are annotated in the JSON Schema as coming from an enumerated data type can be rendered as links to the corresponding Configuration Data Types section (currently queue-dequeue-reason).
Changes:
- Extend
TemplateVariablewith an optionaltypetoken sourced fromx-mergify-template-variables[].type. - Add a unit test to ensure the token is preserved by
extractTemplateVariables. - Update
TemplateVariablesTableto map known type tokens to/configuration/data-types#...anchors and render linked variables accordingly.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/util/templateVariables.ts | Adds optional type to the template variable shape; extraction continues to pass through schema-provided entries. |
| src/util/templateVariables.test.ts | Adds coverage ensuring type is retained for typed/enumerated variables. |
| src/components/Tables/TemplateVariablesTable.tsx | Introduces token→anchor mapping and renders typed variables as links to the matching data type section. |
| public/mergify-configuration-schema.json | Annotates queue_dequeue_reason template variable entries with "type": "queue-dequeue-reason". |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Template variables whose value is drawn from an enumerated data type now
render as a link to the matching data-types section instead of as a
free-form string. The engine tags such variables with a
typetoken inx-mergify-template-variables; the docs map the token to its section(currently
queue_dequeue_reason-> Queue Dequeue Reason).Keying off the schema-published token replaces the earlier hardcoded
variable-name special-case, so a future typed variable needs only its
engine annotation plus one entry in the docs token map.
The bundled schema update pre-syncs the marker ahead of the automated
JSON Schema sync; the bot will reconcile it identically once the engine
change lands.
Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com