Skip to content

Commit

Permalink
feat: DB queue, error messaging and document upload error codes (#1155)
Browse files Browse the repository at this point in the history
Co-authored-by: Luke Zigler <[email protected]>
Co-authored-by: ziggy-cyb <[email protected]>
  • Loading branch information
3 people authored Nov 23, 2023
1 parent 021a3d1 commit 786d813
Show file tree
Hide file tree
Showing 82 changed files with 7,179 additions and 6,873 deletions.
14 changes: 8 additions & 6 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
{
"extends": [
"plugin:json/recommended",
"plugin:prettier/recommended"
],
"extends": ["plugin:json/recommended", "plugin:prettier/recommended"],
"plugins": ["@babel", "prettier"],
"parser": "babel-eslint",
"parser": "@babel/eslint-parser",
"env": {
"browser": true,
"es6": true,
Expand Down Expand Up @@ -38,7 +35,12 @@
{
"files": ["*.ts", "*.tsx"],
"parser": "@typescript-eslint/parser",
"plugins": ["@babel", "prettier", "@typescript-eslint", "eslint-plugin-tsdoc"],
"plugins": [
"@babel",
"prettier",
"@typescript-eslint",
"eslint-plugin-tsdoc"
],
"parserOptions": {
"ecmaFeatures": { "jsx": true }
}
Expand Down
81 changes: 81 additions & 0 deletions .github/workflows/beta--lint-unit-build-and-publish-images.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: Beta QA
on:
push:
branches:
- beta

jobs:
calculate-version:
runs-on: ubuntu-latest
outputs:
semVer: ${{ steps.gitversion.outputs.semVer }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
branches: main

- name: Install GitVersion
uses: gittools/actions/gitversion/[email protected]
with:
versionSpec: "5.x"

- name: Determine Version
id: gitversion
uses: gittools/actions/gitversion/[email protected]
with:
useConfigFile: true

assign-semver:
runs-on: ubuntu-latest
needs: [calculate-version]
env:
SEMVER: ${{ needs.calculate-version.outputs.semVer }}
MAJOR: ${{ needs.calculate-version.outputs.Major }}
outputs:
SEMVER: ${{ steps.calc-semver.outputs.semver }}
steps:
- run: echo $SEMVER
- name: Add 3 to calculated semver
run: |
echo SEMVER="$((3 + MAJOR))${SEMVER:1}" >> $GITHUB_ENV
- name: Set semver to output
id: calc-semver
run: echo "::set-output name=semver::$(echo $SEMVER)"

lint-and-test:
name: Workspace
strategy:
matrix:
workspace: [model, designer, runner, submitter]
uses: ./.github/workflows/lint-and-test.yml
with:
workspace: ${{ matrix.workspace }}

build-and-publish-images:
name: Build and publish
needs: [calculate-version, assign-semver, lint-and-test]
strategy:
matrix:
app: [designer, runner, submitter]
uses: ./.github/workflows/build.yml
secrets: inherit
with:
semver: ${{ needs.assign-semver.outputs.SEMVER }}
publish: true
app: ${{matrix.app}}

tag-branch:
runs-on: ubuntu-latest
needs: [calculate-version, assign-semver, build-and-publish-images]
env:
SEMVER: ${{ needs.assign-semver.outputs.SEMVER }}
steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
token: ${{ secrets.GHCR_PAT }}
- name: Tag branch with run number
run: |
git tag ${{ env.SEMVER }}
git push --tags origin HEAD
12 changes: 10 additions & 2 deletions .github/workflows/branch--lint-unit-and-smoke-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ on:
pull_request:
branches:
- main
- beta
paths-ignore:
- "docs/**"
- "**/README.md"
Expand All @@ -18,7 +19,7 @@ jobs:
name: Workspace
strategy:
matrix:
workspace: [model, designer, runner]
workspace: [model, designer, runner, submitter]
uses: ./.github/workflows/lint-and-test.yml
with:
workspace: ${{ matrix.workspace }}
Expand All @@ -30,6 +31,13 @@ jobs:
app: designer
secrets: inherit

build-submitter:
name: Submitter
uses: ./.github/workflows/build.yml
with:
app: submitter
secrets: inherit

build-runner:
name: Runner
uses: ./.github/workflows/build.yml
Expand All @@ -38,7 +46,7 @@ jobs:
secrets: inherit

smoke-test:
needs: [build-runner,build-designer]
needs: [build-runner, build-designer]
uses: ./.github/workflows/smoke-test.yml
with:
runner-cache-ref: ${{needs.build-runner.outputs.tag}}
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
workflow_call:
inputs:
app:
description: the app to build "designer" or "runner"
description: the app to build "designer", "runner" or "submitter"
required: true
type: string
publish:
Expand Down Expand Up @@ -32,9 +32,9 @@ jobs:
tag: ${{ steps.hashFile.outputs.tag }}
hash: ${{ steps.hashFile.outputs.hash }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v3.6.0
- name: Use Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v3.6.0
with:
node-version: "16.x"

Expand All @@ -49,6 +49,7 @@ jobs:
key: ${{ runner.os }}-yarn-${{inputs.app}}-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-${{inputs.app}}
fail-on-cache-miss: false

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
# Source repository: https://github.com/actions/dependency-review-action
# Public documentation: https://docs.github.com/en/code-security/supply-chain-security/understanding-your-software-supply-chain/about-dependency-review#dependency-review-enforcement
name: 'Dependency Review'
name: "Dependency Review"
on: [pull_request]

permissions:
Expand All @@ -14,7 +14,11 @@ jobs:
dependency-review:
runs-on: ubuntu-latest
steps:
- name: 'Checkout Repository'
- name: "Checkout Repository"
uses: actions/checkout@v3
- name: 'Dependency Review'
- name: "Dependency Review"
uses: actions/dependency-review-action@v2
with:
allow-ghsas:
- GHSA-c429-5p7v-vgjp
- GHSA-7fh5-64p2-3v2j
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
name: Workspace
strategy:
matrix:
workspace: [ model, designer, runner ]
workspace: [model, designer, runner, submitter]
uses: ./.github/workflows/lint-and-test.yml
with:
workspace: ${{ matrix.workspace }}
Expand All @@ -71,7 +71,7 @@ jobs:
secrets: inherit
strategy:
matrix:
app: [ designer, runner ]
app: [designer, runner]
with:
app: ${{ matrix.app }}
tag: ${{ needs.assign-semver.outputs.SEMVER }}
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,7 @@ tsconfig.tsbuildinfo
docs/**/typedoc

/e2e/cypress/screenshots/
.env_mysql
/queue-model/dist
/queue-model/module
/queue-model/src/prisma/generated
8 changes: 4 additions & 4 deletions babel.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
"exclude": ["node_modules/**"],
"plugins": [
"@babel/plugin-proposal-export-default-from",
"@babel/plugin-proposal-class-properties",
"@babel/plugin-proposal-private-property-in-object",
"@babel/plugin-proposal-private-methods",
"@babel/plugin-transform-class-properties",
"@babel/plugin-transform-private-property-in-object",
"@babel/plugin-transform-private-methods",
"@babel/plugin-transform-runtime",
"@babel/plugin-syntax-jsx",
"@babel/plugin-proposal-logical-assignment-operators"
"@babel/plugin-transform-logical-assignment-operators"
]
}
11 changes: 5 additions & 6 deletions designer/babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,14 @@ module.exports = {
],
],
plugins: [
"@babel/plugin-proposal-class-properties",
"@babel/plugin-proposal-private-methods",
"@babel/plugin-transform-class-properties",
"@babel/plugin-transform-private-methods",
"@babel/plugin-syntax-dynamic-import",
"@babel/plugin-transform-runtime",
"@babel/plugin-proposal-export-default-from",
"@babel/plugin-proposal-nullish-coalescing-operator",
"@babel/plugin-proposal-optional-chaining",
"@babel/plugin-proposal-logical-assignment-operators",

"@babel/plugin-transform-nullish-coalescing-operator",
"@babel/plugin-transform-logical-assignment-operators",
"@babel/plugin-transform-optional-chaining",
[
"module-resolver",
{
Expand Down
14 changes: 14 additions & 0 deletions designer/client/__mocks__/tabbable.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const lib = jest.requireActual("tabbable");
const tabbable = {
...lib,
tabbable: (node, options) =>
lib.tabbable(node, { ...options, displayCheck: "none" }),
focusable: (node, options) =>
lib.focusable(node, { ...options, displayCheck: "none" }),
isFocusable: (node, options) =>
lib.isFocusable(node, { ...options, displayCheck: "none" }),
isTabbable: (node, options) =>
lib.isTabbable(node, { ...options, displayCheck: "none" }),
};

module.exports = tabbable;
28 changes: 22 additions & 6 deletions designer/client/components/Flyout/Flyout.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,32 @@
import React, { useContext, useEffect, useLayoutEffect, useState } from "react";
import React, {
CSSProperties,
ReactChildren,
useContext,
useLayoutEffect,
useState,
} from "react";
import FocusTrap from "focus-trap-react";
import { FlyoutContext } from "../../context";
import { DataContext } from "../../context";
import { i18n } from "../../i18n";

import "./Flyout.scss";
import { bool } from "aws-sdk/clients/signer";

export function useFlyoutEffect(props: {}) {
interface Props {
style: string;
width?: string;
onHide: () => void;
closeOnEnter: (e) => void;
show: boolean;
offset: number;
title?: string;
children?: ReactChildren;
NEVER_UNMOUNTS?: boolean;
}

export function useFlyoutEffect(props: Props) {
const flyoutContext = useContext(FlyoutContext);
const [offset, setOffset] = useState(0);
const [style, setStyle] = useState();
const [style, setStyle] = useState<CSSProperties>();
const show = props.show ?? true;

/**
Expand Down Expand Up @@ -58,7 +74,7 @@ export function useFlyoutEffect(props: {}) {
return { style, width: props?.width, closeOnEnter, onHide, offset, show };
}

export function Flyout(props) {
export function Flyout(props: Props) {
const {
style,
width = "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const { test, describe, beforeEach, afterEach } = lab;
function HookWrapper(props) {
const hook = props.hook ? props.hook() : undefined;
// @ts-ignore
// eslint-disable-next-line react/no-unknown-property
return <div hook={hook} />;
}

Expand Down
1 change: 1 addition & 0 deletions designer/client/outputs/output-edit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ class OutputEdit extends Component<Props, State> {
case OutputType.Webhook:
outputConfiguration = {
url: formData.get("webhook-url") as string,
allowRetry: true,
};
break;
}
Expand Down
1 change: 1 addition & 0 deletions designer/client/outputs/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export type NotifyOutputConfiguration = {

export type WebhookOutputConfiguration = {
url: string;
allowRetry: boolean;
};

export type OutputConfiguration =
Expand Down
Loading

0 comments on commit 786d813

Please sign in to comment.