Skip to content

Conversation

@aaron-steinfeld
Copy link
Contributor

Description

Uses the new group limit parameter in explorer api instead of the deprecated row limit behavior.

Testing

Visual verification, updated tests

Checklist:

  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • Any dependent changes have been merged and published in downstream modules

@aaron-steinfeld aaron-steinfeld requested a review from a team as a code owner March 16, 2021 20:45
groupByLimit: this.request.groupByLimit
};
protected buildRequestState(): ExploreRequestState | undefined {
// Unused since fetchResults is overriden, but abstract so requires a def
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 one's a bit weird. This is an abstract method used in the parent's fetchResults which we override in this class. It's not really relevant to this implementation since fetchResults uses an observable of state rather than building its own.

This was actually breaking the explorer, (although no one noticed) since the previous implementation was mapping the response data based on the initial state, not the current one.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah. AFAIR, the ExploreVisualizationRequest did not have all the latest request data. I think we emit on exploreQuery$: Observable<TimeUnaware<GraphQlExploreRequest>>; with latest interval data (possibly more). When i tested it last, using ExploreVisualizationRequest directly did break few use cases for me. So for correctness, I kept it the same way for this data source (but fixed the dependency in the parent data source).

Copy link
Contributor

Choose a reason for hiding this comment

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

If this is working, then you don't need to override fetchResults. Just return this.request inside buildRequestState

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As a user interacts with the explorer, all of the fields on ExploreVisualizationRequest may change, and the new queries are emitted on that observable - so we should never really be reading from ExploreVisualizationRequest directly (it's basically like the angular router snapshot vs observable state, but with more confusing naming), but we also can't build state from it either - we should always use the latest from the observable. One way to see the current issue is going to the explorer, selecting a group by key and removing the interval. Instead of getting a segmented aggregation, nothing renders (because we process the result thinking it still has an interval).

Copy link
Contributor

Choose a reason for hiding this comment

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

ah okay. It will still be confusing to a new developer. Do you think we should change the design a little bit (as a tech debt)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah, for sure.

@codecov
Copy link

codecov bot commented Mar 16, 2021

Codecov Report

Merging #698 (6d1dcf3) into main (04e3ff5) will decrease coverage by 0.01%.
The diff coverage is 83.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #698      +/-   ##
==========================================
- Coverage   85.17%   85.16%   -0.02%     
==========================================
  Files         782      782              
  Lines       16056    16042      -14     
  Branches     2056     2048       -8     
==========================================
- Hits        13676    13662      -14     
  Misses       2347     2347              
  Partials       33       33              
Impacted Files Coverage Δ
...itor/limit/explore-query-limit-editor.component.ts 100.00% <ø> (ø)
...hql/explore/explore-cartesian-data-source.model.ts 89.23% <ø> (+1.35%) ⬆️
...aphql/trace/donut/trace-donut-data-source.model.ts 100.00% <ø> (ø)
...oard/widgets/top-n/data/top-n-data-source.model.ts 91.30% <ø> (ø)
...argument/graphql-observability-argument-builder.ts 84.90% <ø> (ø)
...lorer-visualization-cartesian-data-source.model.ts 82.35% <60.00%> (-7.65%) ⬇️
...ore-query-editor/explore-query-editor.component.ts 96.77% <100.00%> (+0.22%) ⬆️
...lore-query-editor/explore-visualization-builder.ts 97.56% <100.00%> (-0.22%) ⬇️
...l/table/explore/explore-table-data-source.model.ts 75.00% <100.00%> (+1.31%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 04e3ff5...6d1dcf3. Read the comment docs.

@github-actions

This comment has been minimized.

selections: requestState.series.map(series => series.specification),
context: requestState.context,
limit: requestState.groupByLimit ?? 100,
limit: requestState.resultLimit,
Copy link
Contributor

Choose a reason for hiding this comment

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

On the consumer side, do we need to change the existing limit in modelJsons (may be) since this will now limit the number of results?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

None exist in the UI as of today (besides what you've got in flight), but in general yes - new data models that extend this will have to use the two types of limit appropriately.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@aaron-steinfeld aaron-steinfeld merged commit 3e15d82 into main Mar 16, 2021
@aaron-steinfeld aaron-steinfeld deleted the explorer-group-limit branch March 16, 2021 23:41
@github-actions
Copy link

Unit Test Results

    4 files  ±0  244 suites  ±0   15m 0s ⏱️ -57s
877 tests  - 1  877 ✔️  - 1  0 💤 ±0  0 ❌ ±0 
881 runs   - 1  881 ✔️  - 1  0 💤 ±0  0 ❌ ±0 

Results for commit 3e15d82. ± Comparison against base commit 04e3ff5.

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