diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 4303dfb07..000000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,49 +0,0 @@ -version: 2.1 - -setup: true - -parameters: - run_e2e_test: - default: false - type: boolean - run_e2e_test_nightly: - default: false - type: boolean - run_pr_validator: - default: true - type: boolean - run_npm_publish: - default: false - type: boolean - dist_tag: - default: "alpha" - type: string - version_bump: - default: "patch" - type: string - package_version: - default: "" - type: string - flex_ui_version: - default: "" - type: string - -executors: - node: - parameters: - tag: - type: string - docker: - - image: cimg/node:<< parameters.tag >>-browsers - macos: - macos: - xcode: 14.2.0 - -orbs: - split-config: bufferings/split-config@0.1.0 - -workflows: - generate-config: - jobs: - - split-config/generate-config: - find-config-regex: \./\.circleci/configs/.*\.yml diff --git a/.circleci/configs/e2e_test.yml b/.circleci/configs/e2e_test.yml deleted file mode 100644 index 07874848b..000000000 --- a/.circleci/configs/e2e_test.yml +++ /dev/null @@ -1,385 +0,0 @@ -version: 2.1 - -parameters: - run_e2e_test: - default: false - type: boolean - run_e2e_test_nightly: - default: false - type: boolean - package_version: - default: "" - type: string - flex_ui_version: - default: "" - type: string - -executors: - node: - parameters: - tag: - type: string - docker: - - image: cimg/node:<< parameters.tag >>-browsers - macos: - macos: - xcode: 14.2.0 - -orbs: - win: circleci/windows@5.0.0 - node: circleci/node@5.1.0 - -commands: - cmd_install-dependencies: - steps: - - run: - name: "Install project dependencies" - command: npm i - cmd_install-prerequisites: - steps: - - run: - name: "Apt-get update" - command: sudo apt-get update - - run: - name: "Install libraries" - command: sudo apt-get install -y libsecret-1-dev - cmd_run-build: - steps: - - run: - name: "Build packages" - command: npm run build - cmd_run-e2e-tests: - steps: - - run: - name: "Run e2e tests" - # default timeout is 10m - no_output_timeout: 20m - command: | - cd packages/flex-plugin-e2e-tests - npm start - cmd_run-e2e-tests-win: - steps: - - run: - name: "Run e2e tests - JS" - command: | - cd packages/flex-plugin-e2e-tests - npm start - environment: - TS: false - cmd_run-e2e-tests-win-ts: - steps: - - run: - name: "Run e2e tests - TS" - command: | - taskkill //im node.exe //f - cd packages/flex-plugin-e2e-tests - npm start - environment: - TS: true - cmd_run-e2e-tests-mac-js: - steps: - - run: - name: "Run e2e tests - JS" - command: | - cd packages/flex-plugin-e2e-tests - npm start - environment: - TS: false - cmd_run-e2e-tests-mac-ts: - steps: - - run: - name: "Run e2e tests - TS" - command: | - killall -9 node - cd packages/flex-plugin-e2e-tests - npm start - environment: - TS: true - cmd_set-mac-permissions: - steps: - - run: - name: "Set permissions to user directory" - command: sudo chmod -R 777 /Users/distiller - cmd_set-linux-permissions: - steps: - - run: - name: "Set permissions to /usr/local" - command: sudo chmod -R 777 /usr/local - cmd_windows-nvm-install-node: - parameters: - node-version: - type: string - steps: - - run: - name: "Install node" - command: nvm install << parameters.node-version >> - - run: - name: "NVM use" - command: nvm use << parameters.node-version >> - cmd_slack-notification-error: - parameters: - text: - type: string - steps: - - run: - name: Send Slack notification - command: | - curl -XPOST -H "Content-type:application/json" --data "{'text':':error: $CIRCLE_PROJECT_REPONAME/$CIRCLE_BRANCH - << parameters.text >>. View <$CIRCLE_BUILD_URL|build>.', 'mrkdwn':true}" $SLACK_WEBHOOK - when: on_fail - -jobs: - job_e2e-test-linux-node16: - resource_class: xlarge - parameters: - package_version: - type: string - flex_ui_version: - type: string - node-version: - type: string - environment: - NODE_OPTIONS: --max-old-space-size=14336 - PACKAGE_VERSION: << parameters.package_version >> - FLEX_UI_VERSION: << parameters.flex_ui_version >> - executor: - name: node - tag: << parameters.node-version >> - steps: - - checkout - - cmd_install-prerequisites - - cmd_install-dependencies - - cmd_run-build - - cmd_set-linux-permissions - - cmd_run-e2e-tests - - store_artifacts: - path: packages/flex-plugin-e2e-tests/screenshots - - job_e2e-test-win-node16: - parameters: - package_version: - type: string - flex_ui_version: - type: string - shell: - type: string - node-version: - type: string - environment: - NODE_OPTIONS: --max-old-space-size=14336 - PACKAGE_VERSION: << parameters.package_version >> - FLEX_UI_VERSION: << parameters.flex_ui_version >> - executor: - name: win/default - shell: << parameters.shell >> - size: xlarge - steps: - - checkout - - cmd_windows-nvm-install-node: - node-version: << parameters.node-version >> - - cmd_install-dependencies - - cmd_run-build - - cmd_run-e2e-tests-win - - cmd_run-e2e-tests-win-ts - - store_artifacts: - path: packages/flex-plugin-e2e-tests/screenshots - - job_e2e-test-macos-node16: - resource_class: macos.x86.medium.gen2 - parameters: - flex_ui_version: - type: string - package_version: - type: string - node-version: - type: string - environment: - NODE_OPTIONS: --max-old-space-size=14336 - PACKAGE_VERSION: << parameters.package_version >> - FLEX_UI_VERSION: << parameters.flex_ui_version >> - executor: - name: macos - steps: - - checkout - - node/install: - node-version: << parameters.node-version >> - - cmd_install-dependencies - - cmd_run-build - - cmd_set-mac-permissions - - cmd_run-e2e-tests-mac-js - - cmd_run-e2e-tests-mac-ts - - store_artifacts: - path: packages/flex-plugin-e2e-tests/screenshots - - # In order to run our e2e tests per operating system, we must have a separate job for each node version. - # Since we use a one account per os, running the tests for each version in parallel is not possible. - job_e2e-test-linux-node18: - resource_class: xlarge - parameters: - package_version: - type: string - flex_ui_version: - type: string - node-version: - type: string - environment: - NODE_OPTIONS: --max-old-space-size=14336 - PACKAGE_VERSION: << parameters.package_version >> - FLEX_UI_VERSION: << parameters.flex_ui_version >> - executor: - name: node - tag: << parameters.node-version >> - steps: - - checkout - - cmd_install-prerequisites - - cmd_install-dependencies - - cmd_run-build - - cmd_set-linux-permissions - - cmd_run-e2e-tests - - store_artifacts: - path: packages/flex-plugin-e2e-tests/screenshots - - job_e2e-test-win-node18: - parameters: - package_version: - type: string - flex_ui_version: - type: string - shell: - type: string - node-version: - type: string - environment: - NODE_OPTIONS: --max-old-space-size=14336 - PACKAGE_VERSION: << parameters.package_version >> - FLEX_UI_VERSION: << parameters.flex_ui_version >> - executor: - name: win/default - shell: << parameters.shell >> - size: xlarge - steps: - - checkout - - cmd_windows-nvm-install-node: - node-version: << parameters.node-version >> - - cmd_install-dependencies - - cmd_run-build - - cmd_run-e2e-tests-win - - cmd_run-e2e-tests-win-ts - - store_artifacts: - path: packages/flex-plugin-e2e-tests/screenshots - - job_e2e-test-macos-node18: - resource_class: macos.x86.medium.gen2 - parameters: - flex_ui_version: - type: string - package_version: - type: string - node-version: - type: string - environment: - NODE_OPTIONS: --max-old-space-size=14336 - PACKAGE_VERSION: << parameters.package_version >> - FLEX_UI_VERSION: << parameters.flex_ui_version >> - executor: - name: macos - steps: - - checkout - - node/install: - node-version: << parameters.node-version >> - - cmd_install-dependencies - - cmd_run-build - - cmd_set-mac-permissions - - cmd_run-e2e-tests-mac-js - - cmd_run-e2e-tests-mac-ts - - store_artifacts: - path: packages/flex-plugin-e2e-tests/screenshots - -workflows: - workflow_e2e-tester: - when: << pipeline.parameters.run_e2e_test >> - jobs: - - job_e2e-test-linux-node16: - matrix: - parameters: - package_version: [<< pipeline.parameters.package_version >>] - flex_ui_version: [<< pipeline.parameters.flex_ui_version >>] - node-version: ["16.20.0"] - - job_e2e-test-win-node16: - matrix: - parameters: - package_version: [<< pipeline.parameters.package_version >>] - flex_ui_version: [<< pipeline.parameters.flex_ui_version >>] - shell: ["bash.exe"] - node-version: ["16.20.0"] - - job_e2e-test-macos-node16: - matrix: - parameters: - package_version: [<< pipeline.parameters.package_version >>] - flex_ui_version: [<< pipeline.parameters.flex_ui_version >>] - node-version: ["16.20.0"] - - workflow_nightly-e2e: - when: << pipeline.parameters.run_e2e_test_nightly >> - jobs: - - job_e2e-test-linux-node16: - matrix: - parameters: - package_version: ["latest"] - flex_ui_version: ["latest"] - node-version: ["16.20.0"] - post-steps: - - cmd_slack-notification-error: - text: "nightly E2E tests failed on Linux in node16" - - job_e2e-test-macos-node16: - matrix: - parameters: - package_version: ["latest"] - flex_ui_version: ["latest"] - node-version: ["16.20.0"] - post-steps: - - cmd_slack-notification-error: - text: "nightly E2E tests failed on MacOS in node16" - - job_e2e-test-win-node16: - matrix: - parameters: - package_version: ["latest"] - flex_ui_version: ["latest"] - shell: ["bash.exe"] - node-version: ["16.20.0"] - post-steps: - - cmd_slack-notification-error: - text: "nightly E2E tests failed on Windows in node16" - - job_e2e-test-linux-node18: - matrix: - parameters: - package_version: ["latest"] - flex_ui_version: ["latest"] - node-version: ["18.15.0"] - requires: - - job_e2e-test-linux-node16 - post-steps: - - cmd_slack-notification-error: - text: "nightly E2E tests failed on Linux in node18" - - job_e2e-test-macos-node18: - matrix: - parameters: - package_version: ["latest"] - flex_ui_version: ["latest"] - node-version: ["18.15.0"] - requires: - - job_e2e-test-macos-node16 - post-steps: - - cmd_slack-notification-error: - text: "nightly E2E tests failed on MacOS in node18" - - job_e2e-test-win-node18: - matrix: - parameters: - package_version: ["latest"] - flex_ui_version: ["latest"] - shell: ["bash.exe"] - node-version: ["18.15.0"] - requires: - - job_e2e-test-win-node16 - post-steps: - - cmd_slack-notification-error: - text: "nightly E2E tests failed on Windows in node18." diff --git a/.circleci/configs/npm_publish.yml b/.circleci/configs/npm_publish.yml deleted file mode 100644 index 384432e0e..000000000 --- a/.circleci/configs/npm_publish.yml +++ /dev/null @@ -1,98 +0,0 @@ -version: 2.1 - -parameters: - run_npm_publish: - default: false - type: boolean - dist_tag: - default: "alpha" - type: string - version_bump: - default: "patch" - type: string - -executors: - node: - parameters: - tag: - type: string - docker: - - image: cimg/node:<< parameters.tag >>-browsers - macos: - macos: - xcode: 14.2.0 - -orbs: - node: circleci/node@5.1.0 - -commands: - cmd_install-dependencies: - steps: - - run: - name: "Install project dependencies" - command: npm i - cmd_install-prerequisites: - steps: - - run: - name: "Apt-get update" - command: sudo apt-get update - - run: - name: "Install libraries" - command: sudo apt-get install -y libsecret-1-dev - cmd_setup-npm: - steps: - - run: - name: "Setting up npm" - command: | - echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc - git config --global user.email $GITHUB_EMAIL - git config --global user.name $GITHUB_USER - cmd_setup-github: - steps: - - add_ssh_keys: - fingerprints: - - "f3:09:6f:86:86:0a:6e:98:9b:fa:cb:49:2e:90:bc:75" - cmd_run-publish: - parameters: - dist_tag: - type: string - version_bump: - type: string - steps: - - run: - name: "Publishing package" - command: | - npm run publish:<< parameters.dist_tag >> << parameters.version_bump >> -jobs: - job_npm-publish: - resource_class: xlarge - parameters: - dist_tag: - type: string - version_bump: - type: string - environment: - NODE_OPTIONS: --max-old-space-size=14336 - CI: "" - executor: - name: node - tag: "16.20.0" - steps: - - checkout - - cmd_install-prerequisites - - cmd_install-dependencies - - cmd_setup-npm - - cmd_setup-github - - cmd_run-publish: - dist_tag: << parameters.dist_tag >> - version_bump: << parameters.version_bump >> - -workflows: - workflow_publisher: - when: << pipeline.parameters.run_npm_publish >> - jobs: - - job_npm-publish: - matrix: - parameters: - dist_tag: [<< pipeline.parameters.dist_tag >>] - version_bump: [<< pipeline.parameters.version_bump >>] diff --git a/.circleci/configs/pr_validator.yml b/.circleci/configs/pr_validator.yml deleted file mode 100644 index 6070094b7..000000000 --- a/.circleci/configs/pr_validator.yml +++ /dev/null @@ -1,133 +0,0 @@ -version: 2.1 - -parameters: - run_pr_validator: - default: true - type: boolean - -executors: - node: - parameters: - tag: - type: string - docker: - - image: cimg/node:<< parameters.tag >>-browsers - macos: - macos: - xcode: 14.2.0 - -orbs: - win: circleci/windows@5.0.0 - node: circleci/node@5.1.0 - -commands: - cmd_install-dependencies: - steps: - - run: - name: "Install project dependencies" - command: npm i - cmd_install-prerequisites: - steps: - - run: - name: "Apt-get update" - command: sudo apt-get update - - run: - name: "Install libraries" - command: sudo apt-get install -y libsecret-1-dev - cmd_run-unit-tests: - steps: - - run: - name: "Run unit tests" - command: npm run test:ci - cmd_run-linter: - steps: - - run: - name: "Run linter" - command: npm run lint:fix - cmd_run-build: - steps: - - run: - name: "Build packages" - command: npm run build - cmd_codecov: - steps: - - run: - name: "Codecov report" - command: npm run coverage -- --token=$CODECOV_TOKEN - cmd_windows-nvm-install-node: - parameters: - node-version: - type: string - steps: - - run: - name: "Install node" - command: nvm install << parameters.node-version >> - - run: - name: "NVM use" - command: nvm use << parameters.node-version >> - -jobs: - job_pr-validator-win32: - environment: - NODE_OPTIONS: --max-old-space-size=14336 --no-experimental-fetch - CI: "" - parameters: - shell: - type: string - node-version: - type: string - executor: - name: win/default - shell: << parameters.shell >> - size: xlarge - steps: - - checkout - - cmd_windows-nvm-install-node: - node-version: << parameters.node-version >> - - cmd_install-dependencies - - cmd_run-build - - cmd_run-unit-tests - - job_pr-validator-node: - resource_class: xlarge - environment: - NODE_OPTIONS: --max-old-space-size=14336 --no-experimental-fetch - CI: "" - parameters: - node-version: - type: string - executor: - name: node - tag: << parameters.node-version >> - steps: - - checkout - - cmd_install-prerequisites - - cmd_install-dependencies - - cmd_run-linter - - cmd_run-unit-tests - - cmd_run-build - - when: - condition: - equal: [<< parameters.node-version >>, "18.15.0"] - steps: - - cmd_codecov - -workflows: - workflow_pr-validator: - when: << pipeline.parameters.run_pr_validator >> - jobs: - - job_pr-validator-win32: - matrix: - parameters: - shell: ["bash.exe", "powershell.exe"] - node-version: ["18.15.0"] - post-steps: - - cmd_slack-notification-error: - text: "$CIRCLE_PULL_REQUEST validation failed on *Node:${CIRCLE_JOB/job_pr-validator-node-/''}* in windows." - - job_pr-validator-node: - matrix: - parameters: - node-version: ["18.15.0"] - post-steps: - - cmd_slack-notification-error: - text: "$CIRCLE_PULL_REQUEST validation failed on *Node:${CIRCLE_JOB/job_pr-validator-node-/''}*." diff --git a/.github/actions/artifactory-oidc/action.yaml b/.github/actions/artifactory-oidc/action.yaml new file mode 100644 index 000000000..6681b2e7e --- /dev/null +++ b/.github/actions/artifactory-oidc/action.yaml @@ -0,0 +1,47 @@ +name: 'Artifactory OIDC Auth' +description: 'Exchange GitHub OIDC token for Artifactory access token and configure npm' + +runs: + using: 'composite' + steps: + - name: Exchange OIDC token for Artifactory access token + shell: bash + run: | + # 1. Request GitHub JWT with Artifactory as audience + GITHUB_JWT=$(curl -sS \ + -H "Authorization: bearer ${ACTIONS_ID_TOKEN_REQUEST_TOKEN}" \ + "${ACTIONS_ID_TOKEN_REQUEST_URL}&audience=${ARTIFACTORY_URL}" \ + | jq -r '.value') + + # Decode and log claims for debugging (payload is base64url, not secret) + PAYLOAD=$(echo "$GITHUB_JWT" | cut -d. -f2 | sed 's/-/+/g; s/_/\//g' | base64 -d 2>/dev/null || true) + echo "::debug::OIDC claims: sub=$(echo "$PAYLOAD" | jq -r '.sub'), aud=$(echo "$PAYLOAD" | jq -r '.aud')" + + # 2. Exchange GitHub JWT for Artifactory access token. + # Must be a JSON body and MUST include provider_name so JFrog knows + # which OIDC configuration to match (without it, no token is issued). + # Capture the full response so JFrog's error is visible on failure. + RESP=$(curl -sS "${ARTIFACTORY_URL}/access/api/v1/oidc/token" \ + -H 'Content-Type: application/json' \ + -d "{\"grant_type\":\"urn:ietf:params:oauth:grant-type:token-exchange\", + \"subject_token_type\":\"urn:ietf:params:oauth:token-type:id_token\", + \"subject_token\":\"${GITHUB_JWT}\", + \"provider_name\":\"github-actions\"}") + ART_TOKEN=$(echo "$RESP" | jq -r '.access_token // empty') + + if [ -z "$ART_TOKEN" ]; then + echo "::error::OIDC token exchange failed. Raw response (token field redacted):" + echo "$RESP" | jq 'if .access_token then .access_token="" else . end' 2>/dev/null || echo "$RESP" + exit 1 + fi + echo "::add-mask::$ART_TOKEN" + + # 3. Configure npm to use Artifactory registry + REGISTRY="${ARTIFACTORY_URL}/artifactory/api/npm/virtual-npm-thirdparty/" + HOST=$(echo "${ARTIFACTORY_URL}" | sed -E 's#^https?://##') + { + echo "registry=${REGISTRY}" + echo "//${HOST}/artifactory/api/npm/virtual-npm-thirdparty/:_authToken=${ART_TOKEN}" + } > ~/.npmrc + + echo "::notice::npm configured to use Artifactory registry" \ No newline at end of file diff --git a/.github/workflows/e2e_scheduled.yaml b/.github/workflows/e2e_scheduled.yaml index 185adcf4a..ebb386467 100644 --- a/.github/workflows/e2e_scheduled.yaml +++ b/.github/workflows/e2e_scheduled.yaml @@ -13,7 +13,7 @@ jobs: if: github.event.schedule == '0 4 * * *' uses: ./.github/workflows/~reusable_e2e_by_OS.yaml with: - OS: ubuntu-22.04 + OS: ubuntu-latest-large BRANCH: main NPM_IGNORE_PREFIX: ${{ vars.NPM_IGNORE_PREFIX }} NODE_VERSION: '22' @@ -39,7 +39,7 @@ jobs: if: github.event.schedule == '0 6 * * *' uses: ./.github/workflows/~reusable_e2e_by_OS.yaml with: - OS: macos-latest + OS: macos-latest-large BRANCH: main NPM_IGNORE_PREFIX: ${{ vars.NPM_IGNORE_PREFIX }} NODE_VERSION: '22' @@ -65,7 +65,7 @@ jobs: if: github.event.schedule == '0 8 * * *' uses: ./.github/workflows/~reusable_e2e_by_OS.yaml with: - OS: windows-latest + OS: windows-latest-large BRANCH: main NPM_IGNORE_PREFIX: ${{ vars.NPM_IGNORE_PREFIX }} NODE_VERSION: '22' diff --git a/.github/workflows/manual_public_release.yaml b/.github/workflows/manual_public_release.yaml index 87f4adbca..2f8a5d803 100644 --- a/.github/workflows/manual_public_release.yaml +++ b/.github/workflows/manual_public_release.yaml @@ -15,14 +15,13 @@ on: jobs: release-public-version: if: github.ref == 'refs/heads/main' - uses: ./.github/workflows/~reusable_public_publish.yaml + uses: ./.github/workflows/release.yml with: TAG: public VERSION: ${{ github.event.inputs.version }} BRANCH: main ENVIRONMENT: public_release secrets: - NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }} SLACK_WEB_HOOK: ${{ secrets.SLACK_WEB_HOOK }} G_TOKEN: ${{ secrets.GITHUB_TOKEN }} APP_ID: ${{ secrets.APP_ID }} diff --git a/.github/workflows/manual_public_release_v6.yaml b/.github/workflows/manual_public_release_v6.yaml index f345b5cfc..dbabb40c5 100644 --- a/.github/workflows/manual_public_release_v6.yaml +++ b/.github/workflows/manual_public_release_v6.yaml @@ -15,14 +15,13 @@ on: jobs: release-public-version: if: github.ref == 'refs/heads/main' - uses: ./.github/workflows/~reusable_public_publish.yaml + uses: ./.github/workflows/release.yml with: TAG: public VERSION: patch BRANCH: FLEXY-5323-6.4.2 ENVIRONMENT: public_release secrets: - NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }} SLACK_WEB_HOOK: ${{ secrets.SLACK_WEB_HOOK }} G_TOKEN: ${{ secrets.GITHUB_TOKEN }} APP_ID: ${{ secrets.APP_ID }} diff --git a/.github/workflows/pr_e2e.yaml b/.github/workflows/pr_e2e.yaml index e4ee21ae1..019fea1d2 100644 --- a/.github/workflows/pr_e2e.yaml +++ b/.github/workflows/pr_e2e.yaml @@ -7,13 +7,13 @@ on: jobs: get-version: if: ${{ (github.event.label.name == vars.E2E_LABEL) || (github.event.label.name == vars.PUBLISH_AND_E2E_LABEL) }} - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest-large outputs: branch: ${{ steps.extractBranch.outputs.branch }} version: ${{ steps.alphaVersion.outputs.version }} steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v3 + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 + - uses: actions/setup-node@3235b876344d2a9aa001b8d1453c930bba69e610 # v3 with: node-version: '22' - name: Extract branch name @@ -31,15 +31,14 @@ jobs: release-alpha-version: needs: get-version - uses: ./.github/workflows/~reusable_publish.yaml + uses: ./.github/workflows/release.yml if: ${{ github.event.label.name == vars.PUBLISH_AND_E2E_LABEL }} with: TAG: alpha VERSION: ${{ needs.get-version.outputs.version }} BRANCH: ${{ needs.get-version.outputs.branch }} - ENVIRONMENT: alpha_release + ENVIRONMENT: production secrets: - NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }} SLACK_WEB_HOOK: ${{ secrets.SLACK_WEB_HOOK }} e2e-test: @@ -69,9 +68,10 @@ jobs: remove-label-on-failure: needs: e2e-test if: always() - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest-large steps: - - uses: actions-ecosystem/action-remove-labels@v1 + - name: Remove label on failure if: needs.e2e-test.result != 'success' - with: - labels: ${{ github.event.label.name }} \ No newline at end of file + run: gh pr edit ${{ github.event.pull_request.number }} --remove-label "${{ github.event.label.name }}" + env: + GH_TOKEN: ${{ github.token }} \ No newline at end of file diff --git a/.github/workflows/pr_workflow.yaml b/.github/workflows/pr_workflow.yaml index 4ad6546d1..413e8bed9 100644 --- a/.github/workflows/pr_workflow.yaml +++ b/.github/workflows/pr_workflow.yaml @@ -16,20 +16,23 @@ on: - '**/package-lock.json' - '**/package.json' +env: + ARTIFACTORY_URL: ${{ vars.ARTIFACTORY_URL }} + jobs: build-and-test: - runs-on: ubuntu-22.04 + runs-on: ubuntu-x64 + permissions: + id-token: write # Required for Artifactory OIDC + contents: read steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v3 + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 + - uses: actions/setup-node@3235b876344d2a9aa001b8d1453c930bba69e610 # v3 with: node-version: '22' + - name: Install project dependencies - run: | - echo "Starting npm ci with a 10-minute timeout" - for i in 1 2 3; do # Retry logic, retry 3 times - timeout 10m npm ci --verbose && break || echo "npm ci failed, retrying ($i/3)..." - done + run: npm ci --verbose - name: Run linter run: npm run lint:fix - name: Run Tests @@ -41,9 +44,9 @@ jobs: CI: "" - name: Build packages run: npm run build - - name: Codecov report - uses: codecov/codecov-action@v3 - with: - token: ${{ secrets.CODECOV_TOKEN }} + # - name: Codecov report + # uses: codecov/codecov-action@ab904c41d6ece82784817410c45d8b8c02684457 # v3 + # with: + # token: ${{ secrets.CODECOV_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 000000000..01e23f2ec --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,163 @@ +on: + workflow_call: + inputs: + TAG: + description: "A tag passed from the caller workflow, it decides the type of release. Allowed values are [rc | beta | alpha | public | dev]" + required: true + type: string + VERSION: + description: "A specific version passed from the caller workflow which will be release as it is." + required: true + type: string + BRANCH: + description: "A branch passed from the caller workflow, it decides which branch will be pushed to npm." + required: true + type: string + ENVIRONMENT: + description: "A environment passed from the caller workflow, it controls the reviewing process of a release." + required: true + type: string + default: alpha_release + secrets: + SLACK_WEB_HOOK: + required: true + G_TOKEN: + required: false + APP_ID: + required: false + APP_KEY: + required: false + +jobs: + publish: + runs-on: ubuntu-x64 + environment: ${{ inputs.ENVIRONMENT }} + permissions: + id-token: write # Required for npm OIDC trusted publishing + contents: write # Required for git operations (public releases) + steps: + - name: Create GitHub App token (for public releases) + if: inputs.TAG == 'public' + uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3 + id: get_app_token + with: + client-id: ${{ secrets.APP_ID }} + private_key: ${{ secrets.APP_KEY }} + + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 + + - uses: actions/setup-node@3235b876344d2a9aa001b8d1453c930bba69e610 # v3 + with: + node-version: "22" + registry-url: "https://registry.npmjs.org" + + - name: Install dependencies + run: | + echo "Starting npm ci with a 10-minute timeout" + for i in 1 2 3; do # Retry logic, retry 3 times + timeout 10m npm ci --verbose && break || echo "npm ci failed, retrying ($i/3)..." + done + + - name: Build packages + run: | + npm run lint:fix + npm run build + + - name: Slack Started Notification (public releases only) + if: inputs.TAG == 'public' + run: | + curl -X POST "${{ secrets.SLACK_WEB_HOOK }}" \ + -H 'Content-Type: application/json' \ + -d "{ + \"username\": \"Github Actions\", + \"icon_emoji\": \":ship:\", + \"attachments\": [{ + \"color\": \"good\", + \"title\": \"Flex Plugins CLI\", + \"text\": \":ship_it_parrot: Releasing new public *version* of \\\`flex-plugin-builder\\\`\", + \"actions\": [{ + \"type\": \"button\", + \"text\": \"View Action\", + \"url\": \"${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}\" + }] + }] + }" + + - name: Publish Version + run: | + if [ "${{ inputs.TAG }}" = "public" ]; then + git config user.name github-actions + git config user.email noreply@github.com + fi + npm run publish:${{ inputs.TAG }} ${{ inputs.VERSION }} + env: + VERSION: ${{ inputs.VERSION }} + BRANCH: ${{ inputs.BRANCH }} + NODE_OPTIONS: --no-experimental-fetch + CI: "" + # OIDC authentication - no NODE_AUTH_TOKEN needed for public npm registry + + - name: Retrieve Version (public releases only) + if: inputs.TAG == 'public' + id: publicVersion + run: | + echo "version=$(awk '/version/{gsub(/("|",)/,"",$2);print $2}' lerna.json)" + echo "version=$(awk '/version/{gsub(/("|",)/,"",$2);print $2}' lerna.json)" >> "$GITHUB_OUTPUT" + + - name: Slack Completion Notification + if: always() + run: | + STATUS_COLOR="good" + if [ "${{ job.status }}" = "failure" ]; then + STATUS_COLOR="danger" + elif [ "${{ job.status }}" = "cancelled" ]; then + STATUS_COLOR="warning" + fi + + # Determine message based on release type + if [ "${{ inputs.TAG }}" = "public" ]; then + MESSAGE="🎉:tada: Released a new public *version* \\\`${{ steps.publicVersion.outputs.version }}\\\`" + else + MESSAGE="🎉 Released a new version with *tag* \\\`${{ inputs.TAG }}\\\` and *version* \\\`${{ inputs.VERSION }}\\\`" + fi + + curl -X POST "${{ secrets.SLACK_WEB_HOOK }}" \ + -H 'Content-Type: application/json' \ + -d "{ + \"username\": \"Github Actions\", + \"icon_emoji\": \":ship:\", + \"attachments\": [{ + \"color\": \"${STATUS_COLOR}\", + \"title\": \"Flex Plugins CLI\", + \"text\": \"${MESSAGE}\", + \"actions\": [{ + \"type\": \"button\", + \"text\": \"View Action\", + \"url\": \"${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}\" + }] + }] + }" + + - name: Commit Version (public releases only) + if: inputs.TAG == 'public' + id: commit_version + run: | + git checkout -b bump-version-"$VERSION_NUMBER" + git push origin bump-version-"$VERSION_NUMBER" --no-verify + env: + VERSION_NUMBER: ${{ steps.publicVersion.outputs.version }} + + - name: Create PR for version (public releases only) + if: inputs.TAG == 'public' + run: | + gh pr create --base main --title "Update version" --body "Update version" + env: + GITHUB_TOKEN: ${{ steps.get_app_token.outputs.token }} + + - name: Approve and Merge PR (public releases only) + if: inputs.TAG == 'public' + run: | + gh pr review --approve + gh pr merge --auto --merge + env: + GITHUB_TOKEN: ${{ secrets.G_TOKEN }} diff --git a/.github/workflows/skip_e2e.yaml b/.github/workflows/skip_e2e.yaml index c0e3bc372..e5458f5aa 100644 --- a/.github/workflows/skip_e2e.yaml +++ b/.github/workflows/skip_e2e.yaml @@ -5,7 +5,7 @@ jobs: node: strategy: matrix: - os: [ubuntu-22.04, windows-latest, macos-latest] + os: [ubuntu-latest-large, windows-latest, macos-latest] runs-on: ${{ matrix.os }} steps: - run: echo "e2e not required. Passing status check" diff --git a/.github/workflows/skip_pr_workflow.yaml b/.github/workflows/skip_pr_workflow.yaml index 154c96b69..a9efb9a4c 100644 --- a/.github/workflows/skip_pr_workflow.yaml +++ b/.github/workflows/skip_pr_workflow.yaml @@ -14,7 +14,7 @@ on: jobs: build-and-test: - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest-large steps: - run: echo "Test execution not required. Passing status check" release-alpha-version: diff --git a/.github/workflows/skip_publish.yaml b/.github/workflows/skip_publish.yaml index 7ba5ec764..1b3a9dba9 100644 --- a/.github/workflows/skip_publish.yaml +++ b/.github/workflows/skip_publish.yaml @@ -3,6 +3,6 @@ on: jobs: publish: - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest-large steps: - run: echo "Skip Publish, Passing status check" \ No newline at end of file diff --git a/.github/workflows/tag.yaml b/.github/workflows/tag.yaml index 6ff2d002b..9ae02e7cf 100644 --- a/.github/workflows/tag.yaml +++ b/.github/workflows/tag.yaml @@ -3,12 +3,12 @@ on: jobs: tag: - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest-large steps: - name: wait-job run: sleep 10s shell: bash - - uses: actions/checkout@v4 + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 with: ref: main - name: Retrieve Version diff --git a/.github/workflows/~reusable_e2e_all_OS.yaml b/.github/workflows/~reusable_e2e_all_OS.yaml index 967cf01a5..69794a3a4 100644 --- a/.github/workflows/~reusable_e2e_all_OS.yaml +++ b/.github/workflows/~reusable_e2e_all_OS.yaml @@ -90,7 +90,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ ubuntu-22.04, windows-latest, macos-latest ] + os: [ ubuntu-latest-large, windows-latest-large, macos-latest-large ] uses: ./.github/workflows/~reusable_e2e_by_OS.yaml with: OS: ${{ matrix.os }} diff --git a/.github/workflows/~reusable_e2e_by_OS.yaml b/.github/workflows/~reusable_e2e_by_OS.yaml index e60f7966e..b38b1b100 100644 --- a/.github/workflows/~reusable_e2e_by_OS.yaml +++ b/.github/workflows/~reusable_e2e_by_OS.yaml @@ -77,6 +77,7 @@ on: description: 'A slack-web-hook passed from the caller workflow, it will be used for sending notifications.' required: true env: + ARTIFACTORY_URL: ${{ vars.ARTIFACTORY_URL }} BRANCH: ${{ inputs.BRANCH }} NPM_IGNORE_PREFIX: ${{ inputs.NPM_IGNORE_PREFIX }} PACKAGE_VERSION: ${{ inputs.PACKAGE_VERSION }} @@ -97,24 +98,25 @@ env: jobs: node: runs-on: ${{ inputs.OS }} + permissions: + id-token: write # Required for Artifactory OIDC + contents: read steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v3 + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 + + - uses: actions/setup-node@3235b876344d2a9aa001b8d1453c930bba69e610 # v3 with: node-version: ${{ inputs.NODE_VERSION }} - - name: Override localhost to IPv4 in Linux for Node 18 - run: | - sudo sed -i '/localhost/s/::1/#::1/' /etc/hosts - if: ${{ inputs.OS == 'ubuntu-22.04' && inputs.NODE_VERSION == '18' }} + - name: Install project dependencies (Linux) - if: ${{ inputs.OS == 'ubuntu-22.04' }} + if: ${{ inputs.OS == 'ubuntu-latest-large' }} run: | echo "Starting npm ci with a 10-minute timeout" for i in 1 2 3; do # Retry logic, retry 3 times timeout 10m npm ci --verbose && break || echo "npm ci failed, retrying ($i/3)..." done - name: Install project dependencies (Macos) - if: ${{ inputs.OS == 'macos-latest' }} + if: ${{ inputs.OS == 'macos-latest-large' }} run: | echo "Starting npm ci with a 10-minute timeout" brew install coreutils @@ -122,7 +124,7 @@ jobs: gtimeout 10m npm ci --verbose && break || echo "npm ci failed, retrying ($i/3)..." done - name: Install project dependencies (Windows) - if: ${{ inputs.OS == 'windows-latest' }} + if: ${{ inputs.OS == 'windows-latest-large' }} run: | npm ci --verbose shell: pwsh @@ -130,71 +132,86 @@ jobs: run: | npm run build - name: Run e2e tests - JS (Linux) - if: ${{ inputs.OS == 'ubuntu-22.04' }} + if: ${{ inputs.OS == 'ubuntu-latest-large' }} env: TS: 0 run: | cd packages/flex-plugin-e2e-tests npm run start - name: Run e2e tests - JS (Macos) - if: ${{ inputs.OS == 'macos-latest' }} + if: ${{ inputs.OS == 'macos-latest-large' }} env: TS: 0 run: | cd packages/flex-plugin-e2e-tests npm run start - name: Run e2e tests - JS (Windows) - if: ${{ inputs.OS == 'windows-latest' }} + if: ${{ inputs.OS == 'windows-latest-large' }} env: TS: 0 run: | cd packages/flex-plugin-e2e-tests npm run start - name: Kill node for Windows os - if: ${{ inputs.OS == 'windows-latest' }} + if: ${{ inputs.OS == 'windows-latest-large' }} run: | echo "os is: ${{ inputs.OS }} ${{ runner.os }}" taskkill /f /im node.exe - name: Run e2e tests - TS (Linux) - if: ${{ inputs.OS == 'ubuntu-22.04' }} + if: ${{ inputs.OS == 'ubuntu-latest-large' }} env: TS: 1 run: | cd packages/flex-plugin-e2e-tests npm run start - name: Run e2e tests - TS (Macos) - if: ${{ inputs.OS == 'macos-latest' }} + if: ${{ inputs.OS == 'macos-latest-large' }} env: TS: 1 run: | cd packages/flex-plugin-e2e-tests npm run start - name: Run e2e tests - TS (Windows) - if: ${{ inputs.OS == 'windows-latest' }} + if: ${{ inputs.OS == 'windows-latest-large' }} env: TS: 1 run: | cd packages/flex-plugin-e2e-tests npm run start - name: Upload Screenshots - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 if: always() with: name: ${{ inputs.OS }}-screenshots path: packages/flex-plugin-e2e-tests/screenshots notify-failure: - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest-large needs: node if: ${{ always() && inputs.SEND_NOTIFICATION }} steps: - name: Slack Notification - uses: rtCamp/action-slack-notify@v2 - env: - SLACK_WEBHOOK: ${{ secrets.SLACK_WEB_HOOK }} - SLACK_COLOR: ${{ needs.node.result }} - SLACK_USERNAME: Github Actions - SLACK_ICON_EMOJI: ':ship:' - SLACK_TITLE: '${{ inputs.SLACK_TITLE }} - ${{ inputs.OS }} - ${{ inputs.NODE_VERSION }}' - SLACK_MESSAGE: '${{ github.repository }}/${{ github.ref }} - ${{ inputs.SLACK_MESSAGE }} ${{ needs.node.result }} for ${{ inputs.OS }}.' - MSG_MINIMAL: actions url + run: | + STATUS_COLOR="good" + if [ "${{ needs.node.result }}" = "failure" ]; then + STATUS_COLOR="danger" + elif [ "${{ needs.node.result }}" = "cancelled" ]; then + STATUS_COLOR="warning" + fi + + curl -X POST "${{ secrets.SLACK_WEB_HOOK }}" \ + -H 'Content-Type: application/json' \ + -d "{ + \"username\": \"Github Actions\", + \"icon_emoji\": \":ship:\", + \"attachments\": [{ + \"color\": \"${STATUS_COLOR}\", + \"title\": \"${{ inputs.SLACK_TITLE }} - ${{ inputs.OS }} - ${{ inputs.NODE_VERSION }}\", + \"text\": \"${{ github.repository }}/${{ github.ref }} - ${{ inputs.SLACK_MESSAGE }} ${{ needs.node.result }} for ${{ inputs.OS }}.\", + \"actions\": [{ + \"type\": \"button\", + \"text\": \"View Action\", + \"url\": \"${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}\" + }] + }] + }" diff --git a/.github/workflows/~reusable_public_publish.yaml b/.github/workflows/~reusable_public_publish.yaml deleted file mode 100644 index 46d15aa30..000000000 --- a/.github/workflows/~reusable_public_publish.yaml +++ /dev/null @@ -1,107 +0,0 @@ -on: - workflow_call: - inputs: - TAG: - description: 'A tag passed from the caller workflow, it decides the type of release. Allowed values are [rc | beta | alpha | public | dev]' - required: true - type: string - VERSION: - description: 'A specific version passed from the caller workflow which will be release as it is.' - required: true - type: string - BRANCH: - description: 'A branch passed from the caller workflow, it decides which branch will be pushed to npm.' - required: true - type: string - ENVIRONMENT: - description: 'A environment passed from the caller workflow, it controls the reviewing process of a release.' - required: true - type: string - default: alpha_release - secrets: - NODE_AUTH_TOKEN: - required: true - SLACK_WEB_HOOK: - required: true - G_TOKEN: - required: true - APP_ID: - required: true - APP_KEY: - required: true - -jobs: - publish: - runs-on: ubuntu-22.04 - environment: ${{ inputs.ENVIRONMENT }} - steps: - - uses: actions/create-github-app-token@v3 - id: get_app_token - with: - client-id: ${{ secrets.APP_ID }} - private_key: ${{ secrets.APP_KEY }} - - uses: actions/checkout@v4 - - uses: actions/setup-node@v3 - with: - node-version: '22' - registry-url: 'https://registry.npmjs.org' - - name: Install dependencies - run: | - echo "Starting npm ci with a 10-minute timeout" - for i in 1 2 3; do # Retry logic, retry 3 times - timeout 10m npm ci --verbose && break || echo "npm ci failed, retrying ($i/3)..." - done - - name: Slack Started Notification - uses: rtCamp/action-slack-notify@v2 - env: - SLACK_WEBHOOK: ${{ secrets.SLACK_WEB_HOOK }} - SLACK_COLOR: ${{ job.status }} - SLACK_USERNAME: Github Actions - SLACK_ICON_EMOJI: ':ship:' - SLACK_TITLE: 'Flex Plugins CLI' - SLACK_MESSAGE: ':ship_it_parrot: Releasing new public *version* of `flex-plugin-builder`' - MSG_MINIMAL: actions url - - name: Publish Version - run: | - git config user.name github-actions - git config user.email noreply@github.com - npm run publish:${{ inputs.TAG }} ${{ inputs.VERSION }} - env: - VERSION: ${{ inputs.VERSION }} - BRANCH: ${{ inputs.BRANCH }} - NODE_OPTIONS: --no-experimental-fetch - CI: '' - NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }} - - name: Retrieve Version - id: publicVersion - run: | - echo "version=$(awk '/version/{gsub(/("|",)/,"",$2);print $2}' lerna.json)" - echo "version=$(awk '/version/{gsub(/("|",)/,"",$2);print $2}' lerna.json)" >> "$GITHUB_OUTPUT" - - name: Slack Completed Notification - uses: rtCamp/action-slack-notify@v2 - env: - SLACK_WEBHOOK: ${{ secrets.SLACK_WEB_HOOK }} - SLACK_COLOR: ${{ job.status }} - SLACK_USERNAME: Github Actions - SLACK_ICON_EMOJI: ':ship:' - SLACK_TITLE: 'Flex Plugins CLI' - SLACK_MESSAGE: '🎉:tada: Released a new public *version* `${{ steps.publicVersion.outputs.version }}`' - MSG_MINIMAL: actions url - - name: Commit Version - id: commit_version - run: | - git checkout -b bump-version-"$VERSION_NUMBER" - git push origin bump-version-"$VERSION_NUMBER" --no-verify - env: - VERSION_NUMBER: ${{ steps.publicVersion.outputs.version }} - - name: Create PR for version - run: | - gh pr create --base main --title "Update version" --body "Update version" - env: - GITHUB_TOKEN: ${{ steps.get_app_token.outputs.token }} - - name: Approve and Merge PR - run: | - gh pr review --approve - gh pr merge --auto --merge - env: - GITHUB_TOKEN: ${{ secrets.G_TOKEN }} diff --git a/.github/workflows/~reusable_publish.yaml b/.github/workflows/~reusable_publish.yaml deleted file mode 100644 index 8ce1f3736..000000000 --- a/.github/workflows/~reusable_publish.yaml +++ /dev/null @@ -1,60 +0,0 @@ -on: - workflow_call: - inputs: - TAG: - description: "A tag passed from the caller workflow, it decides the type of release. Allowed values are [rc | beta | alpha | public | dev]" - required: true - type: string - VERSION: - description: "A specific version passed from the caller workflow which will be release as it is." - required: true - type: string - BRANCH: - description: "A branch passed from the caller workflow, it decides which branch will be pushed to npm." - required: true - type: string - ENVIRONMENT: - description: "A environment passed from the caller workflow, it controls the reviewing process of a release." - required: true - type: string - default: alpha_release - secrets: - NODE_AUTH_TOKEN: - required: true - SLACK_WEB_HOOK: - required: true - -jobs: - publish: - runs-on: ubuntu-22.04 - environment: ${{ inputs.ENVIRONMENT }} - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v3 - with: - node-version: "22" - registry-url: "https://registry.npmjs.org" - - name: Install dependencies - run: | - echo "Starting npm ci with a 10-minute timeout" - for i in 1 2 3; do # Retry logic, retry 3 times - timeout 10m npm ci --verbose && break || echo "npm ci failed, retrying ($i/3)..." - done - - name: Publish Version - run: npm run publish:${{ inputs.TAG }} ${{ inputs.VERSION }} - env: - VERSION: ${{ inputs.VERSION }} - BRANCH: ${{ inputs.BRANCH }} - NODE_OPTIONS: --no-experimental-fetch - CI: "" - NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }} - - name: Slack Notification - uses: rtCamp/action-slack-notify@v2 - env: - SLACK_WEBHOOK: ${{ secrets.SLACK_WEB_HOOK }} - SLACK_COLOR: ${{ job.status }} - SLACK_USERNAME: Github Actions - SLACK_ICON_EMOJI: ":ship:" - SLACK_TITLE: "Flex Plugins CLI" - SLACK_MESSAGE: "🎉 Released a new version with *tag* `${{ inputs.TAG }}` and *version* `${{ inputs.VERSION }}`" - MSG_MINIMAL: actions url diff --git a/.npmrc b/.npmrc index 55163311b..85e09c284 100644 --- a/.npmrc +++ b/.npmrc @@ -1 +1 @@ -message=":bookmark: Release v%s" +message=":bookmark: Release v%s" \ No newline at end of file diff --git a/bin/publish b/bin/publish index f2c31f8e4..a69f3dbae 100755 --- a/bin/publish +++ b/bin/publish @@ -62,9 +62,9 @@ echo -e "-- Publishing as \033[1m${tag}\033[0m :: \033[1m${bump}\033[0m release echo -e "-- Publishing as \033[1m${tag}\033[0m :: \033[1m${bump}\033[0m release --" echo -e "------------------------------------\n" -# Run unit-tests one more time -npm run lint:fix -npm run build +# Configure npm to use provenance and ignore scripts +npm config set provenance true +npm config set ignore-scripts true if [ "${tag}" == "public" ] ; then ./node_modules/.bin/lerna publish \ @@ -72,6 +72,7 @@ if [ "${tag}" == "public" ] ; then --no-push \ --exact \ --yes \ + --loglevel verbose \ "${bump}" else ./node_modules/.bin/lerna publish \ @@ -84,6 +85,7 @@ else --no-push \ --exact \ --yes \ + --loglevel verbose \ "${bump}" version=$(awk '/version/{gsub(/("|",)/,"",$2);print $2}' lerna.json) diff --git a/package-lock.json b/package-lock.json index f6084e00a..6f9ee0bda 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12969,17 +12969,6 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/@twilio/cli-core/node_modules/axios": { - "version": "1.6.8", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.8.tgz", - "integrity": "sha512-v/ZHtJDU39mDpyBoFVkETcd/uNdxrWRrg3bKpOKzXFA6Bvqopts6ALSMU3y6ijYxbw2B+wPrIv46egTzJXCLGQ==", - "license": "MIT", - "dependencies": { - "follow-redirects": "^1.15.6", - "form-data": "^4.0.0", - "proxy-from-env": "^1.1.0" - } - }, "node_modules/@twilio/cli-core/node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -16358,13 +16347,14 @@ } }, "node_modules/axios": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.3.4.tgz", - "integrity": "sha512-toYm+Bsyl6VC5wSkfkbbNB6ROv7KY93PEBBL6xyDczaIHasAiv4wPqQ/c4RjoQzipxRD2W5g21cOqQulZ7rHwQ==", + "version": "1.18.1", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.18.1.tgz", + "integrity": "sha512-3nTvFlvpn9Zu/RkHUqtc7/+al4UpRW5az71ap5zccp6e8RAYEzhMTecX8Dz1wWDYrPpUoB1HAQEGEAEvUr7S9g==", "dependencies": { - "follow-redirects": "^1.15.0", - "form-data": "^4.0.0", - "proxy-from-env": "^1.1.0" + "follow-redirects": "^1.16.0", + "form-data": "^4.0.5", + "https-proxy-agent": "^5.0.1", + "proxy-from-env": "^2.1.0" } }, "node_modules/axios-cache-interceptor": { @@ -16422,6 +16412,14 @@ "node": ">=4" } }, + "node_modules/axios/node_modules/proxy-from-env": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-2.1.0.tgz", + "integrity": "sha512-cJ+oHTW1VAEa8cJslgmUZrc+sjRKgAKl3Zyse6+PV38hZe/V6Z14TbCuXcan9F9ghlz4QrFr2c92TNF82UkYHA==", + "engines": { + "node": ">=10" + } + }, "node_modules/babel-eslint": { "version": "10.1.0", "resolved": "https://registry.npmjs.org/babel-eslint/-/babel-eslint-10.1.0.tgz", @@ -17786,6 +17784,18 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/call-bind-apply-helpers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/callsites": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", @@ -20753,6 +20763,19 @@ "node": ">=4" } }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/duplexer": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.2.tgz", @@ -21045,14 +21068,42 @@ "resolved": "https://registry.npmjs.org/es-array-method-boxes-properly/-/es-array-method-boxes-properly-1.0.0.tgz", "integrity": "sha512-wd6JXUmyHmt8T5a2xreUwKcGPq6f1f+WwIJkijUqiGcJz1qqnZgP6XIK+QyIWU5lT7imeNxUll48bziG+TSYcA==" }, + "node_modules/es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-object-atoms": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.2.tgz", + "integrity": "sha512-HWcBoN6NileqtSydK2FqHbS/LoDd2pqrnQHLyJzBj4kOp/ky2MWMN694xOfkK8/SnUsW2DH7EfyVlydKCsm1Zw==", + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/es-set-tostringtag": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.1.tgz", - "integrity": "sha512-g3OMbtlwY3QewlqAiMLI47KywjWZoEytKr8pf6iTC8uJq5bIAH52Z9pnQ8pVL6whrCto53JZDuUIsifGeLorTg==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz", + "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==", "dependencies": { - "get-intrinsic": "^1.1.3", - "has": "^1.0.3", - "has-tostringtag": "^1.0.0" + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" }, "engines": { "node": ">= 0.4" @@ -23255,9 +23306,9 @@ "license": "0BSD" }, "node_modules/follow-redirects": { - "version": "1.15.6", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.6.tgz", - "integrity": "sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==", + "version": "1.16.0", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.16.0.tgz", + "integrity": "sha512-y5rN/uOsadFT/JfYwhxRS5R7Qce+g3zG97+JrtFZlC9klX/W5hD7iiLzScI4nZqUS7DNUdhPgw4xI8W2LuXlUw==", "funding": [ { "type": "individual", @@ -23322,13 +23373,15 @@ } }, "node_modules/form-data": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", - "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.6.tgz", + "integrity": "sha512-vKatAh4SlVfgbv+YtmhiRjhEMJsYpsG1Y2rMQtR+SVSbytsSD1YGzDIcrAJmdFec88u/+VoGmxnl+80gL1tRCQ==", "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", - "mime-types": "^2.1.12" + "es-set-tostringtag": "^2.1.0", + "hasown": "^2.0.4", + "mime-types": "^2.1.35" }, "engines": { "node": ">= 6" @@ -23580,13 +23633,23 @@ } }, "node_modules/get-intrinsic": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.0.tgz", - "integrity": "sha512-L049y6nFOuom5wGyRc3/gdTLO94dySVKRACj1RmJZBQXlbTMhtNIgkWkUHq+jYmZvKf14EW1EoJnnjbmoHij0Q==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", "dependencies": { - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.3" + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "function-bind": "^1.1.2", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -23774,6 +23837,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/get-stream": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", @@ -24259,11 +24334,11 @@ } }, "node_modules/gopd": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", - "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", - "dependencies": { - "get-intrinsic": "^1.1.3" + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -24467,9 +24542,9 @@ } }, "node_modules/has-symbols": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", "engines": { "node": ">= 0.4" }, @@ -24478,11 +24553,11 @@ } }, "node_modules/has-tostringtag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz", - "integrity": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", "dependencies": { - "has-symbols": "^1.0.2" + "has-symbols": "^1.0.3" }, "engines": { "node": ">= 0.4" @@ -24624,9 +24699,9 @@ } }, "node_modules/hasown": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", - "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.4.tgz", + "integrity": "sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A==", "dependencies": { "function-bind": "^1.1.2" }, @@ -31841,6 +31916,14 @@ "react-dom": "^16.3.0" } }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "engines": { + "node": ">= 0.4" + } + }, "node_modules/math-random": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/math-random/-/math-random-1.0.4.tgz", @@ -43998,7 +44081,7 @@ "devDependencies": { "@twilio/flex-plugin": "7.1.2", "@twilio/flex-plugin-scripts": "7.1.2", - "@twilio/flex-ui": "^1", + "@twilio/flex-ui": "^2", "@types/tmp": "^0.2.1", "@types/yargs": "^16.0.4" } @@ -45150,16 +45233,6 @@ "node": ">=4" } }, - "packages/flex-dev-utils/node_modules/axios": { - "version": "1.6.8", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.8.tgz", - "integrity": "sha512-v/ZHtJDU39mDpyBoFVkETcd/uNdxrWRrg3bKpOKzXFA6Bvqopts6ALSMU3y6ijYxbw2B+wPrIv46egTzJXCLGQ==", - "dependencies": { - "follow-redirects": "^1.15.6", - "form-data": "^4.0.0", - "proxy-from-env": "^1.1.0" - } - }, "packages/flex-dev-utils/node_modules/buffer": { "version": "6.0.3", "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", @@ -45490,7 +45563,7 @@ "version": "7.1.2", "license": "MIT", "devDependencies": { - "@twilio/flex-ui": "^1" + "@twilio/flex-ui": "^2" } }, "packages/flex-plugin-e2e-tests": { @@ -45500,7 +45573,7 @@ "dependencies": { "@twilio/flex-dev-utils": "7.1.2", "@twilio/flex-plugins-api-client": "7.1.2", - "axios": "^0.24.0", + "axios": "^1.6.4", "lodash": "4.17.21", "node-fetch": "^3.3.2", "package-json": "^7.0.0", @@ -45546,15 +45619,6 @@ "dev": true, "license": "MIT" }, - "packages/flex-plugin-e2e-tests/node_modules/axios": { - "version": "0.24.0", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.24.0.tgz", - "integrity": "sha512-Q6cWsys88HoPgAaFAVUb0WpPk0O8iTeisR9IMqy9G8AbO4NlpVknrnQS03zzF9PGAWgO3cgletO3VjV/P7VztA==", - "license": "MIT", - "dependencies": { - "follow-redirects": "^1.14.4" - } - }, "packages/flex-plugin-e2e-tests/node_modules/cacheable-request": { "version": "7.0.4", "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-7.0.4.tgz", diff --git a/package.json b/package.json index 1fd18af89..8d1e574bf 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,7 @@ "bootstrap": "lerna bootstrap --no-ci", "build": "lerna run build", "clean": "lerna run clean", + "cleanup": "rm -rf node_modules packages/*/node_modules", "coverage": "codecov", "docs": "./bin/docs-generator.js", "link-packages": "node link-packages.js", diff --git a/packages/create-flex-plugin/package.json b/packages/create-flex-plugin/package.json index 207b7ebf7..1bb674029 100644 --- a/packages/create-flex-plugin/package.json +++ b/packages/create-flex-plugin/package.json @@ -50,7 +50,7 @@ "devDependencies": { "@twilio/flex-plugin": "7.1.2", "@twilio/flex-plugin-scripts": "7.1.2", - "@twilio/flex-ui": "^1", + "@twilio/flex-ui": "^2", "@types/tmp": "^0.2.1", "@types/yargs": "^16.0.4" }, diff --git a/packages/create-flex-plugin/templates/ts/package.json b/packages/create-flex-plugin/templates/ts/package.json index 8bc3d335f..e388fc061 100644 --- a/packages/create-flex-plugin/templates/ts/package.json +++ b/packages/create-flex-plugin/templates/ts/package.json @@ -14,6 +14,7 @@ "devDependencies": { "@twilio/flex-plugin-scripts": "{{pluginScriptsVersion}}", "@twilio/flex-ui": "{{flexSdkVersion}}", + "@types/node": "^14.18.63", "react-test-renderer": "16.5.2", "typescript": "^4" } diff --git a/packages/create-flex-plugin/templates/ts2/package.json b/packages/create-flex-plugin/templates/ts2/package.json index a755afb22..2833f03f9 100644 --- a/packages/create-flex-plugin/templates/ts2/package.json +++ b/packages/create-flex-plugin/templates/ts2/package.json @@ -16,6 +16,7 @@ "devDependencies": { "@twilio/flex-plugin-scripts": "{{pluginScriptsVersion}}", "@twilio/flex-ui": "{{flexSdkVersion}}", + "@types/node": "^14.18.63", "react-test-renderer": "17.0.2", "typescript": "^4" } diff --git a/packages/flex-plugin-e2e-tests/package.json b/packages/flex-plugin-e2e-tests/package.json index a0655cb24..beb67be91 100644 --- a/packages/flex-plugin-e2e-tests/package.json +++ b/packages/flex-plugin-e2e-tests/package.json @@ -36,7 +36,7 @@ "dependencies": { "@twilio/flex-dev-utils": "7.1.2", "@twilio/flex-plugins-api-client": "7.1.2", - "axios": "^0.24.0", + "axios": "^1.6.4", "lodash": "4.17.21", "node-fetch": "^3.3.2", "package-json": "^7.0.0", diff --git a/packages/flex-plugin-e2e-tests/src/tests/step001.ts b/packages/flex-plugin-e2e-tests/src/tests/step001.ts index 5f6083860..5c67271e3 100644 --- a/packages/flex-plugin-e2e-tests/src/tests/step001.ts +++ b/packages/flex-plugin-e2e-tests/src/tests/step001.ts @@ -1,4 +1,6 @@ /* eslint-disable import/no-unused-modules */ +import { join } from 'path'; + import { TestSuite, TestParams } from '../core'; import { spawn } from '../utils'; @@ -13,6 +15,14 @@ const testSuite: TestSuite = async ({ environment, scenario }: TestParams): Prom await spawn('npm', cliInstallArgs); await spawn('twilio', ['plugins:install', `@twilio-labs/plugin-flex@${scenario.packageVersion}`]); + + // /* + // * Link local packages to replace the installed CLI with local development version + // * Go up two directories from e2e-tests package to reach repo root + // */ + // const repoRoot = join(environment.cwd, '..', '..'); + // const linkPackagesScript = join(repoRoot, 'link-packages.js'); + // await spawn('node', [linkPackagesScript], { cwd: repoRoot }); }; testSuite.description = 'Installing Twilio CLI and Plugins CLI'; diff --git a/packages/flex-plugin/package.json b/packages/flex-plugin/package.json index 4f54d885c..7e52d9fc5 100644 --- a/packages/flex-plugin/package.json +++ b/packages/flex-plugin/package.json @@ -37,7 +37,7 @@ "test:watch": "cd ../.. && jest packages/flex-plugin --watch --color" }, "devDependencies": { - "@twilio/flex-ui": "^1" + "@twilio/flex-ui": "^2" }, "publishConfig": { "access": "public"