Skip to content

Commit f491a5b

Browse files
authored
Change yarn install command to include frozen lockfile images. (#608)
* Remove package.json and yarn.lock from root. * Make --frozen-lockfile be supplied to yarn install everywhere. * Remove commented code and logs. * Delete web-server/README.md * Update integration cards + shift force-sync/team creation CTA.
1 parent e0f666a commit f491a5b

File tree

7 files changed

+67
-66
lines changed

7 files changed

+67
-66
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ RUN apt-get update && \
105105
&& chmod 0644 /etc/cron.d/cronjob \
106106
&& crontab /etc/cron.d/cronjob \
107107
&& cd /app/web-server \
108-
&& yarn install --network-timeout 1000000 && yarn build \
108+
&& yarn install --frozen-lockfile --network-timeout 1000000 && yarn build \
109109
&& rm -rf ./artifacts \
110110
&& cd /app/ \
111111
&& tar cfz web-server.tar.gz ./web-server \

Dockerfile.dev

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ RUN crontab /etc/cron.d/cronjob
6464
RUN /app/setup_utils/generate_config_ini.sh -t /app/backend/analytics_server/mhq/config
6565

6666
WORKDIR /app/web-server
67-
RUN --mount=type=cache,target=/root/.yarn YARN_CACHE_FOLDER=/root/.yarn yarn install
67+
RUN --mount=type=cache,target=/root/.yarn YARN_CACHE_FOLDER=/root/.yarn yarn install --frozen-lockfile
6868

6969

7070
ENV POSTGRES_DB_ENABLED=true

package.json

Lines changed: 0 additions & 5 deletions
This file was deleted.

web-server/pages/integrations.tsx

Lines changed: 54 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { Add } from '@mui/icons-material';
1+
import { AddRounded, InfoRounded } from '@mui/icons-material';
22
import { LoadingButton } from '@mui/lab';
3-
import { Button, Divider, Card } from '@mui/material';
3+
import { Button, Card, Divider } from '@mui/material';
44
import { differenceInMilliseconds } from 'date-fns';
55
import { millisecondsInMinute } from 'date-fns/constants';
66
import { useEffect, useMemo } from 'react';
@@ -87,9 +87,12 @@ const Content = () => {
8787

8888
const showForceSyncBtn = useMemo(() => {
8989
if (!hasCodeProviderLinked) return false;
90+
if (!teamCount) return false;
91+
9092
if (!lastSyncMap.length) return true;
93+
9194
return lastSyncMap.every((diff) => diff >= TIME_LIMIT_FOR_FORCE_SYNC);
92-
}, [hasCodeProviderLinked, lastSyncMap]);
95+
}, [hasCodeProviderLinked, lastSyncMap, teamCount]);
9396

9497
const enableForceSyncBtn = useMemo(() => {
9598
const diff = differenceInMilliseconds(
@@ -138,13 +141,17 @@ const Content = () => {
138141
);
139142

140143
return (
141-
<FlexBox col gap2>
142-
<FlexBox justifyBetween height={'52px'} alignCenter>
144+
<FlexBox col gap2 fill>
145+
<FlexBox justifyBetween height={'52px'} alignCenter gap2>
143146
<Line white fontSize={'24px'}>
144-
Integrate your Code Providers to fetch DORA for your team
147+
Link your Code Services to view Dora Metrics for your team
145148
</Line>
146149
{showDoraCTA && (
147-
<Button href={ROUTES.DORA_METRICS.PATH} variant="contained">
150+
<Button
151+
href={ROUTES.DORA_METRICS.PATH}
152+
variant="contained"
153+
sx={{ flexShrink: 0 }}
154+
>
148155
<FlexBox centered fullWidth p={2 / 3}>
149156
Continue to Dora {'->'}
150157
</FlexBox>
@@ -153,13 +160,47 @@ const Content = () => {
153160
</FlexBox>
154161

155162
<Divider sx={{ mb: '10px' }} />
156-
{showForceSyncBtn && (
157-
<FlexBox component={Card} justifyBetween p={1} alignCenter>
158-
<Line>
159-
Initiate force sync will force a sync of all integrations. This is
160-
useful if you have made changes to your integrations outside of
161-
middleware.
163+
<FlexBox gap={2}>
164+
<GithubIntegrationCard />
165+
<GitlabIntegrationCard />
166+
</FlexBox>
167+
{showCreationCTA && (
168+
<FlexBox mt={'56px'} col fit alignStart>
169+
<Line fontSize={'24px'} semibold white>
170+
Make a team to get started!
162171
</Line>
172+
<Line fontSize={'16px'} mt="9px">
173+
Just add the team's name, add repos and you're good to go.
174+
</Line>
175+
<Button
176+
variant="contained"
177+
sx={{ mt: 3 }}
178+
href={ROUTES.TEAMS.PATH}
179+
startIcon={<AddRounded />}
180+
size="large"
181+
>
182+
<FlexBox gap1>
183+
<Line white>Create Team</Line>
184+
</FlexBox>
185+
</Button>
186+
</FlexBox>
187+
)}
188+
189+
{showForceSyncBtn && (
190+
<FlexBox component={Card} justifyBetween p={1} alignCenter mt="auto">
191+
<FlexBox fit gap1 centered ml={1}>
192+
<InfoRounded fontSize="small" />
193+
<FlexBox col>
194+
<Line>
195+
<Line bold>Initiate force sync</Line> will force a sync of all
196+
linked integrations.
197+
</Line>
198+
<Line tiny secondary>
199+
This is useful if you want to view updated data right now,
200+
instead of waiting for the next sync cycle.
201+
</Line>
202+
</FlexBox>
203+
</FlexBox>
163204
<LoadingButton
164205
type="submit"
165206
variant="outlined"
@@ -192,31 +233,6 @@ const Content = () => {
192233
</LoadingButton>
193234
</FlexBox>
194235
)}
195-
196-
<FlexBox gap={2}>
197-
<GithubIntegrationCard />
198-
<GitlabIntegrationCard />
199-
</FlexBox>
200-
{showCreationCTA && (
201-
<FlexBox mt={'56px'} col fit alignStart>
202-
<Line fontSize={'24px'} semibold white>
203-
Create team structure to see DORA
204-
</Line>
205-
<Line fontSize={'16px'} mt="9px">
206-
Just add team's name, add repos and you're good to go.
207-
</Line>
208-
<Button
209-
variant="contained"
210-
sx={{ mt: '24px' }}
211-
href={ROUTES.TEAMS.PATH}
212-
>
213-
<FlexBox gap1>
214-
<Add />
215-
<Line white>Create Team</Line>
216-
</FlexBox>
217-
</Button>
218-
</FlexBox>
219-
)}
220236
</FlexBox>
221237
);
222238
};

web-server/src/content/Dashboards/GitlabIntegrationCard.tsx

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
import { ArrowForwardIosRounded, SettingsRounded } from '@mui/icons-material';
1+
import {
2+
ArrowForwardIosRounded,
3+
SettingsRounded,
4+
ChevronRightRounded
5+
} from '@mui/icons-material';
26
import { Button, useTheme } from '@mui/material';
37
import CircularProgress from '@mui/material/CircularProgress';
48
import { useSnackbar } from 'notistack';
@@ -121,11 +125,16 @@ export const GitlabIntegrationCard = () => {
121125
label={!isGitlabIntegrated ? 'Link' : 'Unlink'}
122126
bgOpacity={!isGitlabIntegrated ? 0.45 : 0.25}
123127
endIcon={
124-
isLoading && (
128+
isLoading ? (
125129
<CircularProgress
126130
size={theme.spacing(1)}
127131
sx={{ ml: 1 / 2 }}
128132
/>
133+
) : (
134+
<ChevronRightRounded
135+
fontSize="small"
136+
sx={{ ml: 1 / 2, mr: -2 / 3 }}
137+
/>
129138
)
130139
}
131140
minWidth="72px"

web-server/src/content/DoraMetrics/DoraMetricsBody.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,7 @@ export const DoraMetricsBody = () => {
6666

6767
const { addPage } = useOverlayPage();
6868

69-
console.log('DEbugging', isCodeProviderIntegrated);
70-
7169
useEffect(() => {
72-
// if (!singleTeamId) return;
73-
// if (!isCodeProviderIntegrated) return;
7470
dispatch(
7571
fetchTeamDoraMetrics({
7672
orgId,

yarn.lock

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)