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

fix: propagate ad hoc displayAsLabel migrated attr filter immediately #5988

Merged
merged 1 commit into from
Feb 28, 2025

Conversation

xMort
Copy link
Contributor

@xMort xMort commented Feb 27, 2025

If a filter was created before the introduction of the ‘support duplicated label values’ feature, it is migrated to the new configuration ad hoc during initialization. Previously, the new configuration was only propagated to the filter’s parent application when the user opened the filter, made changes, and applied them.

After the change, the migration is now detected during filter initialization and reported immediately.

There are some consequences:

  • If dashboard component starts in edit mode, Save button is enabled if filter was migrated. This does not happen in view mode.
  • Filters can be stored in filter view in the old format when user save view quicker than all filters load values and mark themselves as "initialized: success"

JIRA: LX-824
risk: low


Important

Please, don't forget to run rush change for the commits that introduce new features or significant changes 🙏 This information is used to generate the change log.


Run extended test by pull request comment

Commands can be triggered by posting a comment with specific text on the pull request. It is possible to trigger multiple commands simultaneously.

extended-test --backstop | --integrated | --isolated | --record [--filter <file1>,<file2>,...,<fileN>]

Explanation

  • --backstop The command to run screen tests.
  • --integrated The command to run integrated tests against the live backend.
  • --isolated The command to run isolated tests against recordings.
  • --record The command to create new recordings for isolated tests.
  • --filter (Optional) A comma-separated list of test files to run. This parameter is valid only for the --integrated, --isolated, and --record commands.

Examples

extended-test --backstop
extended-test --integrated
extended-test --integrated --filter test1.spec.ts,test2.spec.ts
extended-test --isolated
extended-test --isolated --filter test1.spec.ts,test2.spec.ts
extended-test --record
extended-test --record --filter test1.spec.ts,test2.spec.ts

@xMort xMort requested a review from kandl as a code owner February 27, 2025 16:36
Copy link
Contributor

@ondrejvelisek ondrejvelisek left a comment

Choose a reason for hiding this comment

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

Just read through because currently working on same piece of code. Had one question.

@@ -780,6 +780,8 @@ function useCallbacks(
}
}, [handler, supportsKeepingDependentFiltersSelection, supportsShowingFilteredElements]);

useReportMigratedFilter(handler, onApply);
Copy link
Contributor

Choose a reason for hiding this comment

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

I would expect this to reexecute the dashboard insights on init. Which might be perf/resource problem.

Did not test it though.

If not, can you please explain me why not?

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, it will cause double execution. This is the cost to get the features that are affected working.

The code is triggered only on old dashboards with filters that use alt labels. You can edit the dashboard, change something in the filter, change it back, save the dashboard, and the code will stop triggering as it is no longer needed.

I'm afraid we will have to do metadata migration of all the affected dashboards down the road which will fix this permanently.

@xMort xMort force-pushed the pdo-lx-824-migrate-attr-filter-label branch 2 times, most recently from 15b5555 to 01585e3 Compare February 28, 2025 11:02
If a filter was created before the introduction of the ‘support
duplicated label values’ feature, it is migrated to the new
configuration ad hoc during initialization. Previously, the new
configuration was only propagated to the filter’s parent application
when the user opened the filter, made changes, and applied them.

After the change, the migration is now detected during filter
initialization and reported immediately.

There are some consequences:
- If dashboard component starts in edit mode, Save button is enabled
  if filter was migrated. This does not happen in view mode.
- Filters can be stored in filter view in the old format when user
  save view quicker than all filters load values and mark themselves
  as "initialized: success"
- Dashboard is double executed in the case when invalid filters are
  migrated

JIRA: LX-824
risk: low
@xMort xMort force-pushed the pdo-lx-824-migrate-attr-filter-label branch from 01585e3 to 097936b Compare February 28, 2025 11:17
@xMort xMort enabled auto-merge February 28, 2025 11:29
@xMort xMort merged commit 715c2a9 into master Feb 28, 2025
15 checks passed
@xMort xMort deleted the pdo-lx-824-migrate-attr-filter-label branch February 28, 2025 11:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants