fix: handle wrapped dashboards and inject inputs in portables converter#169
Open
kcorbett-hdx wants to merge 1 commit into
Open
fix: handle wrapped dashboards and inject inputs in portables converter#169kcorbett-hdx wants to merge 1 commit into
kcorbett-hdx wants to merge 1 commit into
Conversation
- grafana_gen: unwrap {"dashboard": {...}} bundle format before processing,
inject datasource __inputs entry when missing, add constant template
variables from templating.list as __inputs, and always include datasource
in resources.gfo.yaml inputs
- discoverer: unwrap {"dashboard": {...}} format when reading source
dashboards, fall back to extracting constant variables from
templating.list when __inputs is absent
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Summary
grafana_gen.py: Unwraps{"dashboard": {...}}bundle format before processing dashboards, injects the required datasource entry into__inputswhen missing, adds constant template variables fromtemplating.listas__inputs, and always includes the datasource inresources.gfo.yamlinputsdiscoverer.py: Unwraps{"dashboard": {...}}format when reading source dashboards, falls back to extracting constant variables fromtemplating.listas inputs when__inputsis absentContext
Bundle-format dashboards use a
{"dashboard": {...}}wrapper and store table/datasource references as plain constant variables (e.g.raw_table = "__PROJECT_NAME__.__TABLE_NAME__") rather than Grafana__inputs. The portables converter previously produced output dashboards with no__inputsbeyond the datasource, andresources.gfo.yamlwith noinputsentries — both required for CaC deployment.Test plan
python3 scripts/bundle_to_yaml.py --source aws/cdn-insights --verboseand confirm all 4 phases pass__inputswith datasource + all constant template variablesresources.gfo.yamlcontains aninputsmap for each dashboardtrafficpeak/securitystill converts correctly (dashboards already have__inputs— existing path unchanged)🤖 Generated with Claude Code