From c4468020901d93f045001c7df66e0798d8c3d6ff Mon Sep 17 00:00:00 2001 From: Ryan Johnson <43426700+ryanjohnsontv@users.noreply.github.com> Date: Thu, 4 Apr 2024 10:55:35 -0500 Subject: [PATCH] Update 1.29.7 (#3) * fix: UI crashes when running pipeline(s) with many stages. (backport #9960) (#9974) Co-authored-by: armory-abedonik <106548537+armory-abedonik@users.noreply.github.com> * Revert "fix(core): conditionally hide expression evaluation warning messages (#9771)" (#10021) (#10025) This reverts commit 7e3dd5053ccdb06ce067303062f90ae82b56bfc8. (cherry picked from commit 62033d0fc6f0a953bd3f01e4452664b92fd02dfb) Co-authored-by: Matt Gogerly <6519811+mattgogerly@users.noreply.github.com> * fix: Scaling bounds should parse float not int (#10026) (#10035) * fix: Scaling bounds should parse float not int Currently the API can do this, the model supports this, but the parseInt removes decimals from the UI * fix: Decimal support for upper/lower bound ASG tests (cherry picked from commit b763cae826039df46b8dbe019689316ff5034e33) Co-authored-by: Jason * Fix CreateSecurityGroups ternary * Remove failing test for disabled action * Temporally adding GH workflows to build Docker from this branch * Temporally disabling other GHA workflows * Adding 'thd' prefix to IMAGE_NAME env var * Changing image name from 'deck' to 'thd-deck' * Apply master GHA changes --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Co-authored-by: armory-abedonik <106548537+armory-abedonik@users.noreply.github.com> Co-authored-by: Matt Gogerly <6519811+mattgogerly@users.noreply.github.com> Co-authored-by: Jason Co-authored-by: Rodrigo Tovar --- .github/workflows/build.yml | 125 +++++++--------- .github/workflows/docker-build.yml | 74 ++++++++++ .github/workflows/package-bump-pr.yml | 118 --------------- .github/workflows/pr-build.yml | 28 ++++ .github/workflows/pr.yml | 77 ---------- .github/workflows/publish.yml | 57 ------- .github/workflows/release.yml | 139 ------------------ .github/workflows/release_info.sh | 41 ------ .../upsert/step/StepPolicyAction.tsx | 4 +- .../pipeline/config/graph/PipelineGraph.tsx | 13 +- .../pipeline/details/StageFailureMessage.tsx | 34 ++--- .../core/src/securityGroup/SecurityGroups.tsx | 2 +- .../serverGroup.transformer.spec.ts | 11 +- .../google/accelerator_zones.spec.js | 40 ----- 14 files changed, 185 insertions(+), 578 deletions(-) create mode 100644 .github/workflows/docker-build.yml delete mode 100644 .github/workflows/package-bump-pr.yml create mode 100644 .github/workflows/pr-build.yml delete mode 100644 .github/workflows/pr.yml delete mode 100644 .github/workflows/publish.yml delete mode 100644 .github/workflows/release.yml delete mode 100755 .github/workflows/release_info.sh delete mode 100644 test/functional/cypress/integration/google/accelerator_zones.spec.js diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8e223f1e370..d978288dd2f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,99 +1,74 @@ -name: Branch Build +name: "Build Docker image for Deck and push it to GitHub Container Registry" on: - push: - branches: - - master - - release-* + workflow_call: + inputs: + IMAGE_VERSION: + description: "Version to use for image tag" + required: true + default: "0.0.0" + type: string + BRANCH: + description: "Git branch to fetch code from" + required: true + default: "master" + type: string env: - GRADLE_OPTS: -Dorg.gradle.daemon=false -Xmx2g -Xms2g - CONTAINER_REGISTRY: us-docker.pkg.dev/spinnaker-community/docker - NODE_VERSION: 12.16.0 - -permissions: - contents: read + CONTAINER_REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository_owner }}/thd-${{ github.event.repository.name }} jobs: - branch-build: - # Only run this on repositories in the 'spinnaker' org, not on forks. - if: startsWith(github.repository, 'spinnaker/') + push: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: fetch-depth: 0 + ref: ${{ inputs.BRANCH }} - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - uses: actions/setup-node@v1 + - uses: actions/download-artifact@v4 with: - node-version: ${{ env.NODE_VERSION }} + name: build + path: build/webpack - - name: Get yarn cache - id: yarn-cache - run: echo "::set-output name=dir::$(yarn cache dir)" + - name: Set release info + run: | + release_version=${{ inputs.IMAGE_VERSION }} + echo "RELEASE_VERSION=$release_version" >> $GITHUB_ENV + echo "TAGS=${{ env.CONTAINER_REGISTRY }}/${{ env.IMAGE_NAME }}:$release_version" >> $GITHUB_ENV - - uses: actions/cache@v1 + - name: Login + uses: docker/login-action@v3 with: - path: ${{ steps.yarn-cache.outputs.dir }} - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- + registry: ${{ env.CONTAINER_REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} - - uses: actions/setup-java@v2 - with: - java-version: 11 - distribution: 'zulu' - cache: 'gradle' + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 - - name: Prepare build variables - id: build_variables + - name: Set up docker context for buildx + id: buildx-context run: | - echo ::set-output name=REPO::${GITHUB_REPOSITORY##*/} - echo ::set-output name=VERSION::"$(git describe --tags --abbrev=0 --match="v[0-9]*" | cut -c2-)-dev-${GITHUB_REF_NAME}-$(git rev-parse --short HEAD)-$(date --utc +'%Y%m%d%H%M')" - - - name: Build - env: - ORG_GRADLE_PROJECT_version: ${{ steps.build_variables.outputs.VERSION }} - run: ./gradlew build --stacktrace - - - name: Login to GAR - # Only run this on repositories in the 'spinnaker' org, not on forks. - if: startsWith(github.repository, 'spinnaker/') - uses: docker/login-action@v1 - # use service account flow defined at: https://github.com/docker/login-action#service-account-based-authentication-1 - with: - registry: us-docker.pkg.dev - username: _json_key - password: ${{ secrets.GAR_JSON_KEY }} + docker context create builders - - name: Build and publish slim container image - # Only run this on repositories in the 'spinnaker' org, not on forks. - if: startsWith(github.repository, 'spinnaker/') - uses: docker/build-push-action@v3 + - name: Set up docker buildx + uses: docker/setup-buildx-action@v3 with: - context: . - file: Dockerfile.slim - platforms: linux/amd64,linux/arm64 - push: true - tags: | - "${{ env.CONTAINER_REGISTRY }}/${{ steps.build_variables.outputs.REPO }}:${{ github.ref_name }}-latest-unvalidated" - "${{ env.CONTAINER_REGISTRY }}/${{ steps.build_variables.outputs.REPO }}:${{ steps.build_variables.outputs.VERSION }}-unvalidated" - "${{ env.CONTAINER_REGISTRY }}/${{ steps.build_variables.outputs.REPO }}:${{ github.ref_name }}-latest-unvalidated-slim" - "${{ env.CONTAINER_REGISTRY }}/${{ steps.build_variables.outputs.REPO }}:${{ steps.build_variables.outputs.VERSION }}-unvalidated-slim" + endpoint: builders + driver-opts: | + image=moby/buildkit:master - - name: Build and publish ubuntu container image - # Only run this on repositories in the 'spinnaker' org, not on forks. - if: startsWith(github.repository, 'spinnaker/') - uses: docker/build-push-action@v3 + - name: Build and push + id: docker_build + uses: docker/build-push-action@v5 with: context: . - file: Dockerfile.ubuntu - platforms: linux/amd64,linux/arm64 push: true - tags: | - "${{ env.CONTAINER_REGISTRY }}/${{ steps.build_variables.outputs.REPO }}:${{ github.ref_name }}-latest-unvalidated-ubuntu" - "${{ env.CONTAINER_REGISTRY }}/${{ steps.build_variables.outputs.REPO }}:${{ steps.build_variables.outputs.VERSION }}-unvalidated-ubuntu" + file: "./Dockerfile.ubuntu" + platforms: linux/amd64 + tags: ${{ env.TAGS }} + labels: | + org.opencontainers.image.source=https://github.com/${{ env.IMAGE_NAME }} + org.opencontainers.image.version=${{ env.RELEASE_VERSION }} \ No newline at end of file diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml new file mode 100644 index 00000000000..d978288dd2f --- /dev/null +++ b/.github/workflows/docker-build.yml @@ -0,0 +1,74 @@ +name: "Build Docker image for Deck and push it to GitHub Container Registry" + +on: + workflow_call: + inputs: + IMAGE_VERSION: + description: "Version to use for image tag" + required: true + default: "0.0.0" + type: string + BRANCH: + description: "Git branch to fetch code from" + required: true + default: "master" + type: string + +env: + CONTAINER_REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository_owner }}/thd-${{ github.event.repository.name }} + +jobs: + push: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + ref: ${{ inputs.BRANCH }} + + - uses: actions/download-artifact@v4 + with: + name: build + path: build/webpack + + - name: Set release info + run: | + release_version=${{ inputs.IMAGE_VERSION }} + echo "RELEASE_VERSION=$release_version" >> $GITHUB_ENV + echo "TAGS=${{ env.CONTAINER_REGISTRY }}/${{ env.IMAGE_NAME }}:$release_version" >> $GITHUB_ENV + + - name: Login + uses: docker/login-action@v3 + with: + registry: ${{ env.CONTAINER_REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up docker context for buildx + id: buildx-context + run: | + docker context create builders + + - name: Set up docker buildx + uses: docker/setup-buildx-action@v3 + with: + endpoint: builders + driver-opts: | + image=moby/buildkit:master + + - name: Build and push + id: docker_build + uses: docker/build-push-action@v5 + with: + context: . + push: true + file: "./Dockerfile.ubuntu" + platforms: linux/amd64 + tags: ${{ env.TAGS }} + labels: | + org.opencontainers.image.source=https://github.com/${{ env.IMAGE_NAME }} + org.opencontainers.image.version=${{ env.RELEASE_VERSION }} \ No newline at end of file diff --git a/.github/workflows/package-bump-pr.yml b/.github/workflows/package-bump-pr.yml deleted file mode 100644 index add66d84e12..00000000000 --- a/.github/workflows/package-bump-pr.yml +++ /dev/null @@ -1,118 +0,0 @@ -name: Create package bump PR - -concurrency: - group: create-package-bump-pr - cancel-in-progress: true - -on: - push: - branches: - - 'master' - tags: - - '@spinnaker/*' - -env: - NODE_VERSION: 12.16.0 - -jobs: - build: - # Only run this on repositories in the 'spinnaker' org, not on forks. - if: startsWith(github.repository, 'spinnaker/') - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 0 - ref: master - - - name: git - configure commit user - run: | - git config user.name spinnakerbot - git config user.email spinnakerbot@spinnaker.io - git checkout master - - - uses: actions/setup-node@v1 - with: - node-version: ${{ env.NODE_VERSION }} - - - name: yarn - get cache dir - id: yarn-cache - run: echo "::set-output name=dir::$(yarn cache dir)" - - - uses: actions/cache@v1 - with: - path: ${{ steps.yarn-cache.outputs.dir }} - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- - - - name: yarn - Install Dependencies - run: yarn --frozen-lockfile - - - name: lerna - Bump packages - id: lerna_bump - run: | - scripts/gha_bump_packages.sh - env: - COMMIT_SHA: ${{ github.sha }} - - name: gha - get bumped packages - id: bumps - run: | - scripts/gha_output_bumped_packages.sh - scripts/gha_output_changelog.sh - env: - PACKAGE_BUMP_COMMIT_HASH: ${{ steps.lerna_bump.outputs.packageBumpCommitHash }} - PEERDEP_BUMP_COMMIT_HASH: ${{ steps.lerna_bump.outputs.peerdepBumpCommitHash }} - - name: Create Pull Request - id: createpullrequest - uses: peter-evans/create-pull-request@v3 - with: - token: '${{ secrets.SPINNAKERBOT_PERSONAL_ACCESS_TOKEN }}' - commit-message: 'chore(package): Publish ${{ steps.bumps.outputs.bumps }}' - title: 'Publish packages to NPM' - labels: publish - body: | - ### This PR bumps the version(s) of all Deck package(s) that have unpublished changes. - - ${{ steps.bumps.outputs.changelog }} - - --- - - This PR bumps each package to the next semver version (patch/minor/major) based on the commit messages of unpublished changes using [Conventional Commits](https://conventionalcommits.org). - - - fix: patch release - - feat: minor release - - BREAKING CHANGE: major release - - It also updates dependency versions in other packages in the monorepo which depend on the bumped package(s). - - After this PR is merged, Github Actions will publish any bumped packages to the NPM registry. - - _Auto-generated by `.github/workflows/package-bump-pr.yml`_ - - - name: Close package bump due to no changes - if: ${{ steps.lerna_bump.outputs.packageBumpCommitHash == '' && steps.createpullrequest.outputs.pull-request-number != '' }} - uses: actions/github-script@0.9.0 - with: - github-token: '${{ secrets.SPINNAKERBOT_PERSONAL_ACCESS_TOKEN }}' - script: | - const { owner, repo } = context.repo; - const pull_number = ${{ steps.createpullrequest.outputs.pull-request-number }}; - await github.pulls.update({ owner, repo, pull_number, state: 'closed' }); - - - name: Approve package bump - if: ${{ steps.lerna_bump.outputs.packageBumpCommitHash != '' && steps.createpullrequest.outputs.pull-request-number != '' }} - uses: actions/github-script@0.9.0 - with: - github-token: '${{ secrets.SPINNAKERBOT_TOKEN }}' - script: | - const { owner, repo } = context.repo; - const pull_number = ${{ steps.createpullrequest.outputs.pull-request-number }}; - const users = ['spinnakerbot', 'spinnakerbot2']; - - const reviews = await github.pulls.listReviews({ owner, repo, pull_number }); - const approved = reviews.data.some((review) => users.includes(review.user.login) && review.state == 'APPROVED'); - - if (!approved) { - await github.pulls.createReview({ owner, repo, pull_number, event: 'APPROVE' }); - } diff --git a/.github/workflows/pr-build.yml b/.github/workflows/pr-build.yml new file mode 100644 index 00000000000..b3723a4bfb9 --- /dev/null +++ b/.github/workflows/pr-build.yml @@ -0,0 +1,28 @@ +name: Release + +on: + workflow_dispatch: + inputs: + BRANCH: + description: 'Git branch to fetch code from' + required: true + default: 'master' + type: string + THD_DECK_VERSION: + description: 'Version of THD Deck' + required: true + default: "0.0.0" + type: string + +jobs: + build: + uses: ./.github/workflows/build.yml + with: + BRANCH: ${{ inputs.BRANCH }} + + docker: + needs: build + uses: ./.github/workflows/docker-build.yml + with: + BRANCH: ${{ inputs.BRANCH }} + IMAGE_VERSION: ${{ inputs.THD_DECK_VERSION }} \ No newline at end of file diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml deleted file mode 100644 index 068486d6bae..00000000000 --- a/.github/workflows/pr.yml +++ /dev/null @@ -1,77 +0,0 @@ -name: PR Build - -on: [ pull_request ] - -env: - GRADLE_OPTS: -Dorg.gradle.daemon=false -Xmx2g -Xms2g - CONTAINER_REGISTRY: us-docker.pkg.dev/spinnaker-community/docker - NODE_VERSION: 12.16.0 - -permissions: - contents: read - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - uses: actions/setup-node@v1 - with: - node-version: ${{ env.NODE_VERSION }} - - - name: Get yarn cache - id: yarn-cache - run: echo "::set-output name=dir::$(yarn cache dir)" - - - uses: actions/cache@v1 - with: - path: ${{ steps.yarn-cache.outputs.dir }} - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- - - - uses: actions/setup-java@v2 - with: - java-version: 11 - distribution: 'zulu' - cache: 'gradle' - - - name: Prepare build variables - id: build_variables - run: | - echo ::set-output name=REPO::${GITHUB_REPOSITORY##*/} - echo ::set-output name=VERSION::"$(git describe --tags --abbrev=0 --match="v[0-9]*" | cut -c2-)-dev-pr-$(git rev-parse --short HEAD)-$(date --utc +'%Y%m%d%H%M')" - - - name: Build - env: - ORG_GRADLE_PROJECT_version: ${{ steps.build_variables.outputs.VERSION }} - run: ./gradlew build - - - name: Build slim container image - uses: docker/build-push-action@v3 - with: - context: . - file: Dockerfile.slim - platforms: linux/amd64,linux/arm64 - tags: | - "${{ env.CONTAINER_REGISTRY }}/${{ steps.build_variables.outputs.REPO }}:latest" - "${{ env.CONTAINER_REGISTRY }}/${{ steps.build_variables.outputs.REPO }}:${{ steps.build_variables.outputs.VERSION }}" - "${{ env.CONTAINER_REGISTRY }}/${{ steps.build_variables.outputs.REPO }}:latest-slim" - "${{ env.CONTAINER_REGISTRY }}/${{ steps.build_variables.outputs.REPO }}:${{ steps.build_variables.outputs.VERSION }}-slim" - - - name: Build ubuntu container image - uses: docker/build-push-action@v3 - with: - context: . - file: Dockerfile.ubuntu - platforms: linux/amd64,linux/arm64 - tags: | - "${{ env.CONTAINER_REGISTRY }}/${{ steps.build_variables.outputs.REPO }}:latest-ubuntu" - "${{ env.CONTAINER_REGISTRY }}/${{ steps.build_variables.outputs.REPO }}:${{ steps.build_variables.outputs.VERSION }}-ubuntu" diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml deleted file mode 100644 index d734c9a0718..00000000000 --- a/.github/workflows/publish.yml +++ /dev/null @@ -1,57 +0,0 @@ -name: Publish packages to NPM - -on: - push: - branches: - - 'master' - paths: - - 'packages/*/package.json' - -env: - NODE_VERSION: 12.16.0 - -permissions: - contents: read - -jobs: - publish: - permissions: - contents: none - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 0 - token: '${{ secrets.SPINNAKERBOT_PERSONAL_ACCESS_TOKEN }}' - - - uses: actions/setup-node@v1 - with: - node-version: ${{ env.NODE_VERSION }} - - - name: git - tag bumped packages - id: tag - run: | - git config user.name spinnakerbot - git config user.email spinnakerbot@spinnaker.io - scripts/gha_tag_bumped_packages.sh - - - name: yarn - if: ${{ steps.tag.outputs.tagged == 'true' }} - run: yarn --frozen-lockfile - - - name: build all packages - if: ${{ steps.tag.outputs.tagged == 'true' }} - run: npx lerna run build - env: - NODE_ENV: production - - - name: publish packages to npm - if: ${{ steps.tag.outputs.tagged == 'true' }} - run: | - npm config set //registry.npmjs.org/:_authToken=$NPM_AUTH_TOKEN - # Publish all changed packages, but do not build a second time - npx lerna publish from-git --yes --ignore-scripts - env: - CI: true - NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 628b8c68e2e..00000000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,139 +0,0 @@ -name: Release - -on: - push: - tags: - - "v[0-9]+.[0-9]+.[0-9]+" - - "v[0-9]+.[0-9]+.[0-9]+-rc.[0-9]+" - -env: - GRADLE_OPTS: -Dorg.gradle.daemon=false -Xmx2g -Xms2g - CONTAINER_REGISTRY: us-docker.pkg.dev/spinnaker-community/docker - NODE_VERSION: 12.16.0 - -jobs: - release: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - uses: actions/setup-node@v1 - with: - node-version: ${{ env.NODE_VERSION }} - - - name: Get yarn cache - id: yarn-cache - run: echo "::set-output name=dir::$(yarn cache dir)" - - - uses: actions/cache@v1 - with: - path: ${{ steps.yarn-cache.outputs.dir }} - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- - - - uses: actions/setup-java@v2 - with: - java-version: 11 - distribution: 'zulu' - cache: 'gradle' - - name: Assemble release info - id: release_info - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - . .github/workflows/release_info.sh ${{ github.event.repository.full_name }} - echo ::set-output name=CHANGELOG::$(echo -e "${CHANGELOG}") - echo ::set-output name=SKIP_RELEASE::${SKIP_RELEASE} - echo ::set-output name=IS_CANDIDATE::${IS_CANDIDATE} - echo ::set-output name=RELEASE_VERSION::${RELEASE_VERSION} - - name: Prepare build variables - id: build_variables - run: | - echo ::set-output name=REPO::${GITHUB_REPOSITORY##*/} - echo ::set-output name=VERSION::"$(git rev-parse --short HEAD)-$(date --utc +'%Y%m%d%H%M')" - - name: Release build - env: - ORG_GRADLE_PROJECT_version: ${{ steps.release_info.outputs.RELEASE_VERSION }} - ORG_GRADLE_PROJECT_nexusPublishEnabled: true - ORG_GRADLE_PROJECT_nexusUsername: ${{ secrets.NEXUS_USERNAME }} - ORG_GRADLE_PROJECT_nexusPassword: ${{ secrets.NEXUS_PASSWORD }} - ORG_GRADLE_PROJECT_nexusPgpSigningKey: ${{ secrets.NEXUS_PGP_SIGNING_KEY }} - ORG_GRADLE_PROJECT_nexusPgpSigningPassword: ${{ secrets.NEXUS_PGP_SIGNING_PASSWORD }} - run: | - ./gradlew --info build - - name: Publish apt packages to Google Artifact Registry - env: - ORG_GRADLE_PROJECT_version: ${{ steps.release_info.outputs.RELEASE_VERSION }} - ORG_GRADLE_PROJECT_artifactRegistryPublishEnabled: true - GAR_JSON_KEY: ${{ secrets.GAR_JSON_KEY }} - run: | - ./gradlew --info publishDebToArtifactRegistry - - name: Login to Google Cloud - # Only run this on repositories in the 'spinnaker' org, not on forks. - if: startsWith(github.repository, 'spinnaker/') - uses: 'google-github-actions/auth@v0' - # use service account flow defined at: https://github.com/google-github-actions/upload-cloud-storage#authenticating-via-service-account-key-json - with: - credentials_json: '${{ secrets.GAR_JSON_KEY }}' - - name: Upload halconfig profiles to GCS - # https://console.cloud.google.com/storage/browser/halconfig - # Only run this on repositories in the 'spinnaker' org, not on forks. - if: startsWith(github.repository, 'spinnaker/') - uses: 'google-github-actions/upload-cloud-storage@v0' - with: - path: 'halconfig/' - destination: 'halconfig/${{ steps.build_variables.outputs.REPO }}/${{ steps.release_info.outputs.RELEASE_VERSION }}' - parent: false - - name: Login to GAR - # Only run this on repositories in the 'spinnaker' org, not on forks. - if: startsWith(github.repository, 'spinnaker/') - uses: docker/login-action@v1 - # use service account flow defined at: https://github.com/docker/login-action#service-account-based-authentication-1 - with: - registry: us-docker.pkg.dev - username: _json_key - password: ${{ secrets.GAR_JSON_KEY }} - - name: Build and publish slim container image - # Only run this on repositories in the 'spinnaker' org, not on forks. - if: startsWith(github.repository, 'spinnaker/') - uses: docker/build-push-action@v3 - with: - context: . - file: Dockerfile.slim - platforms: linux/amd64,linux/arm64 - push: true - tags: | - "${{ env.CONTAINER_REGISTRY }}/${{ steps.build_variables.outputs.REPO }}:${{ steps.release_info.outputs.RELEASE_VERSION }}-unvalidated" - "${{ env.CONTAINER_REGISTRY }}/${{ steps.build_variables.outputs.REPO }}:${{ steps.release_info.outputs.RELEASE_VERSION }}-unvalidated-slim" - "${{ env.CONTAINER_REGISTRY }}/${{ steps.build_variables.outputs.REPO }}:${{ steps.release_info.outputs.RELEASE_VERSION }}-${{ steps.build_variables.outputs.VERSION }}-unvalidated-slim" - - name: Build and publish ubuntu container image - # Only run this on repositories in the 'spinnaker' org, not on forks. - if: startsWith(github.repository, 'spinnaker/') - uses: docker/build-push-action@v3 - with: - context: . - file: Dockerfile.ubuntu - platforms: linux/amd64,linux/arm64 - push: true - tags: | - "${{ env.CONTAINER_REGISTRY }}/${{ steps.build_variables.outputs.REPO }}:${{ steps.release_info.outputs.RELEASE_VERSION }}-unvalidated-ubuntu" - "${{ env.CONTAINER_REGISTRY }}/${{ steps.build_variables.outputs.REPO }}:${{ steps.release_info.outputs.RELEASE_VERSION }}-${{ steps.build_variables.outputs.VERSION }}-unvalidated-ubuntu" - - name: Create release - if: steps.release_info.outputs.SKIP_RELEASE == 'false' - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ github.ref }} - release_name: ${{ github.event.repository.name }} ${{ github.ref }} - body: | - ${{ steps.release_info.outputs.CHANGELOG }} - draft: false - prerelease: ${{ steps.release_info.outputs.IS_CANDIDATE }} diff --git a/.github/workflows/release_info.sh b/.github/workflows/release_info.sh deleted file mode 100755 index 3c3a158aa59..00000000000 --- a/.github/workflows/release_info.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/bash -x - -NEW_TAG=${GITHUB_REF/refs\/tags\//} -export NEW_TAG -echo "NEW_TAG=$NEW_TAG" -# Glob match previous tags which should be format v1.2.3. Avoids Deck's npm tagging. -PREVIOUS_TAG=$(git describe --abbrev=0 --tags "${NEW_TAG}"^ --match 'v[0-9]*') -export PREVIOUS_TAG -echo "PREVIOUS_TAG=$PREVIOUS_TAG" -CHANGELOG=$(git log "$NEW_TAG"..."$PREVIOUS_TAG" --oneline) -export CHANGELOG -echo "CHANGELOG=$CHANGELOG" - -# Format the changelog so it's markdown compatible -CHANGELOG="${CHANGELOG//$'%'/%25}" -CHANGELOG="${CHANGELOG//$'\n'/%0A}" -CHANGELOG="${CHANGELOG//$'\r'/%0D}" - -# If the previous release tag is the same as this tag the user likely cut a release (and in the process created a tag), which means we can skip the need to create a release -SKIP_RELEASE=$([[ "$PREVIOUS_TAG" = "$NEW_TAG" ]] && echo "true" || echo "false") -export SKIP_RELEASE - -# https://github.com/fsaintjacques/semver-tool/blob/master/src/semver#L5-L14 -NAT='0|[1-9][0-9]*' -ALPHANUM='[0-9]*[A-Za-z-][0-9A-Za-z-]*' -IDENT="$NAT|$ALPHANUM" -FIELD='[0-9A-Za-z-]+' -SEMVER_REGEX="\ -^[vV]?\ -($NAT)\\.($NAT)\\.($NAT)\ -(\\-(${IDENT})(\\.(${IDENT}))*)?\ -(\\+${FIELD}(\\.${FIELD})*)?$" - -# Used in downstream steps to determine if the release should be marked as a "prerelease" and if the build should build candidate release artifacts -IS_CANDIDATE=$([[ $NEW_TAG =~ $SEMVER_REGEX && -n ${BASH_REMATCH[4]} ]] && echo "true" || echo "false") -export IS_CANDIDATE - -# This is the version string we will pass to the build, trim off leading 'v' if present -RELEASE_VERSION=$([[ $NEW_TAG =~ $SEMVER_REGEX ]] && echo "${NEW_TAG:1}" || echo "${NEW_TAG}") -export RELEASE_VERSION -echo "RELEASE_VERSION=$RELEASE_VERSION" diff --git a/packages/amazon/src/serverGroup/details/scalingPolicy/upsert/step/StepPolicyAction.tsx b/packages/amazon/src/serverGroup/details/scalingPolicy/upsert/step/StepPolicyAction.tsx index 0be68fedeaf..3e260e73a12 100644 --- a/packages/amazon/src/serverGroup/details/scalingPolicy/upsert/step/StepPolicyAction.tsx +++ b/packages/amazon/src/serverGroup/details/scalingPolicy/upsert/step/StepPolicyAction.tsx @@ -107,7 +107,7 @@ export const StepPolicyAction = ({ value={step.metricIntervalLowerBound} max={step.metricIntervalUpperBound} onChange={(e) => - updateStep({ ...step, metricIntervalLowerBound: Number.parseInt(e.target.value) }, index) + updateStep({ ...step, metricIntervalLowerBound: Number.parseFloat(e.target.value) }, index) } inputClassName="action-input" /> @@ -122,7 +122,7 @@ export const StepPolicyAction = ({ value={step.metricIntervalUpperBound} min={step.metricIntervalLowerBound} onChange={(e) => - updateStep({ ...step, metricIntervalUpperBound: Number.parseInt(e.target.value) }, index) + updateStep({ ...step, metricIntervalUpperBound: Number.parseFloat(e.target.value) }, index) } inputClassName="action-input" /> diff --git a/packages/core/src/pipeline/config/graph/PipelineGraph.tsx b/packages/core/src/pipeline/config/graph/PipelineGraph.tsx index 407cb31c56c..8fe61e9f6ac 100644 --- a/packages/core/src/pipeline/config/graph/PipelineGraph.tsx +++ b/packages/core/src/pipeline/config/graph/PipelineGraph.tsx @@ -117,15 +117,22 @@ export class PipelineGraph extends React.Component(); const result: number[] = []; - this.collect(node.children, result); + this.collect(node.children, result, checkedNodeIds); return max(result); } - private collect(nodes: IPipelineGraphNode[], result: number[]) { + private collect(nodes: IPipelineGraphNode[], result: number[], checkedNodeIds: Set) { nodes.forEach((node) => { + if (checkedNodeIds.has(node.id)) { + return; + } else { + checkedNodeIds.add(node.id); + } + if (node.children.length) { - this.collect(node.children, result); + this.collect(node.children, result, checkedNodeIds); } else { result.push(node.phase); } diff --git a/packages/core/src/pipeline/details/StageFailureMessage.tsx b/packages/core/src/pipeline/details/StageFailureMessage.tsx index 667378eba1e..ffdf4ac0fbb 100644 --- a/packages/core/src/pipeline/details/StageFailureMessage.tsx +++ b/packages/core/src/pipeline/details/StageFailureMessage.tsx @@ -71,33 +71,19 @@ export class StageFailureMessage extends React.Component 0) { + if (isFailed || failedTask || message || messages.length) { const exceptionTitle = isFailed ? (messages.length ? 'Exceptions' : 'Exception') : 'Warning'; - - // expression evaluation warnings can get really long and hide actual failure messages, source - // filter out expression evaluation failure messages if either: - // - there was a stage failure (and failed expressions don't fail the stage) - // - expression evaluation was explicitly disabled for the stage(as Orca still processes expressions and populates - // warnings when evaluation is disabled disabled) - const shouldFilterExpressionFailures = - (isFailed && !stage.context?.failOnFailedExpressions) || stage.context?.skipExpressionEvaluation; - - if (shouldFilterExpressionFailures) { - stageMessages = stageMessages.filter((m) => !m.startsWith('Failed to evaluate')); - - if (stageMessages.length === 0) { - // no messages to be displayed after filtering - return null; - } - } - - const displayMessages = stageMessages.map((m, i) => ( - - )); + const displayMessages = + message || !messages.length ? ( + + ) : ( + messages.map((m, i) => ( + + )) + ); if (displayMessages) { return ( diff --git a/packages/core/src/securityGroup/SecurityGroups.tsx b/packages/core/src/securityGroup/SecurityGroups.tsx index cbac8d1d889..eb607eac20a 100644 --- a/packages/core/src/securityGroup/SecurityGroups.tsx +++ b/packages/core/src/securityGroup/SecurityGroups.tsx @@ -145,7 +145,7 @@ export const SecurityGroups = ({ app }: ISecurityGroupsProps) => {
-
{buttonDisable ?
: }
+
{buttonDisable ?
: }
diff --git a/packages/ecs/src/serverGroup/serverGroup.transformer.spec.ts b/packages/ecs/src/serverGroup/serverGroup.transformer.spec.ts index 8d7c5ef0512..679d1b05709 100644 --- a/packages/ecs/src/serverGroup/serverGroup.transformer.spec.ts +++ b/packages/ecs/src/serverGroup/serverGroup.transformer.spec.ts @@ -159,7 +159,16 @@ describe('ecsServerGroupTransformer', () => { [-5, 10, 0], ); }); - + it('verify float adjustments work within the range', function () { + this.test( + [ + { id: 1, scalingAdjustment: 10, metricIntervalLowerBound: 3.5, metricIntervalUpperBound: 5.5 }, + { id: 2, scalingAdjustment: 0, metricIntervalLowerBound: 5.5 }, + { id: 3, scalingAdjustment: -5, metricIntervalLowerBound: 1.2, metricIntervalUpperBound: 3.5 }, + ], + [-5, 10, 0], + ); + }); it('reverse sorts step adjustments by upper bound when all have an upper bound defined', function () { this.test( [ diff --git a/test/functional/cypress/integration/google/accelerator_zones.spec.js b/test/functional/cypress/integration/google/accelerator_zones.spec.js deleted file mode 100644 index f98869fed46..00000000000 --- a/test/functional/cypress/integration/google/accelerator_zones.spec.js +++ /dev/null @@ -1,40 +0,0 @@ -import { ReactSelect, registerDefaultFixtures } from '../../support'; - -describe('google: Create Server Group Modal GPU Accelerators', () => { - beforeEach(() => { - registerDefaultFixtures(); - cy.route('/credentials?expand=true', 'fixture:google/accelerator_zones/credentials.json'); - cy.route('/images/find?*', 'fixture:google/shared/images.json'); - }); - - it(`provides different accelerators according to the server group's chosen zone`, () => { - cy.visit('#/applications/compute/clusters'); - cy.get('button:contains("Create Server Group")').click(); - - cy.get('button:contains("Add Accelerator")').click(); - let typeSelect = ReactSelect('v2-wizard-page[key=advanced] gce-accelerator-configurer td:first-of-type'); - typeSelect.toggleDropdown(); - typeSelect.getOptions().then(options => { - const types = Array.from(options).map(o => o.innerHTML); - expect(types).not.to.include('NVIDIA Tesla K80'); - }); - typeSelect.toggleDropdown(); - - cy.get('v2-wizard-page[key=location]').within(() => { - cy.get('div.form-group:contains("Region") select').select('us-east1'); - }); - - cy.get('v2-wizard-page[key=zones]').within(() => { - cy.get('div.form-group:contains("Zone") select').select('us-east1-c'); - }); - - cy.get('button:contains("Add Accelerator")').click(); - typeSelect = ReactSelect('v2-wizard-page[key=advanced] gce-accelerator-configurer td:first-of-type'); - typeSelect.toggleDropdown(); - typeSelect.getOptions().then(options => { - const types = Array.from(options).map(o => o.innerHTML); - expect(types).to.include('NVIDIA Tesla K80'); - }); - typeSelect.toggleDropdown(); - }); -});