Repository navigation
fix(keda): show JSON-based scaler config in the resources editor - #3184
Conversation
|
View your CI Pipeline Execution ↗ for commit cb66595
💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗ ☁️ Nx Cloud last updated this comment at |
There was a problem hiding this comment.
All reported issues were addressed across 1 file
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## staging #3184 +/- ##
===========================================
+ Coverage 55.50% 55.79% +0.28%
===========================================
Files 1395 1391 -4
Lines 31307 31172 -135
Branches 9508 9509 +1
===========================================
+ Hits 17378 17391 +13
+ Misses 11228 11078 -150
- Partials 2701 2703 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
All reported issues were addressed across 7 files (changes from recent commits).
Requires human review: Auto-approval blocked because this review re-detected 1 unresolved issue already reported by Cubic.
View guided diff | Turn on auto-fix | Re-trigger cubic
KEDA scalers created through the Terraform provider with a JSON config only populate `config_json`, while the console editor only read `config_yaml` when building form defaults, leaving the scaler config field empty. Fall back to stringifying `config_json` since the editor accepts YAML, which is a superset of JSON. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…JSON Share a parseScalerJsonConfig helper between the scaler editor and the autoscaling payload, so the editor warns when a JSON-based config will be saved as YAML. Add payload tests for valid JSON that isn't an object. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
f55e05a to
cb66595
Compare
|
🎉 This PR is included in version 1.382.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Summary
Issue: Pylon #5246
KEDA scalers created through the Terraform provider with a JSON-based config only populate
config_jsonon the autoscaling response. The resources settings form only readconfig_yamlwhen building its default values, so the scaler configuration editor rendered empty for these scalers, even though the scaler itself was correctly configured and running.This PR displays, edits and saves these scalers as JSON:
config_yamlis absent, the form loadsconfig_jsonpretty-printed and marks the scaler as JSON-based (configFormat: 'json').Configuration (JSON)/Configuration (YAML)), syntax highlighting and hint follow the scaler's format. If a JSON-based config stops being a valid JSON object, a warning says it will be saved as YAML.config_json, so saving from the Console doesn't switch a Terraform-managed scaler toconfig_yaml(which would create drift). Content that isn't a valid JSON object falls back toconfig_yaml. Both the editor warning and the payload use the sameparseScalerJsonConfighelper.Changes:
service-resources-settings.tsx:getDefaultValuesfalls back toconfig_jsonand setsconfigFormat.keda-scalers-fields.tsx: dynamic label, editor language and hint, plus the invalid-JSON warning.autoscaling-payload.ts:configFormatis passed through the form request,parseScalerJsonConfigis exported, and JSON scalers are sent asconfig_json.application-creation-flow.interface.ts: optionalconfigFormaton scalers. New scalers default to YAML, and the service creation flow is unchanged.config_jsonfallback andconfig_yamlprecedence, the dynamic label and warning, and the payload format, including invalid JSON and valid JSON that isn't an object.Screenshots / Recordings
Configuration (JSON)showing the pretty-printed JSON configTesting
yarn testoryarn test -u(if you need to regenerate snapshots)yarn formatyarn lintPR Checklist
.cursor/rules)feat(service): add new Terraform service) - required for semantic-release🤖 Generated with Claude Code