Skip to content

Commit

Permalink
Update publish with main (#212)
Browse files Browse the repository at this point in the history
* Created link-checker CI workflow to address issue #207 (#209)

* Created link-checker CI workflow to address issue #207

* Update workflow to use SLACK_BOT_TOKEN

* Update sitemap.xml (#211)

* Minor: Connectors list improvements on homepage (#210)

---------

Co-authored-by: Preet Shah <[email protected]>
Co-authored-by: Ayush Shah <[email protected]>
  • Loading branch information
3 people authored Jan 4, 2024
1 parent ae0f4bb commit b0de173
Show file tree
Hide file tree
Showing 8 changed files with 1,210 additions and 799 deletions.
98 changes: 98 additions & 0 deletions .github/workflows/link-checker.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
# Copyright 2021 Collate
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: Link-checker
on:
push:
branches:
- publish

jobs:
link-checker:
runs-on: ubuntu-latest
steps:
- name: Check out the Repo
uses: actions/checkout@v4
with:
ref: ${{ github.ref.GITHUB_REF_NAME }}

- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 18.19.0

- name: Install dependencies
run: |
yarn
- name: Get linkchecker package
run: |
wget https://github.com/filiph/linkcheck/releases/download/3.0.0/linkcheck-3.0.0-linux-x64.tar.gz
tar -xzf linkcheck-3.0.0-linux-x64.tar.gz
- name: Run yarn build and start
run: |
yarn build
yarn start -p 8000 &
sleep 10
- name: Run linkchecker
id: run-linkchecker
continue-on-error: true
run: |
cd linkcheck
./linkcheck :8000 -e | tee -a linkchecker.log
echo "FILE_LOCATION=$(pwd)" >> $GITHUB_ENV
- name: Output stats
run: |
cd linkcheck
FILTER_CMD='awk '\''/^Stats:$/{flag=1; next} /\n.EOF$/{flag=0} flag'\'' linkchecker.log | sed '\''$d'\'''
echo LINKS_CHECKED=$(eval "$FILTER_CMD" | grep links | awk '{print $1}') >> $GITHUB_ENV
echo DEST_URLS=$(eval "$FILTER_CMD" | grep destination | awk '{print $1}') >> $GITHUB_ENV
echo IGNORED_URL=$(eval "$FILTER_CMD" | grep ignored | awk '{print $1}') >> $GITHUB_ENV
echo WARNINGS=$(eval "$FILTER_CMD" | grep warnings | awk '{print $1}') >> $GITHUB_ENV
echo ERRORS=$(eval "$FILTER_CMD" | grep errors | awk '{print $1}') >> $GITHUB_ENV
- name: Upload log file
uses: actions/upload-artifact@v4
with:
name: linkchecker.log
path: ${{ env.FILE_LOCATION }}/linkchecker.log

- name: Post payload file summary to slack
id: slack
continue-on-error: true
uses: slackapi/[email protected]
with:
channel-id: ${{ secrets.SLACK_CHANNEL_IDS }}
payload: |
{
"text": "Link-checker build result: ${{ job.status }}",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "<!here> Link-checker build result: *${{ job.status }}*\n Please check the <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|Build URL> for logs and linkchecker report."
}
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "Push/commit by: `${{ github.actor }}`\n>Links checked \t\t -> ${{ env.LINKS_CHECKED }} \n>Destination URLs \t-> ${{ env.DEST_URLS }} \n>Ignored URLs \t\t -> ${{ env.IGNORED_URL }} \n>Warnings \t\t\t\t -> ${{ env.WARNINGS }} \n>*No. or Errors* \t\t\t-> *${{ env.ERRORS }}*"
}
}
]
}
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
23 changes: 23 additions & 0 deletions components/ConnectorsInfo/ConnectorImage.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { ImgHTMLAttributes } from "react";

const DEFAULT_IMAGE = "./images/connectors/default-service-icon.png";

export default function ConnectorImage({
src,
alt,
className = "",
}: Readonly<ImgHTMLAttributes<HTMLImageElement>>) {
const replaceImgWithError = (e) => {
e.target.onerror = null;
e.target.src = DEFAULT_IMAGE;
};

return (
<img
className={className}
onError={replaceImgWithError}
alt={alt}
src={src}
/>
);
}
76 changes: 45 additions & 31 deletions components/ConnectorsInfo/ConnectorsInfo.constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const CONNECTORS = [
{
url: "/connectors/database/datalake",
icon: "./images/connectors/amazon-s3.png",
name: "Amazon S3",
name: "S3",
},
{
url: "/connectors/database/azuresql",
Expand All @@ -27,6 +27,11 @@ export const CONNECTORS = [
icon: "./images/connectors/clickhouse.png",
name: "ClickHouse",
},
{
url: "/connectors/database/couchbase",
icon: "./images/connectors/couchbase.png",
name: "Couchbase",
},
{
url: "/connectors/database/deltalake",
icon: "./images/connectors/delta-lake.png",
Expand Down Expand Up @@ -62,6 +67,11 @@ export const CONNECTORS = [
icon: "./images/connectors/googleCloudService.png",
name: "GCS",
},
{
url: "/connectors/database/greenplum",
icon: "./images/connectors/greenplum.png",
name: "Greenplum",
},
{
url: "/connectors/database/hive",
icon: "./images/connectors/hive.png",
Expand All @@ -82,6 +92,11 @@ export const CONNECTORS = [
icon: "./images/connectors/mariadb.png",
name: "MariaDB",
},
{
url: "/connectors/database/mongodb",
icon: "./images/connectors/mongodb.png",
name: "MongoDB",
},
{
url: "/connectors/database/mssql",
icon: "./images/connectors/mssql.png",
Expand Down Expand Up @@ -117,6 +132,11 @@ export const CONNECTORS = [
icon: "./images/connectors/salesforce.png",
name: "Salesforce",
},
{
url: "/connectors/database/sap-hana",
icon: "./images/connectors/sap-hana.png",
name: "SAP HANA",
},
{
url: "/connectors/database/snowflake",
icon: "./images/connectors/snowflakes.png",
Expand Down Expand Up @@ -147,11 +167,6 @@ export const CONNECTORS = [
icon: "./images/connectors/sqllite.png",
name: "SQL Lite",
},
{
url: "#",
icon: "./images/connectors/iceberg.png",
name: "Apache Iceberg",
},
],
},
{
Expand All @@ -167,22 +182,21 @@ export const CONNECTORS = [
icon: "./images/connectors/redpanda.png",
name: "Redpanda",
},
{
url: "/main-concepts/metadata-standard/schemas/entity/services/connections/messaging/pulsarconnection",
icon: "./images/connectors/pulsar.png",
name: "Pulsar",
},

{
url: "/connectors/messaging/kinesis",
icon: "./images/connectors/kinesis.png",
name: "AWS Kinesis",
name: "Kinesis",
},
],
},
{
connector: "Dashboard",
services: [
{
url: "/main-concepts/metadata-standard/schemas/entity/services/connections/dashboard/lightdashconnection",
icon: "./images/connectors/light-dash.png",
name: "Lightdash",
},
{
url: "/connectors/dashboard/looker",
icon: "./images/connectors/looker.png",
Expand Down Expand Up @@ -221,7 +235,7 @@ export const CONNECTORS = [
{
url: "/connectors/dashboard/quicksight",
icon: "./images/connectors/quicksight.png",
name: "AWS QuickSight",
name: "QuickSight",
},
],
},
Expand Down Expand Up @@ -251,7 +265,12 @@ export const CONNECTORS = [
{
url: "/connectors/pipeline/nifi",
icon: "./images/connectors/apachenifi.png",
name: "Apache NiFi",
name: "NiFi",
},
{
url: "/connectors/pipeline/spline",
icon: "./images/connectors/spline.png",
name: "Spline",
},
],
},
Expand All @@ -266,7 +285,17 @@ export const CONNECTORS = [
{
url: "/connectors/ml-model/sagemaker",
icon: "./images/connectors/sagemaker.png",
name: "AWS SageMaker",
name: "SageMaker",
},
],
},
{
connector: "Search",
services: [
{
url: "/connectors/search/elasticsearch",
icon: "./images/connectors/elasticsearch.png",
name: "Elasticsearch",
},
],
},
Expand All @@ -285,19 +314,4 @@ export const CONNECTORS = [
},
],
},
{
connector: "Others",
services: [
{
url: "#",
icon: "./images/connectors/ldap.png",
name: "LDAP",
},
{
url: "#",
icon: "./images/connectors/sqlalchemy.png",
name: "SQLAlchemy",
},
],
},
];
3 changes: 3 additions & 0 deletions components/ConnectorsInfo/ConnectorsInfo.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
}

.TabItem{
display: block;
width: 100%;
text-align: start;
padding: 8px;
cursor: pointer;
border-radius: 4px;
Expand Down
12 changes: 9 additions & 3 deletions components/ConnectorsInfo/ConnectorsInfo.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import classNames from "classnames";
import { sortBy } from "lodash";
import dynamic from "next/dynamic";
import Link from "next/link";
import { useState } from "react";
import Loader from "../common/Loader/Loader";
import { CONNECTORS } from "./ConnectorsInfo.constants";
import styles from "./ConnectorsInfo.module.css";

Expand All @@ -13,6 +15,10 @@ interface ConnectorCategory {
name: string;
}[];
}
const ConnectorImage = dynamic(() => import("./ConnectorImage"), {
ssr: false,
loading: () => <Loader size={28} />,
});

CONNECTORS.unshift({
connector: "All connectors",
Expand All @@ -33,7 +39,7 @@ export default function ConnectorsInfo() {
<div className={styles.Container}>
<div className={styles.TabsContainer}>
{CONNECTORS.map((connectorCategory) => (
<div
<button
className={classNames(
styles.TabItem,
connectorCategory.connector === selectedTab.connector
Expand All @@ -44,7 +50,7 @@ export default function ConnectorsInfo() {
onClick={() => setSelectedTab(connectorCategory)}
>
{connectorCategory.connector}
</div>
</button>
))}
</div>
<div className={styles.ConnectorsContainer}>
Expand All @@ -55,7 +61,7 @@ export default function ConnectorsInfo() {
href={connector.url}
key={connector.name}
>
<img
<ConnectorImage
className={styles.ConnectorImg}
src={connector.icon}
alt={connector.name}
Expand Down
13 changes: 13 additions & 0 deletions components/common/Loader/Loader.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.LoadingIcon {
animation: rotate 1s linear infinite;
color: var(--primary-color);
}

@keyframes rotate {
from {
transform: rotate(0);
}
to {
transform: rotate(360deg);
}
}
14 changes: 14 additions & 0 deletions components/common/Loader/Loader.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { ReactComponent as LoaderIcon } from "../../../images/icons/loader.svg";
import styles from "./Loader.module.css";

interface LoaderProps {
size?: number;
}

function Loader({ size = 16 }: Readonly<LoaderProps>) {
return (
<LoaderIcon className={styles.LoadingIcon} width={size} height={size} />
);
}

export default Loader;
Loading

0 comments on commit b0de173

Please sign in to comment.