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

DashboardScene: Skip panel repeats when values are the same #87788

Merged
merged 4 commits into from
May 15, 2024

Conversation

torkelo
Copy link
Member

@torkelo torkelo commented May 14, 2024

Fixes panels being re-repeated (and new queries issued) when coming back from dashboard settings or panel edit (or view panel)

@torkelo torkelo requested a review from a team as a code owner May 14, 2024 08:06
@torkelo torkelo requested review from mdvictor and kaydelaney and removed request for a team May 14, 2024 08:06
@torkelo torkelo added this to the 11.1.x milestone May 14, 2024
@torkelo torkelo added type/bug add to changelog backport v11.0.x Mark PR for automatic backport to v11.0.x labels May 14, 2024
Copy link
Contributor

This PR must be merged before a backport PR will be created.

1 similar comment
Copy link
Contributor

This PR must be merged before a backport PR will be created.

Copy link
Member

@dprokop dprokop left a comment

Choose a reason for hiding this comment

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

@torkelo this works good in the following scenarios:

  1. Edit dashboard / go to settings / go back to dashboard - no query
  2. Edit dashboard / go to panel edit / go back to dashboard - no query

However I've observed awkward behavior when you go to panel edit, modify the multi value variable, and go back to the dashboard. Queries are not re-executed, and all repeated panels have the same data set. See the video:

Screen.Recording.2024-05-14.at.10.33.50.mov

@torkelo
Copy link
Member Author

torkelo commented May 14, 2024

@dprokop That should be fixed after merging, #87539 the upgrade to scenes lib has this fix: grafana/scenes#727

will test after merge and check

@torkelo
Copy link
Member Author

torkelo commented May 14, 2024

@dprokop yes, after merging in main (after that row repeat PR) that issue is now fixed.

@torkelo torkelo requested a review from dprokop May 14, 2024 14:03
@dprokop
Copy link
Member

dprokop commented May 15, 2024

@dprokop yes, after merging in main (after that row repeat PR) that issue is now fixed.

@torkelo - I've merged in main(pushed) and the issue is still there, see the recording i just did:

Screen.Recording.2024-05-15.at.11.22.12.mov

NVM, my queries were not using the variable, so it didn't make sense

@torkelo torkelo merged commit 699c5bf into main May 15, 2024
14 checks passed
@torkelo torkelo deleted the item-repeats-skip-when-value-same branch May 15, 2024 10:29
Copy link
Contributor

The backport to v11.0.x failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new branch
git switch --create backport-87788-to-v11.0.x origin/v11.0.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x 699c5bfe792adfa4a9030559e249af4938859dbc

When the conflicts are resolved, stage and commit the changes:

git add . && git cherry-pick --continue

If you have the GitHub CLI installed:

# Push the branch to GitHub:
git push --set-upstream origin backport-87788-to-v11.0.x
# Create the PR body template
PR_BODY=$(gh pr view 87788 --json body --template 'Backport 699c5bfe792adfa4a9030559e249af4938859dbc from #87788{{ "\n\n---\n\n" }}{{ index . "body" }}')
# Create the PR on GitHub
echo "${PR_BODY}" | gh pr create --title "[v11.0.x] DashboardScene: Skip panel repeats when values are the same" --body-file - --label "type/bug" --label "area/frontend" --label "add to changelog" --label "backport" --base v11.0.x --milestone 11.0.x --web

Or, if you don't have the GitHub CLI installed (we recommend you install it!):

# Push the branch to GitHub:
git push --set-upstream origin backport-87788-to-v11.0.x

# Create a pull request where the `base` branch is `v11.0.x` and the `compare`/`head` branch is `backport-87788-to-v11.0.x`.

# Remove the local backport branch
git switch main
git branch -D backport-87788-to-v11.0.x

@grafana-delivery-bot grafana-delivery-bot bot added the backport-failed Failed to generate backport PR. Please resolve conflicts and create one manually. label May 15, 2024
torkelo added a commit that referenced this pull request May 15, 2024
Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
(cherry picked from commit 699c5bf)
torkelo added a commit that referenced this pull request May 15, 2024
…#87896)

DashboardScene: Skip panel repeats when values are the same (#87788)

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
(cherry picked from commit 699c5bf)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
add to changelog area/frontend backport v11.0.x Mark PR for automatic backport to v11.0.x backport-failed Failed to generate backport PR. Please resolve conflicts and create one manually. type/bug
Projects
Status: 🚀 Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants