mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-20 00:08:02 +01:00
refactor: remove feature flag for Dora (#5367)
This commit is contained in:
parent
0ba99a6162
commit
11533bf97a
@ -1,7 +1,7 @@
|
|||||||
import { useState, useEffect } from 'react';
|
import { useState, useEffect } from 'react';
|
||||||
import { Box, Button, Divider, Typography, styled } from '@mui/material';
|
import { Box, Button, Divider, Typography, styled } from '@mui/material';
|
||||||
import { PermMedia, Send } from '@mui/icons-material';
|
import { PermMedia, Send } from '@mui/icons-material';
|
||||||
import { usePlausibleTracker } from 'hooks/usePlausibleTracker';
|
import { CustomEvents, usePlausibleTracker } from 'hooks/usePlausibleTracker';
|
||||||
import { createLocalStorage } from 'utils/createLocalStorage';
|
import { createLocalStorage } from 'utils/createLocalStorage';
|
||||||
import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';
|
import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';
|
||||||
|
|
||||||
@ -61,12 +61,21 @@ const StyledLink = styled('a')(({ theme }) => ({
|
|||||||
textDecoration: 'none',
|
textDecoration: 'none',
|
||||||
}));
|
}));
|
||||||
|
|
||||||
export const ProjectDoraFeedback = () => {
|
interface IExperimentalFeedbackProps {
|
||||||
|
trackerKey: string;
|
||||||
|
eventKey: CustomEvents;
|
||||||
|
description: string;
|
||||||
|
sketchURL: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const ExperimentalFeedback: React.FC<IExperimentalFeedbackProps> = ({
|
||||||
|
trackerKey,
|
||||||
|
eventKey,
|
||||||
|
description,
|
||||||
|
sketchURL,
|
||||||
|
}) => {
|
||||||
const { trackEvent } = usePlausibleTracker();
|
const { trackEvent } = usePlausibleTracker();
|
||||||
const { value, setValue } = createLocalStorage(
|
const { value, setValue } = createLocalStorage(trackerKey, { sent: false });
|
||||||
`project:metrics:plausible`,
|
|
||||||
{ sent: false },
|
|
||||||
);
|
|
||||||
const [metrics, setMetrics] = useState(value);
|
const [metrics, setMetrics] = useState(value);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@ -75,7 +84,7 @@ export const ProjectDoraFeedback = () => {
|
|||||||
|
|
||||||
const onBtnClick = (type: string) => {
|
const onBtnClick = (type: string) => {
|
||||||
try {
|
try {
|
||||||
trackEvent('project-metrics', {
|
trackEvent(eventKey, {
|
||||||
props: {
|
props: {
|
||||||
eventType: type,
|
eventType: type,
|
||||||
},
|
},
|
||||||
@ -91,7 +100,7 @@ export const ProjectDoraFeedback = () => {
|
|||||||
|
|
||||||
const recipientEmail = 'ux@getunleash.io';
|
const recipientEmail = 'ux@getunleash.io';
|
||||||
const emailSubject = "I'd like to get involved";
|
const emailSubject = "I'd like to get involved";
|
||||||
const emailBody = `Hello Unleash,\n\nI just saw the new metrics page you are experimenting with in Unleash. I'd like to be involved in user tests and give my feedback on this feature.\n\nRegards,\n`;
|
const emailBody = `Hello Unleash,\n\nI just saw your ${eventKey} experiment. I'd like to be involved in user tests and give my feedback on this feature.\n\nRegards,\n`;
|
||||||
|
|
||||||
const mailtoURL = `mailto:${recipientEmail}?subject=${encodeURIComponent(
|
const mailtoURL = `mailto:${recipientEmail}?subject=${encodeURIComponent(
|
||||||
emailSubject,
|
emailSubject,
|
||||||
@ -102,31 +111,10 @@ export const ProjectDoraFeedback = () => {
|
|||||||
<StyledHeader variant='h1'>
|
<StyledHeader variant='h1'>
|
||||||
We are trying something experimental!
|
We are trying something experimental!
|
||||||
</StyledHeader>
|
</StyledHeader>
|
||||||
<Typography>
|
<Typography>{description}</Typography>
|
||||||
We are considering adding project metrics to see how a project
|
|
||||||
performs. As a first step, we have added a{' '}
|
|
||||||
<i>lead time for changes</i> indicator that is calculated per
|
|
||||||
feature toggle based on the creation of the feature toggle and
|
|
||||||
when it was first turned on in an environment of type
|
|
||||||
production.
|
|
||||||
</Typography>
|
|
||||||
|
|
||||||
<br />
|
<br />
|
||||||
|
|
||||||
<Typography>
|
|
||||||
DORA is a method for measuring the performance of your DevOps
|
|
||||||
teams. It measures four different metrics. You can read Google's
|
|
||||||
blog post about{' '}
|
|
||||||
<a
|
|
||||||
href='https://cloud.google.com/blog/products/devops-sre/using-the-four-keys-to-measure-your-devops-performance'
|
|
||||||
target='_blank'
|
|
||||||
rel='noopener noreferrer'
|
|
||||||
>
|
|
||||||
DORA metrics
|
|
||||||
</a>{' '}
|
|
||||||
for more information.
|
|
||||||
</Typography>
|
|
||||||
|
|
||||||
<ConditionallyRender
|
<ConditionallyRender
|
||||||
condition={!metrics.sent}
|
condition={!metrics.sent}
|
||||||
show={
|
show={
|
||||||
@ -170,7 +158,7 @@ export const ProjectDoraFeedback = () => {
|
|||||||
<PermMedia />
|
<PermMedia />
|
||||||
</StyledIconWrapper>
|
</StyledIconWrapper>
|
||||||
<StyledLink
|
<StyledLink
|
||||||
href='https://app.mural.co/t/unleash2757/m/unleash2757/1694006366166/fae4aa4f796de214bdb3ae2d5ce9de934b68fdfb?sender=u777a1f5633477c329eae3448'
|
href={sketchURL}
|
||||||
target='_blank'
|
target='_blank'
|
||||||
rel='noopener noreferer'
|
rel='noopener noreferer'
|
||||||
>
|
>
|
@ -102,8 +102,7 @@ export const Project = () => {
|
|||||||
title: 'Metrics',
|
title: 'Metrics',
|
||||||
path: `${basePath}/metrics`,
|
path: `${basePath}/metrics`,
|
||||||
name: 'dora',
|
name: 'dora',
|
||||||
flag: 'doraMetrics',
|
isEnterprise: true,
|
||||||
new: true,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'Event log',
|
title: 'Event log',
|
||||||
|
@ -15,7 +15,6 @@ import { PageContent } from 'component/common/PageContent/PageContent';
|
|||||||
import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';
|
import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';
|
||||||
import { PageHeader } from 'component/common/PageHeader/PageHeader';
|
import { PageHeader } from 'component/common/PageHeader/PageHeader';
|
||||||
import { Badge } from 'component/common/Badge/Badge';
|
import { Badge } from 'component/common/Badge/Badge';
|
||||||
import { ProjectDoraFeedback } from './ProjectDoraFeedback/ProjectDoraFeedback';
|
|
||||||
import { useConditionallyHiddenColumns } from 'hooks/useConditionallyHiddenColumns';
|
import { useConditionallyHiddenColumns } from 'hooks/useConditionallyHiddenColumns';
|
||||||
import theme from 'themes/theme';
|
import theme from 'themes/theme';
|
||||||
|
|
||||||
@ -194,7 +193,6 @@ export const ProjectDoraMetrics = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<ProjectDoraFeedback />
|
|
||||||
<PageContent
|
<PageContent
|
||||||
isLoading={loading}
|
isLoading={loading}
|
||||||
header={
|
header={
|
||||||
|
@ -81,7 +81,6 @@ exports[`should create default config 1`] = `
|
|||||||
"disableEnvsOnRevive": false,
|
"disableEnvsOnRevive": false,
|
||||||
"disableMetrics": false,
|
"disableMetrics": false,
|
||||||
"disableNotifications": false,
|
"disableNotifications": false,
|
||||||
"doraMetrics": false,
|
|
||||||
"embedProxy": true,
|
"embedProxy": true,
|
||||||
"embedProxyFrontend": true,
|
"embedProxyFrontend": true,
|
||||||
"featureSearchAPI": false,
|
"featureSearchAPI": false,
|
||||||
|
@ -173,7 +173,6 @@ export default class ProjectApi extends Controller {
|
|||||||
req: IAuthRequest,
|
req: IAuthRequest,
|
||||||
res: Response<ProjectDoraMetricsSchema>,
|
res: Response<ProjectDoraMetricsSchema>,
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
if (this.config.flagResolver.isEnabled('doraMetrics')) {
|
|
||||||
const { projectId } = req.params;
|
const { projectId } = req.params;
|
||||||
|
|
||||||
const dora = await this.projectService.getDoraMetrics(projectId);
|
const dora = await this.projectService.getDoraMetrics(projectId);
|
||||||
@ -184,10 +183,5 @@ export default class ProjectApi extends Controller {
|
|||||||
projectDoraMetricsSchema.$id,
|
projectDoraMetricsSchema.$id,
|
||||||
dora,
|
dora,
|
||||||
);
|
);
|
||||||
} else {
|
|
||||||
throw new InvalidOperationError(
|
|
||||||
'Feature dora metrics is not enabled',
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,6 @@ export type IFlagKey =
|
|||||||
| 'filterInvalidClientMetrics'
|
| 'filterInvalidClientMetrics'
|
||||||
| 'lastSeenByEnvironment'
|
| 'lastSeenByEnvironment'
|
||||||
| 'customRootRolesKillSwitch'
|
| 'customRootRolesKillSwitch'
|
||||||
| 'doraMetrics'
|
|
||||||
| 'variantTypeNumber'
|
| 'variantTypeNumber'
|
||||||
| 'privateProjects'
|
| 'privateProjects'
|
||||||
| 'dependentFeatures'
|
| 'dependentFeatures'
|
||||||
@ -115,10 +114,6 @@ const flags: IFlags = {
|
|||||||
process.env.UNLEASH_EXPERIMENTAL_CUSTOM_ROOT_ROLES_KILL_SWITCH,
|
process.env.UNLEASH_EXPERIMENTAL_CUSTOM_ROOT_ROLES_KILL_SWITCH,
|
||||||
false,
|
false,
|
||||||
),
|
),
|
||||||
doraMetrics: parseEnvVarBoolean(
|
|
||||||
process.env.UNLEASH_EXPERIMENTAL_DORA_METRICS,
|
|
||||||
false,
|
|
||||||
),
|
|
||||||
dependentFeatures: parseEnvVarBoolean(
|
dependentFeatures: parseEnvVarBoolean(
|
||||||
process.env.UNLEASH_EXPERIMENTAL_DEPENDENT_FEATURES,
|
process.env.UNLEASH_EXPERIMENTAL_DEPENDENT_FEATURES,
|
||||||
false,
|
false,
|
||||||
|
@ -38,7 +38,6 @@ process.nextTick(async () => {
|
|||||||
anonymiseEventLog: false,
|
anonymiseEventLog: false,
|
||||||
responseTimeWithAppNameKillSwitch: false,
|
responseTimeWithAppNameKillSwitch: false,
|
||||||
lastSeenByEnvironment: true,
|
lastSeenByEnvironment: true,
|
||||||
doraMetrics: true,
|
|
||||||
variantTypeNumber: true,
|
variantTypeNumber: true,
|
||||||
privateProjects: true,
|
privateProjects: true,
|
||||||
dependentFeatures: true,
|
dependentFeatures: true,
|
||||||
|
Loading…
Reference in New Issue
Block a user