Skip to content

Conversation

@filipgutica
Copy link
Contributor

@filipgutica filipgutica commented Oct 29, 2025

Summary

BREAKING CHANGE: metric provider props updated to accept explore style time range

  • Update Golden Signals renderer to handle this breaking change
  • Update associated component and unit tests
  • Remove "QueryTime" and associated files/usage

@filipgutica filipgutica requested a review from a team as a code owner October 29, 2025 15:43
@filipgutica filipgutica force-pushed the fix/update-metric-provider-timeframe branch 2 times, most recently from 7ce4d8b to f214e76 Compare October 29, 2025 20:31
datasource?: QueryDatasource
maxTimeframe?: TimeframeKeys
overrideTimeframe?: Timeframe
tz?: string
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed tz as a prop as it can just be provided with the time range?

Copy link
Contributor

Choose a reason for hiding this comment

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

Good call.

Copy link
Contributor

@adorack adorack left a comment

Choose a reason for hiding this comment

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

I'd like to review.

Copy link
Contributor

@adorack adorack left a comment

Choose a reason for hiding this comment

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

(Haven't looked at ui-apps yet.)

I think as long as some of the queryTime code remains, the tests that exercise it should remain as well. I think that means it's feasible to remove a lot of the tests, but there are some absolute time tests in there that are probably still relevant?

datasource?: QueryDatasource
maxTimeframe?: TimeframeKeys
overrideTimeframe?: Timeframe
tz?: string
Copy link
Contributor

Choose a reason for hiding this comment

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

Good call.

expect(new TimeseriesQueryTime(getTimePeriod(TimeframeKeys.PREVIOUS_MONTH)).startDate().getHours()).toEqual(0)
})

it('custom timeframe daily', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

This test, at least, should probably stay here...

})
})

describe('non-timeseries queries with custom timeframes', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

This test should probably remain.

expect(deltaQuery.granularitySeconds()).toBe(unaryQuery.granularitySeconds())
})

it('determines a correct trend query across multiple transitions', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

This test should probably remain.

}
return relativePeriod
const overrideTimeRange: Ref<TimeRangeV4> = computed(() => {
Copy link
Contributor

Choose a reason for hiding this comment

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

This no longer needs to be a computed -- you can just reference the variable directly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@filipgutica filipgutica force-pushed the fix/update-metric-provider-timeframe branch from f214e76 to ce4ebb0 Compare October 30, 2025 19:01
@filipgutica filipgutica force-pushed the fix/update-metric-provider-timeframe branch from 3228f5f to 3c83a89 Compare November 3, 2025 19:13
@kongponents-bot
Copy link
Collaborator

Preview components from this PR in consuming application

In consuming application project install preview versions of shared packages generated by this PR:

@kong-ui-public/analytics-metric-provider@pr-2603
@kong-ui-public/dashboard-renderer@pr-2603

import { ref } from 'vue'
import type { ExploreResultV4 } from '@kong-ui-public/analytics-utilities'
import type { ExploreResultV4,
Timeframe } from '@kong-ui-public/analytics-utilities'
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems like it shouldn't need the Timeframe type any more.

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.

4 participants