-
Notifications
You must be signed in to change notification settings - Fork 477
fix(gcp*): enforce string type for project_id in YAML templates #14765
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
fix(gcp*): enforce string type for project_id in YAML templates #14765
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
Pinging @elastic/security-service-integrations (Team:Security-Service Integrations) |
🚀 Benchmarks reportTo see the full report comment with |
|
💚 Build Succeeded
History
|
Package gcp - 2.42.2 containing this change is available at https://epr.elastic.co/package/gcp/2.42.2/ |
Package gcp_metrics - 0.3.1 containing this change is available at https://epr.elastic.co/package/gcp_metrics/0.3.1/ |
Package gcp_pubsub - 2.2.1 containing this change is available at https://epr.elastic.co/package/gcp_pubsub/2.2.1/ |
Package gcp_vertexai - 1.3.1 containing this change is available at https://epr.elastic.co/package/gcp_vertexai/1.3.1/ |
Proposed commit message
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.
Checklist
changelog.yml
file.Author's Checklist
How to test this PR locally
Related issues
Screenshots