Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport of config generation: escape map keys with whitespace into v1.9 #35771

Merged
merged 1 commit into from
Sep 24, 2024

Conversation

github-actions[bot]
Copy link
Contributor

Backport

This PR is auto-generated from #35754 to be assessed for backporting due to the inclusion of the label 1.9-backport.

The below text is copied from the body of the original PR.


This PR updates the config generation package so map keys with whitespace are escaped with quotes. This is already handled automatically for the normal attribute generation, and nested blocks are also escaped by default. This PR updates the nested attributes so the keys of nested maps are validated and escaped if necessary. It is only maps that have this problem, attributes in objects cannot contain whitespace and other types (lists, sets, tuples) do not render keys anyway.

The rendering package has this same problem, and so far we've not handled it perfectly but just well enough. We'll continue to do so here, but the code calls out we could modify the HCL library so it exposes the internal functions it uses to detect when escaping is necessary and share those between HCL and Terraform. But so far, we've not had any need to take this too seriously.

Fixes #35752

Target Release

1.9.x

Draft CHANGELOG entry

BUG FIXES

  • config generation: escape map keys with whitespaces

Overview of commits

@github-actions github-actions bot force-pushed the backport/liamcervante/35752/properly-quiet-gnu branch from 46bfa01 to e1a770f Compare September 24, 2024 10:51
@DanielMSchmidt DanielMSchmidt force-pushed the backport/liamcervante/35752/properly-quiet-gnu branch from e1a770f to 1edaa98 Compare September 24, 2024 10:53
@DanielMSchmidt DanielMSchmidt marked this pull request as ready for review September 24, 2024 10:53
@DanielMSchmidt DanielMSchmidt merged commit ad00493 into v1.9 Sep 24, 2024
10 checks passed
@DanielMSchmidt DanielMSchmidt deleted the backport/liamcervante/35752/properly-quiet-gnu branch September 24, 2024 11:04
Copy link
Contributor Author

Reminder for the merging maintainer: if this is a user-visible change, please update the changelog on the appropriate release branch.

Copy link
Contributor Author

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants