fix(gcp*): enforce string type for project_id in YAML templates - #14765
Merged
Conversation
This change adds explicit YAML string type casting using the `!!str` tag
to the project_id field across all GCP data stream template files. The
modification ensures that project identifiers are parsed as string
values in the generated YAML configuration, preventing potential issues
that could arise from numeric project IDs being interpreted as integers
by YAML parsers.
GCP project identifiers may appear numeric but must always be handled as
string identifiers to maintain their integrity and prevent parsing
errors. The YAML `!!str` type tag forces the parser to treat these
values as strings regardless of their appearance, eliminating any
ambiguity during configuration processing.
I considered using the escape_string Handlebar helper function but went
with !!str because it's a pure YAML solution to the problem.
[git-generate]
perl -i -p -e 's/^project_id: \{\{project_id\}\}/project_id: !!str {{project_id}}/g' packages/gcp*/**/*.yml.hbs
[git-generate] for i in packages/gcp*; do elastic-package -C $i changelog add --description 'Fixed GCP project ID handling to prevent numeric parsing issues by enforcing string type casting in YAML configuration templates.' --next patch --type bugfix --link elastic#14765; done
andrewkroh
marked this pull request as ready for review
July 31, 2025 14:21
|
Pinging @elastic/security-service-integrations (Team:Security-Service Integrations) |
Contributor
🚀 Benchmarks reportTo see the full report comment with |
|
💚 Build Succeeded
History
|
efd6
approved these changes
Jul 31, 2025
ishleenk17
approved these changes
Aug 1, 2025
5 tasks
5 tasks
kaiyan-sheng
approved these changes
Aug 15, 2025
Contributor
|
Package gcp - 2.42.2 containing this change is available at https://epr.elastic.co/package/gcp/2.42.2/ |
Contributor
|
Package gcp_metrics - 0.3.1 containing this change is available at https://epr.elastic.co/package/gcp_metrics/0.3.1/ |
Contributor
|
Package gcp_pubsub - 2.2.1 containing this change is available at https://epr.elastic.co/package/gcp_pubsub/2.2.1/ |
Contributor
|
Package gcp_vertexai - 1.3.1 containing this change is available at https://epr.elastic.co/package/gcp_vertexai/1.3.1/ |
tehbooom
pushed a commit
to tehbooom/integrations
that referenced
this pull request
Nov 19, 2025
…tic#14765) This change adds explicit YAML string type casting using the `!!str` tag to the project_id field across all GCP data stream template files. The modification ensures that project identifiers are parsed as string values in the generated YAML configuration, preventing potential issues that could arise from numeric project IDs being interpreted as integers by YAML parsers. GCP project identifiers may appear numeric but must always be handled as string identifiers to maintain their integrity and prevent parsing errors. The YAML `!!str` type tag forces the parser to treat these values as strings regardless of their appearance, eliminating any ambiguity during configuration processing. I considered using the escape_string Handlebar helper function but went with !!str because it's a pure YAML solution to the problem. [git-generate] perl -i -p -e 's/^project_id: \{\{project_id\}\}/project_id: !!str {{project_id}}/g' packages/gcp*/**/*.yml.hbs
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.




Proposed commit message
This change adds explicit YAML string type casting using the
!!strtag to the project_id field across all GCP data stream template files. The modification ensures that project identifiers are parsed as string values in the generated YAML configuration, preventing potential issues that could arise from numeric project IDs being interpreted as integers by YAML parsers.GCP project identifiers may appear numeric but must always be handled as string identifiers to maintain their integrity and prevent parsing errors. The YAML
!!strtype tag forces the parser to treat these values as strings regardless of their appearance, eliminating any ambiguity during configuration processing.I considered using the escape_string Handlebar helper function but went with !!str because it's a pure YAML solution to the problem.
Checklist
changelog.ymlfile.Author's Checklist
How to test this PR locally
Related issues
Screenshots