From ebadde9dcd1951ca0e0caf2eb97d9c516e2cdb88 Mon Sep 17 00:00:00 2001 From: Eric Rollins Date: Wed, 24 Jan 2024 16:32:33 -0500 Subject: [PATCH 1/6] Replace colors with useThemeFromContext in ErrorView and dependants. --- src/components/ErrorView.js | 14 +++++++------- .../components/ImportWorkflowModal.ts | 17 +++++++++++++---- .../components/SubmitWorkflowModal.ts | 12 +++++++++--- 3 files changed, 29 insertions(+), 14 deletions(-) diff --git a/src/components/ErrorView.js b/src/components/ErrorView.js index 1740cd8e7b..22c940146c 100644 --- a/src/components/ErrorView.js +++ b/src/components/ErrorView.js @@ -1,9 +1,8 @@ +import { cond, maybeParseJSON, useThemeFromContext } from '@terra-ui-packages/core-utils'; import _ from 'lodash/fp'; import { Fragment } from 'react'; import { div, h, iframe } from 'react-hyperscript-helpers'; -import colors from 'src/libs/colors'; import * as Style from 'src/libs/style'; -import * as Utils from 'src/libs/utils'; export const styles = { htmlFrame: { @@ -15,7 +14,6 @@ export const styles = { }, jsonFrame: { padding: '0.5rem', - backgroundColor: colors.light(), whiteSpace: 'pre-wrap', overflow: 'auto', overflowWrap: 'break-word', @@ -25,14 +23,16 @@ export const styles = { }; const ErrorView = ({ error }) => { + const { colors } = useThemeFromContext(); + return div({ style: { marginTop: '1rem' } }, [ - Utils.cond( + cond( [_.isError(error), () => error.message], [ _.isString(error), () => { - const json = Utils.maybeParseJSON(error); - return Utils.cond( + const json = maybeParseJSON(error); + return cond( [ error[0] === '<', () => { @@ -45,7 +45,7 @@ const ErrorView = ({ error }) => { return h(Fragment, [ json.message && div({ style: { marginBottom: '1rem' } }, [json.message]), div({ style: { fontWeight: 600, marginBottom: '0.5rem' } }, ['Full error:']), - div({ style: styles.jsonFrame }, [JSON.stringify(json, null, 2)]), + div({ style: { ...styles.jsonFrame, backgroundColor: colors.light() } }, [JSON.stringify(json, null, 2)]), ]); }, ], diff --git a/src/workflows-app/components/ImportWorkflowModal.ts b/src/workflows-app/components/ImportWorkflowModal.ts index fa58dadb29..c7f35579c8 100644 --- a/src/workflows-app/components/ImportWorkflowModal.ts +++ b/src/workflows-app/components/ImportWorkflowModal.ts @@ -1,10 +1,10 @@ +import { useThemeFromContext } from '@terra-ui-packages/core-utils'; import { CSSProperties } from 'react'; import { div, h } from 'react-hyperscript-helpers'; import { ButtonPrimary, ButtonSecondary, Link } from 'src/components/common'; import { styles as errorStyles } from 'src/components/ErrorView'; import { centeredSpinner, icon } from 'src/components/icons'; import Modal from 'src/components/Modal'; -import colors from 'src/libs/colors'; import * as Nav from 'src/libs/nav'; import * as Utils from 'src/libs/utils'; import { WorkspaceWrapper } from 'src/libs/workspace-utils'; @@ -32,6 +32,7 @@ export const ImportWorkflowModal = ({ successfulImport, errorMessage, }: ImportWorkflowModalProps) => { + const { colors } = useThemeFromContext(); const successBody = () => { return div({}, [ div({ style: { paddingBottom: '1.5rem', display: 'flex', flex: 'none' } }, [ @@ -101,9 +102,17 @@ export const ImportWorkflowModal = ({ ), ]), ]), - div({ style: { ...(errorStyles.jsonFrame as CSSProperties), overflowY: 'scroll', maxHeight: 150 } }, [ - errorMessage, - ]), + div( + { + style: { + ...(errorStyles.jsonFrame as CSSProperties), + backgroundColor: colors.light(), + overflowY: 'scroll', + maxHeight: 150, + }, + }, + [errorMessage] + ), ]); }; diff --git a/src/workflows-app/components/SubmitWorkflowModal.ts b/src/workflows-app/components/SubmitWorkflowModal.ts index 5f29df45d6..9a1486b860 100644 --- a/src/workflows-app/components/SubmitWorkflowModal.ts +++ b/src/workflows-app/components/SubmitWorkflowModal.ts @@ -1,4 +1,4 @@ -import { Spinner } from '@terra-ui-packages/components'; +import { Spinner, useThemeFromContext } from '@terra-ui-packages/components'; import _ from 'lodash/fp'; import { CSSProperties, Fragment, useState } from 'react'; import { div, h, span } from 'react-hyperscript-helpers'; @@ -13,7 +13,6 @@ import { TextCell } from 'src/components/table'; import { Ajax } from 'src/libs/ajax'; import { RecordResponse } from 'src/libs/ajax/data-table-providers/WdsDataTableProvider'; import { useMetricsEvent } from 'src/libs/ajax/metrics/useMetrics'; -import colors from 'src/libs/colors'; import Events, { extractWorkspaceDetails } from 'src/libs/events'; import * as Nav from 'src/libs/nav'; import { notify } from 'src/libs/notifications'; @@ -66,6 +65,8 @@ export const SubmitWorkflowModal = ({ const { captureEvent } = useMetricsEvent(); const canSubmit = canCompute; + const { colors } = useThemeFromContext(); + const submitRun = async () => { const runSetsPayload = { run_set_name: runSetName, @@ -197,7 +198,12 @@ export const SubmitWorkflowModal = ({ ]), div( { - style: { ...(errorStyles.jsonFrame as CSSProperties), overflowY: 'scroll', maxHeight: 160 }, + style: { + ...(errorStyles.jsonFrame as CSSProperties), + backgroundColor: colors.light(), + overflowY: 'scroll', + maxHeight: 160, + }, 'aria-label': 'Modal submission error', }, [workflowSubmissionError] From 6df1b235eccc4babdd469d7d5441d5d2409f6fd1 Mon Sep 17 00:00:00 2001 From: Eric Rollins Date: Wed, 24 Jan 2024 17:04:29 -0500 Subject: [PATCH 2/6] Fix imports --- src/components/ErrorView.js | 3 ++- src/workflows-app/components/ImportWorkflowModal.ts | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/ErrorView.js b/src/components/ErrorView.js index 22c940146c..f0851e7c41 100644 --- a/src/components/ErrorView.js +++ b/src/components/ErrorView.js @@ -1,4 +1,5 @@ -import { cond, maybeParseJSON, useThemeFromContext } from '@terra-ui-packages/core-utils'; +import { useThemeFromContext } from '@terra-ui-packages/components'; +import { cond, maybeParseJSON } from '@terra-ui-packages/core-utils'; import _ from 'lodash/fp'; import { Fragment } from 'react'; import { div, h, iframe } from 'react-hyperscript-helpers'; diff --git a/src/workflows-app/components/ImportWorkflowModal.ts b/src/workflows-app/components/ImportWorkflowModal.ts index c7f35579c8..a4b563d65a 100644 --- a/src/workflows-app/components/ImportWorkflowModal.ts +++ b/src/workflows-app/components/ImportWorkflowModal.ts @@ -1,4 +1,4 @@ -import { useThemeFromContext } from '@terra-ui-packages/core-utils'; +import { useThemeFromContext } from '@terra-ui-packages/components'; import { CSSProperties } from 'react'; import { div, h } from 'react-hyperscript-helpers'; import { ButtonPrimary, ButtonSecondary, Link } from 'src/components/common'; From d7472c1878a8774bef740da0d74900949080c523 Mon Sep 17 00:00:00 2001 From: Eric Rollins Date: Fri, 26 Jan 2024 10:51:35 -0500 Subject: [PATCH 3/6] Convert style to a function. --- src/components/ErrorView.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/components/ErrorView.js b/src/components/ErrorView.js index f0851e7c41..bae0b35ed7 100644 --- a/src/components/ErrorView.js +++ b/src/components/ErrorView.js @@ -5,7 +5,7 @@ import { Fragment } from 'react'; import { div, h, iframe } from 'react-hyperscript-helpers'; import * as Style from 'src/libs/style'; -export const styles = { +export const getStyles = (colors) => ({ htmlFrame: { width: '100%', border: Style.standardLine, @@ -15,16 +15,18 @@ export const styles = { }, jsonFrame: { padding: '0.5rem', + backgroundColor: colors.light(), whiteSpace: 'pre-wrap', overflow: 'auto', overflowWrap: 'break-word', fontFamily: 'Menlo, monospace', maxHeight: 400, }, -}; +}); const ErrorView = ({ error }) => { const { colors } = useThemeFromContext(); + const styles = getStyles(colors); return div({ style: { marginTop: '1rem' } }, [ cond( @@ -46,7 +48,7 @@ const ErrorView = ({ error }) => { return h(Fragment, [ json.message && div({ style: { marginBottom: '1rem' } }, [json.message]), div({ style: { fontWeight: 600, marginBottom: '0.5rem' } }, ['Full error:']), - div({ style: { ...styles.jsonFrame, backgroundColor: colors.light() } }, [JSON.stringify(json, null, 2)]), + div({ style: styles.jsonFrame }, [JSON.stringify(json, null, 2)]), ]); }, ], From 3c23b46efc506666d80d00477a7eada4bc2e527f Mon Sep 17 00:00:00 2001 From: Eric Rollins Date: Fri, 26 Jan 2024 10:58:07 -0500 Subject: [PATCH 4/6] Shift dependants to use new function. --- src/workflows-app/components/ImportWorkflowModal.ts | 10 +++------- src/workflows-app/components/SubmitWorkflowModal.ts | 11 +++-------- 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/src/workflows-app/components/ImportWorkflowModal.ts b/src/workflows-app/components/ImportWorkflowModal.ts index a4b563d65a..5e3ad260e0 100644 --- a/src/workflows-app/components/ImportWorkflowModal.ts +++ b/src/workflows-app/components/ImportWorkflowModal.ts @@ -2,7 +2,7 @@ import { useThemeFromContext } from '@terra-ui-packages/components'; import { CSSProperties } from 'react'; import { div, h } from 'react-hyperscript-helpers'; import { ButtonPrimary, ButtonSecondary, Link } from 'src/components/common'; -import { styles as errorStyles } from 'src/components/ErrorView'; +import { getStyles as getErrorStyles } from 'src/components/ErrorView'; import { centeredSpinner, icon } from 'src/components/icons'; import Modal from 'src/components/Modal'; import * as Nav from 'src/libs/nav'; @@ -33,6 +33,7 @@ export const ImportWorkflowModal = ({ errorMessage, }: ImportWorkflowModalProps) => { const { colors } = useThemeFromContext(); + const errorStyles = getErrorStyles(colors); const successBody = () => { return div({}, [ div({ style: { paddingBottom: '1.5rem', display: 'flex', flex: 'none' } }, [ @@ -104,12 +105,7 @@ export const ImportWorkflowModal = ({ ]), div( { - style: { - ...(errorStyles.jsonFrame as CSSProperties), - backgroundColor: colors.light(), - overflowY: 'scroll', - maxHeight: 150, - }, + style: { ...(errorStyles.jsonFrame as CSSProperties), overflowY: 'scroll', maxHeight: 150 }, }, [errorMessage] ), diff --git a/src/workflows-app/components/SubmitWorkflowModal.ts b/src/workflows-app/components/SubmitWorkflowModal.ts index 9a1486b860..4267875363 100644 --- a/src/workflows-app/components/SubmitWorkflowModal.ts +++ b/src/workflows-app/components/SubmitWorkflowModal.ts @@ -5,7 +5,7 @@ import { div, h, span } from 'react-hyperscript-helpers'; import { generateAppName, getCurrentApp } from 'src/analysis/utils/app-utils'; import { appAccessScopes, appToolLabels } from 'src/analysis/utils/tool-utils'; import { ButtonPrimary } from 'src/components/common'; -import { styles as errorStyles } from 'src/components/ErrorView'; +import { getStyles as getErrorStyles } from 'src/components/ErrorView'; import { icon } from 'src/components/icons'; import { TextArea, TextInput } from 'src/components/input'; import Modal from 'src/components/Modal'; @@ -66,7 +66,7 @@ export const SubmitWorkflowModal = ({ const canSubmit = canCompute; const { colors } = useThemeFromContext(); - + const errorStyles = getErrorStyles(colors); const submitRun = async () => { const runSetsPayload = { run_set_name: runSetName, @@ -198,12 +198,7 @@ export const SubmitWorkflowModal = ({ ]), div( { - style: { - ...(errorStyles.jsonFrame as CSSProperties), - backgroundColor: colors.light(), - overflowY: 'scroll', - maxHeight: 160, - }, + style: { ...(errorStyles.jsonFrame as CSSProperties), overflowY: 'scroll', maxHeight: 160 }, 'aria-label': 'Modal submission error', }, [workflowSubmissionError] From 7f51d0244223bc86a666a572113db83e351699eb Mon Sep 17 00:00:00 2001 From: Eric Rollins Date: Wed, 13 Mar 2024 10:36:13 -0400 Subject: [PATCH 5/6] Fixed duplicate import. --- src/workflows-app/components/SubmitWorkflowModal.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/workflows-app/components/SubmitWorkflowModal.ts b/src/workflows-app/components/SubmitWorkflowModal.ts index 6582e85c33..d559d99049 100644 --- a/src/workflows-app/components/SubmitWorkflowModal.ts +++ b/src/workflows-app/components/SubmitWorkflowModal.ts @@ -1,5 +1,4 @@ -import { Spinner, useThemeFromContext } from '@terra-ui-packages/components'; -import { Modal, Spinner } from '@terra-ui-packages/components'; +import { Modal, Spinner, useThemeFromContext } from '@terra-ui-packages/components'; import _ from 'lodash/fp'; import { CSSProperties, Fragment, useState } from 'react'; import { div, h, span } from 'react-hyperscript-helpers'; From 3c93e45aa13009b7663b01cd4394c981a28dcbbe Mon Sep 17 00:00:00 2001 From: Eric Rollins Date: Fri, 15 Mar 2024 13:11:31 -0400 Subject: [PATCH 6/6] Revert config.yml --- .circleci/config.yml | 47 ++++++++++++++++---------------------------- 1 file changed, 17 insertions(+), 30 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 91fb485719..ddd21904af 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -6,7 +6,6 @@ parameters: enum: - build-deploy - integration-tests-staging - - integration-tests-alpha default: build-deploy orbs: @@ -17,11 +16,11 @@ executors: node: working_directory: /mnt/ramdisk docker: - - image: cimg/node:18.10 + - image: cimg/node:20.11 puppeteer: working_directory: /mnt/ramdisk docker: - - image: cimg/node:18.10-browsers + - image: cimg/node:20.11-browsers gcloud: working_directory: /mnt/ramdisk docker: @@ -31,7 +30,9 @@ anchors: filter-pr-branch: &filter-pr-branch filters: branches: - ignore: dev + ignore: + - dev + - /gh-readonly-queue\/.*/ filter-dev-branch: &filter-dev-branch filters: @@ -96,7 +97,7 @@ commands: default: "SA_KEY_JSON" env: type: enum - enum: [dev, staging, alpha] + enum: [dev, staging] default: dev pr: type: boolean @@ -150,7 +151,7 @@ commands: default: false env: type: enum - enum: [ staging, alpha ] + enum: [ staging ] default: staging log_dir: type: string @@ -181,7 +182,7 @@ commands: JEST_JUNIT_OUTPUT_DIR: "<< parameters.log_dir >>/<< parameters.env >>/test-results/junit" SCREENSHOT_DIR: "<< parameters.log_dir >>/<< parameters.env >>/test-results/failure-screenshots" ENVIRONMENT: << parameters.env >> - no_output_timeout: 20m + no_output_timeout: 25m command: | mkdir -p ${SCREENSHOT_DIR} TESTS_TO_RUN=$(yarn run jest --listTests | sed "s|$(pwd)/||") @@ -202,6 +203,7 @@ commands: bash ../.circleci/wait-for-job-finish.sh node --require ../.pnp.cjs ./slack/notify-circleci-test-results.js fi + no_output_timeout: 25m when: always notify-qa: @@ -227,6 +229,13 @@ jobs: keys: - deps-{{ .Branch }}-{{ checksum ".pnp.cjs" }} - run: yarn install --immutable + - run: + name: "Check for missing cache files" + command: | + if [[ $(git ls-files .yarn/cache --exclude-standard --others) ]]; then + echo "Changes to Yarn cache need to be committed" 1>&2 + exit 1 + fi - run: yarn run build - run: yarn eslint --max-warnings=0 . - run: yarn workspaces foreach --exclude terra-integration-tests run test --coverage --maxWorkers=2 --passWithNoTests @@ -258,14 +267,6 @@ jobs: executor: gcloud steps: - deploy-env - deploy-alpha: - executor: gcloud - steps: - - deploy-env: - sa_key_var: "ALPHA_SA_KEY_JSON" - env: "alpha" - - notify-qa: - channel: "C7H40L71D" # dsde-qa-notify deploy-staging: executor: gcloud steps: @@ -276,17 +277,12 @@ jobs: channel: "C7H40L71D" # dsde-qa-notify integration-tests-pr-staging: executor: puppeteer + resource_class: medium+ parallelism: 4 steps: - integration-tests: local: true env: staging - integration-tests-alpha: - executor: puppeteer - parallelism: 4 - steps: - - integration-tests: - env: alpha integration-tests-staging: executor: puppeteer parallelism: 4 @@ -313,10 +309,6 @@ workflows: <<: *filter-dev-branch requires: - build - - deploy-alpha: - <<: *filter-dev-branch - requires: - - build - deploy-staging: <<: *filter-dev-branch requires: @@ -330,11 +322,6 @@ workflows: equal: [integration-tests-staging, << pipeline.parameters.workflow_to_run >>] jobs: - integration-tests-staging - integration-tests-alpha: - when: - equal: [integration-tests-alpha, << pipeline.parameters.workflow_to_run >>] - jobs: - - integration-tests-alpha nightly-integration-tests: triggers: - schedule: