Skip to content

Conversation

@jsbroks
Copy link
Member

@jsbroks jsbroks commented Jan 16, 2026

Standardize Go templating variable casing to lowercase to ensure consistency across all templating surfaces.

Previously, ProviderContext used JSON marshaling, resulting in lowercase template keys, while TemplatableJob was passed directly, exposing PascalCase Go struct field names. This PR introduces a Map() method for TemplatableJob to convert its fields to a map with lowercase keys (matching JSON tags), aligning all templating surfaces with a consistent lowercase naming convention as requested in #738.


Open in Cursor Open in Web

This change standardizes all Go templating variables across templating
surfaces to use lowercase consistently, as proposed in issue #738.

Changes:
- Added ToTemplateData() method to TemplatableJob that converts the
  struct to a map with lowercase keys using JSON marshaling
- Updated ArgoCD dispatcher to use ToTemplateData() for template execution
- Updated TerraformCloud dispatcher to use ToTemplateData() for template
  execution
- Updated all tests to use lowercase template variables (e.g.,
  {{.resource.name}} instead of {{.Resource.Name}})

This ensures consistency with verification templating which already uses
lowercase variables (e.g., {{.release.version.tag}}).

Template variable naming now follows JSON tag conventions:
- {{.resource.name}} - resource name
- {{.environment.name}} - environment name
- {{.release.version.tag}} - release version tag
- {{.release.variables.KEY}} - release variables
- {{.job.id}} - job ID
- {{.deployment.name}} - deployment name

Closes #738

Co-authored-by: justin <justin@wandb.com>
@cursor
Copy link

cursor bot commented Jan 16, 2026

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 16, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@jsbroks jsbroks closed this Jan 16, 2026
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.

3 participants