Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions web-server/pages/api/internal/team/[team_id]/dora_metrics.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { endOfDay, startOfDay } from 'date-fns';
import * as yup from 'yup';

import { getTeamRepos } from '@/api/resources/team_repos';
import { Endpoint } from '@/api-helpers/global';
import {
repoFiltersFromTeamProdBranches,
Expand All @@ -17,8 +18,8 @@ import {
} from '@/utils/cockpitMetricUtils';
import { isoDateString, getAggregateAndTrendsIntervalTime } from '@/utils/date';

import { getAllTeamsReposProdBranchesForOrgAsMap } from './repo_branches';
import { getTeamLeadTimePRs } from './insights';
import { getAllTeamsReposProdBranchesForOrgAsMap } from './repo_branches';

const pathSchema = yup.object().shape({
team_id: yup.string().uuid().required()
Expand Down Expand Up @@ -86,7 +87,8 @@ endpoint.handle.GET(getSchema, async (req, res) => {
meanTimeToRestoreResponse,
changeFailureRateResponse,
deploymentFrequencyResponse,
leadtimePrs
leadtimePrs,
teamRepos
] = await Promise.all([
fetchLeadTimeStats({
teamId,
Expand Down Expand Up @@ -148,10 +150,10 @@ endpoint.handle.GET(getSchema, async (req, res) => {
}),
getTeamLeadTimePRs(teamId, from_date, to_date, prFilters).then(
(r) => r.data
)
),
getTeamRepos(teamId)
]);

console.log('🚀 ~ endpoint.handle.GET ~ leadTimeResponse:', leadTimeResponse);
return res.send({
lead_time_stats: leadTimeResponse.lead_time_stats,
lead_time_trends: leadTimeResponse.lead_time_trends,
Expand All @@ -167,7 +169,8 @@ endpoint.handle.GET(getSchema, async (req, res) => {
deploymentFrequencyResponse.deployment_frequency_stats,
deployment_frequency_trends:
deploymentFrequencyResponse.deployment_frequency_trends,
lead_time_prs: leadtimePrs
lead_time_prs: leadtimePrs,
assigned_repos: teamRepos
} as TeamDoraMetricsApiResponseType);
});

Expand Down
1 change: 1 addition & 0 deletions web-server/pages/dora-metrics/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ function Page() {
}
pageTitle="DORA metrics"
isLoading={isLoading}
teamDateSelectorMode="single"
>
<DoraMetricsBody />
</PageWrapper>
Expand Down
4 changes: 4 additions & 0 deletions web-server/src/components/PageHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { FlexBox, FlexBoxProps } from './FlexBox';
import { Hotkey } from './Hotkey';
import { Logo } from './Logo/Logo';
import { Tabs } from './Tabs';
import { TeamSelector } from './TeamSelector/TeamSelector';
import { Line } from './Text';

type SubRoute = {
Expand Down Expand Up @@ -104,6 +105,9 @@ export const PageHeader: FC<
<>
<Divider />
<FlexBox display="flex" gap={1} alignCenter mb={-1}>
{teamDateSelectorMode && (
<TeamSelector mode={teamDateSelectorMode} />
)}
{selectBranch && <BranchSelector />}
{additionalFilters?.map((filter, i) => (
<Fragment key={i}>{filter}</Fragment>
Expand Down
Loading