Skip to content

Commit 4d96e51

Browse files
Merge pull request #612 from zenml-io/future
Release
2 parents 2cdc593 + a7f61a8 commit 4d96e51

File tree

17 files changed

+210
-14
lines changed

17 files changed

+210
-14
lines changed

.github/workflows/check-links.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Check Links
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- main
8+
- future
9+
pull_request:
10+
types: [opened, synchronize, ready_for_review]
11+
branches:
12+
- main
13+
- future
14+
concurrency:
15+
# New commit on branch cancels running workflows of the same branch
16+
group: ${{ github.workflow }}-${{ github.ref }}
17+
cancel-in-progress: true
18+
19+
jobs:
20+
check:
21+
if: github.event.pull_request.draft == false
22+
runs-on: ubuntu-latest
23+
steps:
24+
- name: Checkout Repository
25+
uses: actions/checkout@v4
26+
27+
- name: Set up Node.js
28+
uses: actions/setup-node@v4
29+
with:
30+
node-version: "20"
31+
32+
- name: Check Links
33+
run: bash scripts/check-links.sh

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,6 @@ dist-ssr
2828
/playwright/.cache/
2929

3030
.env*
31-
!.env.example
31+
!.env.example
32+
33+
urls.txt

legacy/src/constants/constantCommands.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export const constantCommandsToCreatePipeline = {
7474
export const constantCommandsToCreateRuns = {
7575
title: 'Runs Cheatsheet',
7676
documentation:
77-
'https://docs.zenml.io/user-guide/starter-guide/fetch-runs-after-execution',
77+
'https://docs.zenml.io/how-to/build-pipelines/fetching-pipelines',
7878
body: [
7979
{
8080
text: 'Create a runs',

scripts/check-links.js

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
import fs from "fs";
2+
import { exit } from "process";
3+
4+
const allowedStatuses = [401, 403, 405];
5+
6+
const ignoreList = [];
7+
8+
const headers = new Headers({
9+
"User-Agent": "ZenMLURLBot/1.0 (+http://zenml.io/bot)"
10+
});
11+
12+
const noIndexRegex = /content="noindex"/i;
13+
const docsRegex = /docs.zenml.io/i;
14+
15+
async function checkLink() {
16+
let hasFailed = false;
17+
18+
const links = fs.readFileSync("urls.txt", "utf-8").split("\n").filter(Boolean);
19+
for (const link of links) {
20+
if (ignoreList.includes(link)) {
21+
console.log("\x1b[33m", `Ignoring ${link}`);
22+
continue;
23+
}
24+
try {
25+
const response = await fetch(link, { method: "GET", headers });
26+
const payload = await response.text();
27+
const hasNoIndex = noIndexRegex.test(payload);
28+
29+
if (hasNoIndex && docsRegex.test(link)) {
30+
console.log("\x1b[31m", `[${response.status}] ${link}`);
31+
hasFailed = true;
32+
continue;
33+
}
34+
35+
if (response.ok || allowedStatuses.includes(response.status)) {
36+
console.log("\x1b[32m", `[${response.status}] ${link}`);
37+
} else {
38+
console.log("\x1b[31m", `[${response.status}] ${link}`);
39+
hasFailed = true;
40+
}
41+
} catch (error) {
42+
console.error("\x1b[31m", `Error fetching ${link}: ${error}`);
43+
hasFailed = true;
44+
}
45+
}
46+
47+
exit(hasFailed ? 1 : 0);
48+
}
49+
50+
checkLink();

scripts/check-links.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/bash
2+
3+
# Define the file patterns to search for URLs
4+
file_patterns=("*.json" "*.tsx" "*.ts")
5+
6+
# Define the output file for the URLs
7+
output_file="urls.txt"
8+
9+
# Find unique URLs matching the specified pattern in the specified file types
10+
find_unique_urls() {
11+
include_patterns=""
12+
for pattern in "${file_patterns[@]}"; do
13+
include_patterns+="--include=${pattern} "
14+
done
15+
grep -E -o 'https?:\/\/([a-zA-Z0-9.-]*\.)?zenml\.io[^"'\''[:space:]]*' -r --no-filename $include_patterns "$@" | sort -u
16+
}
17+
18+
# Find unique URLs in the specified file patterns within the "src" directory
19+
find_unique_urls src legacy | sort -u > "$output_file"
20+
21+
# Run the link checker script
22+
node scripts/check-links.js

src/app/pipelines/[namespace]/columns.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export function getPipelineDetailColumns(): ColumnDef<PipelineRun>[] {
3232

3333
return (
3434
<div className="group/copybutton flex items-center gap-2">
35-
<RunIcon className={`h-5 w-5 ${getExecutionStatusColor(status)}`} />
35+
<RunIcon className={`h-5 w-5 shrink-0 ${getExecutionStatusColor(status)}`} />
3636
<div>
3737
<Link to={routes.runs.detail(id)} className="flex items-center gap-1">
3838
<h2 className="text-text-md font-semibold">{name}</h2>

src/app/survey/SlackStep.tsx

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
import Adam from "@/assets/images/portraits/adam.webp";
2+
import Alex from "@/assets/images/portraits/alex.webp";
3+
import Baris from "@/assets/images/portraits/baris.webp";
4+
import Hamza from "@/assets/images/portraits/hamza.webp";
5+
import Stefan from "@/assets/images/portraits/stefan.webp";
6+
import { useSurveyContext } from "@/components/survey/SurveyContext";
7+
import { Avatar, AvatarFallback, AvatarImage, Button } from "@zenml-io/react-component-library";
8+
9+
export function SlackStep() {
10+
const { setSurveyStep } = useSurveyContext();
11+
12+
function joinAndContinue() {
13+
window.open("https://zenml.io/slack", "_blank");
14+
setSurveyStep((prev) => prev + 1);
15+
}
16+
17+
return (
18+
<div className="max-w-[540px] space-y-5">
19+
<div>
20+
<h1 className="text-display-xs font-semibold">Join The ZenML Slack Community</h1>
21+
<p className="text-theme-text-secondary">
22+
Connect to our growing community and meet fellow ZenML enthusiasts, get support, and share
23+
your insights. Let's grow together!
24+
</p>
25+
</div>
26+
<AvatarStack />
27+
<Button
28+
onClick={() => joinAndContinue()}
29+
className="h-auto min-h-8 w-full justify-center py-1"
30+
intent="primary"
31+
emphasis="bold"
32+
size="lg"
33+
>
34+
Join the ZenML Community and Continue
35+
</Button>
36+
<Button
37+
intent="secondary"
38+
emphasis="minimal"
39+
onClick={() => setSurveyStep((prev) => prev + 1)}
40+
className="mx-auto justify-center text-neutral-500"
41+
size="sm"
42+
>
43+
Skip this step
44+
</Button>
45+
</div>
46+
);
47+
}
48+
49+
const avatarList = [
50+
{
51+
name: "Adam",
52+
image: Adam
53+
},
54+
{
55+
name: "Hamza",
56+
image: Hamza
57+
},
58+
{
59+
name: "Alex",
60+
image: Alex
61+
},
62+
{
63+
name: "Stefan",
64+
image: Stefan
65+
},
66+
{ name: "Baris", image: Baris }
67+
];
68+
69+
function AvatarStack() {
70+
return (
71+
<div className="space-y-1">
72+
<div className="flex items-center justify-center -space-x-[7px]">
73+
{avatarList.map((avatar) => (
74+
<Avatar key={avatar.name} size="lg" type="rounded">
75+
<AvatarImage alt={`Portrait of ${avatar.name}`} src={avatar.image} />
76+
<AvatarFallback size="lg">{avatar.name[0]}</AvatarFallback>
77+
</Avatar>
78+
))}
79+
</div>
80+
<p className="text-center text-text-xs text-theme-text-tertiary">
81+
Adam Probst, Hamza Tahir, and +1,800 others have already joined
82+
</p>
83+
</div>
84+
);
85+
}

src/app/survey/Wizard.tsx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
import { AccountDetailsStep } from "./AccountDetailsStep";
2-
import { PrimaryUseStep } from "./PrimaryUseStep";
3-
import { AwarenessStep } from "./AwarenessStep";
41
import StepDisplay from "@/components/survey/StepDisplay";
52
import { useSurveyContext } from "@/components/survey/SurveyContext";
63
import { useCurrentUser } from "@/data/users/current-user-query";
74
import { Skeleton } from "@zenml-io/react-component-library";
8-
import { SurveyUserProvider } from "./SurveyUserContext";
95
import { SuccessStep } from "../../components/survey/SuccessStep";
6+
import { AccountDetailsStep } from "./AccountDetailsStep";
7+
import { AwarenessStep } from "./AwarenessStep";
8+
import { PrimaryUseStep } from "./PrimaryUseStep";
9+
import { SlackStep } from "./SlackStep";
10+
import { SurveyUserProvider } from "./SurveyUserContext";
1011

1112
export function SurveyWizard() {
1213
const { data, isPending, isError } = useCurrentUser({ throwOnError: true });
@@ -18,11 +19,12 @@ export function SurveyWizard() {
1819
return (
1920
<>
2021
<SurveyUserProvider>
21-
<StepDisplay stepAmount={3} />
22+
<StepDisplay stepAmount={4} />
2223
{surveyStep === 1 && <AccountDetailsStep user={data} />}
2324
{surveyStep === 2 && <PrimaryUseStep user={data} />}
2425
{surveyStep === 3 && <AwarenessStep />}
25-
{surveyStep === 4 && (
26+
{surveyStep === 4 && <SlackStep />}
27+
{surveyStep === 5 && (
2628
<SuccessStep
2729
subHeader="Your ZenML account is now updated"
2830
displayBody={false}
11.5 KB
Loading
34 KB
Loading

0 commit comments

Comments
 (0)