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

Snapshots: Fix breakage of some panel types due to missing structureRev #76586

Merged
merged 1 commit into from
Oct 13, 2023

Conversation

leeoniya
Copy link
Contributor

@leeoniya leeoniya commented Oct 13, 2023

Fixes the panel rendering concerns in #64262
Fixes https://github.com/grafana/support-escalations/issues/7580

we rely on structureRev to re-configure and re-init panel options when the dataframe shape or the config struct changes. in snapshot loading this was always undefined and we did not re-init. snapshots re-render the panel 3 times (the first time with empty data), as opposed to the PanelQueryRunner, where it just renders once with data.

@@ -104,6 +104,7 @@ export class PanelQueryRunner {
state: LoadingState.Done,
series: this.dataConfigSource.snapshotData.map((v) => toDataFrame(v)),
timeRange: getDefaultTimeRange(), // Don't need real time range for snapshots
structureRev,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is just a drive-by improvement

@@ -36,6 +36,7 @@ export function loadSnapshotData(panel: PanelModel, dashboard: DashboardModel):
theme: config.theme2,
timeZone: dashboard.getTimezone(),
}),
structureRev: 1,
Copy link
Contributor Author

@leeoniya leeoniya Oct 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actual fix. should be fine to hard-code a static value cause snapshots are static, iiuc.

Copy link
Contributor

@adela-almasan adela-almasan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tested locally and works as expected!

@leeoniya leeoniya changed the title Snapshots: Fix breakage in some panel types due to missing structureRev Snapshots: Fix breakage of some panel types due to missing structureRev Oct 13, 2023
@leeoniya leeoniya merged commit 56c2d8f into main Oct 13, 2023
34 checks passed
@leeoniya leeoniya deleted the leeoniya/snapshot-structureRev branch October 13, 2023 23:56
@zerok zerok modified the milestones: 10.2.x, 10.2.0 Oct 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants