forked from harness/canary
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'harness:main' into pixel-point-onboarding
- Loading branch information
Showing
185 changed files
with
6,672 additions
and
1,400 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
FROM node:20-slim AS base | ||
ENV PNPM_HOME="/pnpm" | ||
ENV PATH="$PNPM_HOME:$PATH" | ||
# install pnpm | ||
RUN npm install -g pnpm@latest-10 | ||
COPY . /canary | ||
WORKDIR /canary | ||
|
||
FROM base AS prod-deps | ||
# install deps | ||
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod --frozen-lockfile | ||
|
||
FROM base AS build | ||
# install deps | ||
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile | ||
# build all the packages and apps except gitness | ||
RUN pnpm --filter \!gitness run build | ||
# build the microfrontend | ||
WORKDIR /canary/apps/gitness | ||
RUN rm -rf dist | ||
RUN pnpm run build:webpack | ||
|
||
FROM alpine:3.21 AS final | ||
COPY --from=build /canary/apps/gitness/dist /canary-dist | ||
WORKDIR /canary-dist | ||
|
||
# FROM harness/harness:unscripted2024 AS server | ||
# COPY --from=build /canary/apps/gitness/dist /canary | ||
# ENV GITNESS_DEVELOPMENT_UI_SOURCE_OVERRIDE=/canary |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
apps/design-system/src/pages/view-preview/execution-details-view-wrapper.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { FC, PropsWithChildren } from 'react' | ||
import { Route, Routes } from 'react-router-dom' | ||
|
||
import { ExecutionDetailsView } from '@subjects/views/execution-details' | ||
|
||
export const ExecutionDetailsViewWrapper: FC<PropsWithChildren<React.HTMLAttributes<HTMLElement>>> = ({ children }) => { | ||
return ( | ||
<Routes> | ||
<Route path="*" element={<ExecutionDetailsView />}> | ||
<Route path="*" element={children} /> | ||
</Route> | ||
</Routes> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
apps/design-system/src/subjects/views/execution-details/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import { | ||
ExecutionHeader, | ||
ExecutionInfo, | ||
ExecutionState, | ||
ExecutionTabs, | ||
ExecutionTree, | ||
PipelineStatus | ||
} from '@harnessio/ui/views' | ||
|
||
import { elements, logs, stages } from './mocks/mock-data' | ||
|
||
export const ExecutionDetailsView = () => { | ||
return ( | ||
<div className="flex flex-col h-full"> | ||
<ExecutionTabs /> | ||
<ExecutionHeader | ||
commitName="8fbru3ix" | ||
branchName="master" | ||
title={{ number: '311. ', title: 'Alerting docs: adds sns integration' }} | ||
storage="0 B" | ||
storageAverage="0 B / 250 MB" | ||
simpleOperation="27/100k" | ||
advancedOperations="2/50k" | ||
dataTransfer="4.21 kB/5 GB" | ||
/> | ||
<div className="grid h-[inherit]" style={{ gridTemplateColumns: '1fr 3fr' }}> | ||
<div className="flex flex-col gap-4 border border-white/10 border-r-0 border-t-0"> | ||
<PipelineStatus status={ExecutionState.RUNNING} buildTime="1h 30m" createdTime="10 mins ago" /> | ||
<ExecutionTree | ||
defaultSelectedId="initialize" | ||
elements={elements} | ||
onSelectNode={({ parentId, childId }: { parentId: string; childId: string }) => { | ||
console.log(`Selected node: Parent ${parentId}, Child ${childId}`) | ||
}} | ||
/> | ||
</div> | ||
<div className="flex flex-col gap-4 border border-white/10 border-t-0"> | ||
<ExecutionInfo | ||
logs={logs} | ||
onCopy={() => {}} | ||
onDownload={() => {}} | ||
onEdit={() => {}} | ||
selectedStepIdx={0} | ||
stage={stages[0]} | ||
/> | ||
</div> | ||
</div> | ||
</div> | ||
) | ||
} |
179 changes: 179 additions & 0 deletions
179
apps/design-system/src/subjects/views/execution-details/mocks/mock-data.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,179 @@ | ||
import { ExecutionState, ExecutionTreeProps, LivelogLine, StageProps } from '@harnessio/ui/views' | ||
|
||
export const logs: LivelogLine[] = [ | ||
{ pos: 1, time: 1707000000, duration: 2, out: 'Initializing pipeline...' }, | ||
{ pos: 2, time: 1707000002, duration: 3, out: 'Fetching repository...' }, | ||
{ pos: 3, time: 1707000005, duration: 5, out: 'Checking out commit abc123...' }, | ||
{ pos: 4, time: 1707000010, duration: 10, out: 'Installing dependencies...' }, | ||
{ pos: 5, time: 1707000020, duration: 7, out: 'Running pre-build checks...' }, | ||
{ pos: 6, time: 1707000027, duration: 12, out: 'Compiling source files...' }, | ||
{ pos: 7, time: 1707000039, duration: 3, out: "Compiler warning: Unused variable 'x' in src/utils.ts" }, | ||
{ pos: 8, time: 1707000042, duration: 8, out: 'Build completed successfully.' }, | ||
{ pos: 9, time: 1707000050, duration: 15, out: 'Running unit tests...' }, | ||
{ pos: 10, time: 1707000065, duration: 10, out: 'Test suite passed: 42 tests executed, 0 failed.' }, | ||
{ pos: 11, time: 1707000075, duration: 10, out: 'Deploying artifacts...' }, | ||
{ pos: 12, time: 1707000085, duration: 12, out: 'Deployment completed successfully.' }, | ||
{ pos: 13, time: 1707000097, duration: 2, out: 'Pipeline execution finished.' } | ||
] | ||
|
||
export const stages: StageProps[] = [ | ||
{ | ||
name: 'Initialize', | ||
group: 'Setup', | ||
steps: [ | ||
{ | ||
name: 'Fetch Repository', | ||
status: ExecutionState.SUCCESS, | ||
started: 1707000000, | ||
stopped: 1707000002, | ||
inputs: [{ name: 'branch', value: 'main' }], | ||
outputs: [{ name: 'commit', value: 'abc123' }], | ||
number: 1 | ||
}, | ||
{ | ||
name: 'Checkout Code', | ||
status: ExecutionState.SUCCESS, | ||
started: 1707000003, | ||
stopped: 1707000005, | ||
inputs: [{ name: 'commit', value: 'abc123' }], | ||
outputs: [{ name: 'workspace', value: '/build/workspace' }], | ||
number: 2 | ||
} | ||
] | ||
}, | ||
{ | ||
name: 'Build', | ||
group: 'Compilation', | ||
steps: [ | ||
{ | ||
name: 'Install Dependencies', | ||
status: ExecutionState.SUCCESS, | ||
started: 1707000010, | ||
stopped: 1707000015, | ||
inputs: [{ name: 'package.json', value: '/build/workspace/package.json' }], | ||
outputs: [{ name: 'node_modules', value: '/build/workspace/node_modules' }], | ||
number: 3 | ||
}, | ||
{ | ||
name: 'Compile Source', | ||
status: ExecutionState.SUCCESS, | ||
started: 1707000016, | ||
stopped: 1707000025, | ||
inputs: [{ name: 'source', value: '/build/workspace/src' }], | ||
outputs: [{ name: 'binary', value: '/build/workspace/dist' }], | ||
number: 4 | ||
} | ||
] | ||
}, | ||
{ | ||
name: 'Test', | ||
group: 'Verification', | ||
steps: [ | ||
{ | ||
name: 'Run Unit Tests', | ||
status: ExecutionState.SUCCESS, | ||
started: 1707000030, | ||
stopped: 1707000040, | ||
inputs: [{ name: 'binary', value: '/build/workspace/dist' }], | ||
outputs: [{ name: 'testReport', value: '/build/workspace/reports/tests.xml' }], | ||
number: 5 | ||
} | ||
] | ||
}, | ||
{ | ||
name: 'Deploy', | ||
group: 'Deployment', | ||
steps: [ | ||
{ | ||
name: 'Deploy to Staging', | ||
status: ExecutionState.SUCCESS, | ||
started: 1707000050, | ||
stopped: 1707000060, | ||
inputs: [{ name: 'testReport', value: '/build/workspace/reports/tests.xml' }], | ||
outputs: [{ name: 'deploymentURL', value: 'https://staging.example.com' }], | ||
number: 6 | ||
} | ||
] | ||
} | ||
] | ||
|
||
export const elements: ExecutionTreeProps['elements'] = [ | ||
{ | ||
id: 'initialize', | ||
name: 'Initialize', | ||
status: ExecutionState.SUCCESS, | ||
duration: '00:05', | ||
isSelectable: true, | ||
children: [ | ||
{ | ||
id: 'fetch-repo', | ||
name: 'Fetch Repository', | ||
status: ExecutionState.SUCCESS, | ||
duration: '00:02', | ||
isSelectable: true | ||
}, | ||
{ | ||
id: 'checkout-code', | ||
name: 'Checkout Code', | ||
status: ExecutionState.SUCCESS, | ||
duration: '00:03', | ||
isSelectable: true | ||
} | ||
] | ||
}, | ||
{ | ||
id: 'build', | ||
name: 'Build', | ||
status: ExecutionState.FAILURE, | ||
duration: '00:15', | ||
isSelectable: true, | ||
children: [ | ||
{ | ||
id: 'install-deps', | ||
name: 'Install Dependencies', | ||
status: ExecutionState.SUCCESS, | ||
duration: '00:10', | ||
isSelectable: true | ||
}, | ||
{ | ||
id: 'compile', | ||
name: 'Compile Source', | ||
status: ExecutionState.FAILURE, | ||
duration: '00:05', | ||
isSelectable: true | ||
} | ||
] | ||
}, | ||
{ | ||
id: 'test', | ||
name: 'Test', | ||
status: ExecutionState.SUCCESS, | ||
duration: '00:10', | ||
isSelectable: true, | ||
children: [ | ||
{ | ||
id: 'unit-tests', | ||
name: 'Run Unit Tests', | ||
status: ExecutionState.SUCCESS, | ||
duration: '00:10', | ||
isSelectable: true | ||
} | ||
] | ||
}, | ||
{ | ||
id: 'deploy', | ||
name: 'Deploy', | ||
status: ExecutionState.PENDING, | ||
duration: '00:10', | ||
isSelectable: true, | ||
children: [ | ||
{ | ||
id: 'deploy-staging', | ||
name: 'Deploy to Staging', | ||
status: ExecutionState.PENDING, | ||
duration: '00:10', | ||
isSelectable: true | ||
} | ||
] | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.