Skip to content

DataSourceAPI: Rename getApplicableFilters to getFiltersApplicability #107775

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

Merged
merged 3 commits into from
Jul 22, 2025

Conversation

mdvictor
Copy link
Contributor

@mdvictor mdvictor commented Jul 8, 2025

What is this feature?

Changes a bit the newly exposed method that allows a datasource to verify which adhoc filters are applicable in a dashboard or not. The name has changed and also the response: an array of objects that contain the filter key, applicable or not flag and a reason message for non-applicability are now returned.

Why do we need this feature?

Allows us to work better with the non applicable filters and also show a tooltip on why it is invalid

Who is this feature for?

Everyone

Which issue(s) does this PR fix?:

Fixes #

Special notes for your reviewer:

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.

@mdvictor mdvictor requested a review from dprokop July 8, 2025 12:45
@grafana-pr-automation
Copy link
Contributor

grafana-pr-automation bot commented Jul 8, 2025

⚠️   Possible breaking changes (md version)   ⚠️

grafana-data

Removals

DataSourceApi.getApplicableFilters
/home/runner/work/grafana/grafana/base/grafana-data/dist/types/types/datasource.d.ts
getApplicableFilters?(options?: DataSourceGetTagKeysOptions): Promise;

Changes

DataSourceApi.importQueries
/home/runner/work/grafana/grafana/pr/grafana-data/dist/types/types/datasource.d.ts
Parameter type changed:
     metricFindQuery?(query: any, options?: LegacyMetricFindQueryOptions): Promise;
     /**
      * Verify adhoc filters applicability based on queries and current filters
      */
-    getApplicableFilters?(options?: DataSourceGetTagKeysOptions): Promise;
+    getFiltersApplicability?(options?: DataSourceGetTagKeysOptions): Promise;
     /**
      * Get tag keys for adhoc filters
      */
     getTagKeys?(options?: DataSourceGetTagKeysOptions): Promise | Promise;


Read our guideline

  • Your pull request merge won't be blocked.

@grafana-pr-automation grafana-pr-automation bot added the levitate breaking change A label indicating a breaking change and assigned by Levitate. label Jul 8, 2025
@grafana-pr-automation grafana-pr-automation bot requested review from a team and Ukochka and removed request for a team July 8, 2025 12:50
Comment on lines 646 to 650
export interface FiltersApplicability {
key: string;
applicable: boolean;
reason?: string;
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

let's add doc comments for these, especially reason

@grafana-pr-automation grafana-pr-automation bot requested a review from a team July 9, 2025 13:08
@mdvictor mdvictor requested a review from dprokop July 10, 2025 14:59
@mdvictor mdvictor marked this pull request as ready for review July 10, 2025 14:59
@mdvictor mdvictor requested a review from a team as a code owner July 10, 2025 14:59
@mdvictor mdvictor requested review from samsch and ashharrison90 and removed request for a team July 10, 2025 14:59
@github-actions github-actions bot added this to the 12.1.x milestone Jul 10, 2025
@mdvictor mdvictor added the no-changelog Skip including change in changelog/release notes label Jul 22, 2025
@mdvictor mdvictor merged commit b9997d8 into main Jul 22, 2025
119 of 122 checks passed
@mdvictor mdvictor deleted the mdvictor/applicability-refactor branch July 22, 2025 07:15
macabu pushed a commit that referenced this pull request Jul 22, 2025
…ity` (#107775)

* refactor getApplicableFilters to getFiltersApplicability

* add origin property as well

* add comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/frontend levitate breaking change A label indicating a breaking change and assigned by Levitate. no-changelog Skip including change in changelog/release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants