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

AngularMigration: Allow dashboard by dashboard migration #84100

Merged
merged 30 commits into from Mar 27, 2024

Conversation

adela-almasan
Copy link
Contributor

@adela-almasan adela-almasan commented Mar 7, 2024

This PR allows to do the Angular migration dashboard by dashboard and removes the confusion from the initial approach - where the feature flag would migrate all dashboards until the next page refresh, so the user could end up with broken dashboards without the ability to see how the dashboard was looking before.

The URL feature flags are treated as strings and are bypassing the previous implementation. I'm expecting to revert to that functionality after we're done with the migrations.

migration_banners.mov

Special notes for your reviewer:

  • Know issue -> after saving a dashboard the revert banner will persist until refresh. I believe we can fix this in a follow-up, as the user is instructed to save and refresh the dashboard to persist the migration.

Please check that:

  • It works as expected from a user's perspective.
  • If this is a pre-GA feature, it is behind a feature toggle.
  • The docs are updated, and if this is a notable improvement, it's added to our What's New doc.

@grafana-delivery-bot grafana-delivery-bot bot added this to the 11.0.x milestone Mar 7, 2024
@adela-almasan adela-almasan self-assigned this Mar 11, 2024
@adela-almasan adela-almasan changed the title AngularMigration: Url feature flags AngularMigration: Allow dashboard by dashboard migration Mar 11, 2024
@yosiasz
Copy link

yosiasz commented Mar 18, 2024

Both links above take you gete.

Screenshot_20240318-033731_Chrome

@adela-almasan adela-almasan added area/dashboard no-backport Skip backport of PR no-changelog Skip including change in changelog/release notes labels Mar 20, 2024
Copy link
Contributor

@nmarrs nmarrs left a comment

Choose a reason for hiding this comment

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

Code wise I think this PR is looking great

I am struggling a little bit to test this locally though. I set the angularDeprecationUI feature toggle to true in my custom.ini file but I'm not able to get it to show up without hard coding 😬

Graph old-1710986755154.json

I also noticed that our gdev panel migration dashboard functionality seems to be broken with these changes 🤔

Screen.Recording.2024-03-20.at.7.11.44.PM.mov

public/app/features/dashboard/containers/DashboardPage.tsx Outdated Show resolved Hide resolved
panel.type === 'graph' &&
(shouldMigrateAllAngularPanels ||
config.featureToggles.autoMigrateGraphPanel ||
isUrlFeatureFlagEnabled('autoMigrateGraphPanel'))
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this ever happen via the "try migration" button in the banner? Or does that always set the autoMigrateOldPanels feature toggle to true? In which case this code is meant to support the manual case of testing granular panel by panel migration via url query params?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes this gets triggered via "try migration", it's not setting/allowing any feature flags and it's just checking the url for the ff and migrates only the current dashboard.

Copy link
Member

@xnyo xnyo left a comment

Choose a reason for hiding this comment

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

Awesome work!! 👏 👏 👏 👏

I have a few comments/questions but the code is looking good!

I tried it locally and it seems to work well! I have also tried @nmarrs dashboard and for me it worked without any issues 🤔

@adela-almasan
Copy link
Contributor Author

@nmarrs the gdev dashboard is migrating fine for me 🤔

@nmarrs
Copy link
Contributor

nmarrs commented Mar 21, 2024

@nmarrs the gdev dashboard is migrating fine for me 🤔

I will re-review later today - maybe all the things I hard coded for testing was messing things up 😅

Copy link
Member

@xnyo xnyo left a comment

Choose a reason for hiding this comment

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

LGTM! Awesome work! 🚀🚀

Works fine for me, but I would wait to see if we can reproduce the issue that @nmarrs was having before merging this

@ashharrison90 ashharrison90 modified the milestones: 11.0.x, 11.1.x Mar 26, 2024
Copy link
Contributor

@nmarrs nmarrs left a comment

Choose a reason for hiding this comment

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

LGTM - thanks for pair reviewing with me @leeoniya / @adela-almasan 😬

We discovered a strange case where the banner isn't appearing in the Devenv - panel migrations dashboard, but the revert banner appears once a migration is applied 🤔

Screen.Recording.2024-03-27.at.1.08.04.PM.mov

Also, just a note - I think that we want to target v11.0.x (and not v11.1.x) for this change - though maybe it doesn't matter either way as post v11 angular support will be disabled by default

Note: to test this + future angular migrations in the future you will need to add
angular_support_enabled = true to your custom.ini file as this PR has disabled angular by default

Test dashboard :)

@adela-almasan
Copy link
Contributor Author

@xnyo I've update the local storage key, to force the banner to show even for those who have dismissed it before - now everybody should see the migrate button. This was the case for @nmarrs's above issue.

@adela-almasan adela-almasan merged commit e5d1cd8 into main Mar 27, 2024
18 checks passed
@adela-almasan adela-almasan deleted the migration_url branch March 27, 2024 21:24
@ashharrison90 ashharrison90 modified the milestones: 11.1.x, 11.0.0-preview Apr 16, 2024
@ashharrison90 ashharrison90 added product-approved Pull requests that are approved by product/managers and are allowed to be backported backport v11.0.x Mark PR for automatic backport to v11.0.x and removed no-backport Skip backport of PR labels Apr 16, 2024
grafana-delivery-bot bot pushed a commit that referenced this pull request Apr 16, 2024
ashharrison90 pushed a commit that referenced this pull request Apr 16, 2024
…86330)

AngularMigration: Allow dashboard by dashboard migration (#84100)

(cherry picked from commit e5d1cd8)

Co-authored-by: Adela Almasan <88068998+adela-almasan@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/dashboard area/frontend backport v11.0.x Mark PR for automatic backport to v11.0.x no-changelog Skip including change in changelog/release notes product-approved Pull requests that are approved by product/managers and are allowed to be backported type/angular-2-react Angular -> React migration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants