From 6eb1c2b5b7c0db989a94c48b02f2c621e39dc6f3 Mon Sep 17 00:00:00 2001 From: Dalibor Kezele Date: Mon, 20 Nov 2023 13:08:24 +0100 Subject: [PATCH 1/2] Test proxy --- .github/workflows/release.yml | 135 +--------------------------------- 1 file changed, 1 insertion(+), 134 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 01d364e401..7ed942bb7a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -55,7 +55,7 @@ jobs: echo "TOPTAL_BOT_USERNAME=${{ steps.parse_secrets.outputs.TOPTAL_TRIGGERBOT_USERNAME }}" >> $GITHUB_ENV echo "TOPTAL_BOT_JENKINS_DEPLOYMENT_TOKEN=${{ steps.parse_secrets.outputs.TOPTAL_TRIGGERBOT_DEPLOYMENT_TOKEN }}" >> $GITHUB_ENV echo "TOPTAL_JENKINS_BUILD_TOKEN=${{ steps.parse_secrets.outputs.TOPTAL_TRIGGERBOT_BUILD_TOKEN }}" >> $GITHUB_ENV - echo "HTTP_PROXY=${{ steps.parse_secrets.outputs.HTTP_PROXY }}" >> $GITHUB_ENV + echo "HTTP_PROXY=http://${{ steps.parse_secrets.outputs.HTTP_PROXY }}" >> $GITHUB_ENV echo "DEVBOT_TOKEN=${{ steps.parse_secrets.outputs.TOPTAL_DEVBOT_TOKEN }}" >> $GITHUB_ENV - name: Set up Node.js @@ -86,136 +86,3 @@ jobs: yarn policies set-version yarn install --frozen-lockfile --offline - - name: Create Release Pull Request or Publish to npm - id: changesets - uses: changesets/action@e9cc34b540dd3ad1b030c57fd97269e8f6ad905a - with: - publish: yarn release - env: - GITHUB_TOKEN: ${{ steps.parse_secrets.outputs.TOPTAL_BUILD_BOT_TOKEN }} - NPM_TOKEN: ${{ steps.parse_secrets.outputs.NPM_TOKEN_PUBLISH }} - - - name: Edit "Version Package" PR - if: ${{ steps.changesets.outputs.published != 'true' }} - uses: actions/github-script@v6 - with: - github-token: ${{secrets.GITHUB_TOKEN}} - script: | - // Get list of all open PRs with - // head branch "changeset-release/master" - // (there should be max 1 PR with such condition) - const { data } = await github.rest.pulls.list({ - owner: 'toptal', - repo: 'picasso', - state: 'open', - head: 'toptal:changeset-release/master' - }) - for await (let pr of data) { - // add to all of them label "no-jira" - github.rest.issues.addLabels({ - owner: 'toptal', - repo: 'picasso', - issue_number: pr.number, - labels: [ - 'no-jira' - ] - }) - - // append PR body with peerDependencies warning - const hr = "\n_____" - const warningTodo = "\n- [ ] ⚠️ " - const message = "If major release, don't forget to check if peerDependencies needs to be also updated" - const appendedMessage = hr + warningTodo + message - const body = pr.body.includes(message) ? pr.body : pr.body + appendedMessage - - github.rest.pulls.update({ - owner: 'toptal', - repo: 'picasso', - pull_number: pr.number, - body: body, - }) - } - - - name: Trigger build image job - uses: toptal/jenkins-job-trigger-action@1.0.1 - id: trigger-build - env: - JENKINS_JOB_NAME: ${{ env.REPOSITORY_NAME }}-build-image - JENKINS_USER: ${{ steps.parse_secrets.outputs.TOPTAL_TRIGGERBOT_USERNAME }} - with: - jenkins_url: https://jenkins-build.toptal.net/ - jenkins_user: ${{ env.JENKINS_USER }} - jenkins_token: ${{ env.TOPTAL_JENKINS_BUILD_TOKEN }} - proxy: ${{ env.HTTP_PROXY }} - job_name: ${{ env.JENKINS_JOB_NAME }} - job_params: | - { - "BRANCH": "master", - "VERSION": "${{ github.sha }}", - "IMAGE_NAME": "${{ env.REPOSITORY_NAME }}" - } - job_timeout: "3600" - - - name: Trigger deployment job - id: trigger-deploy - uses: toptal/jenkins-job-trigger-action@1.0.1 - env: - JENKINS_JOB_NAME: ${{ env.REPOSITORY_NAME }}-docs - with: - jenkins_url: https://jenkins-deployment.toptal.net/ - jenkins_user: ${{ env.TOPTAL_BOT_USERNAME }} - jenkins_token: ${{ env.TOPTAL_BOT_JENKINS_DEPLOYMENT_TOKEN }} - proxy: ${{ env.HTTP_PROXY }} - job_name: ${{ env.JENKINS_JOB_NAME }} - job_params: | - { - "COMMIT_ID": "${{ github.sha }}" - } - job_timeout: "3600" - - - name: Send a Slack notification on failure - if: ${{ failure() }} - uses: slackapi/slack-github-action@v1.24.0 - env: - SLACK_BOT_TOKEN: ${{ env.SLACK_BOT_TOKEN }} - FAILURE_URL: ${{ steps.trigger-deploy.outputs.jenkins_job_url || steps.trigger-build.outputs.jenkins_job_url }} - FALLBACK_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}?check_suite_focus=true - with: - channel-id: "-frontend-exp-team-notifications" - slack-message: ":x: Current master version of Picasso is <${{ env.FAILURE_URL || env.FALLBACK_URL }}|broken>." - - - name: Send a Slack notification on success release - if: ${{ success() && steps.changesets.outputs.published == 'true' }} - uses: slackapi/slack-github-action@v1.24.0 - with: - channel-id: "-frontend-exp-team-notifications" - slack-message: "Current master version of Picasso successfully released :green_heart:" - env: - SLACK_BOT_TOKEN: ${{ env.SLACK_BOT_TOKEN }} - - name: Send a Slack notification on success PR merge - if: ${{ success() && steps.changesets.outputs.published != 'true'}} - uses: slackapi/slack-github-action@v1.24.0 - with: - channel-id: "-frontend-exp-team-notifications" - slack-message: "A new PR was merged to Picasso :parrotspin:" - env: - SLACK_BOT_TOKEN: ${{ env.SLACK_BOT_TOKEN }} - - - uses: toptal/davinci-github-actions/create-jira-deployment@v12.2.0 - name: Create Jira deployment - if: ${{ steps.changesets.outputs.published == 'true' }} - env: - JENKINS_USER: ${{ steps.parse_secrets.outputs.TOPTAL_TRIGGERBOT_USERNAME }} - JENKINS_BUILD_TOKEN: ${{ steps.parse_secrets.outputs.TOPTAL_TRIGGERBOT_BUILD_TOKEN }} - PROXY: http://${{ steps.parse_secrets.outputs.HTTP_PROXY }} - with: - token: ${{ env.DEVBOT_TOKEN }} - environment: production - environment-url: https://www.npmjs.com/package/@toptal/picasso?activeTab=versions - - integration-tests: - name: Integration Tests - uses: ./.github/workflows/davinci-integration-tests.yml - secrets: - IDENTITY_POOL: ${{ secrets.IDENTITY_POOL }} - SA_IDENTITY_POOL: ${{ secrets.SA_IDENTITY_POOL }} From 1a523ee30206e7b9ad7b424f3e4ff44053e45f35 Mon Sep 17 00:00:00 2001 From: Dalibor Kezele Date: Mon, 20 Nov 2023 13:13:27 +0100 Subject: [PATCH 2/2] Remove proxy --- .github/workflows/release.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7ed942bb7a..97a11b2393 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -55,7 +55,6 @@ jobs: echo "TOPTAL_BOT_USERNAME=${{ steps.parse_secrets.outputs.TOPTAL_TRIGGERBOT_USERNAME }}" >> $GITHUB_ENV echo "TOPTAL_BOT_JENKINS_DEPLOYMENT_TOKEN=${{ steps.parse_secrets.outputs.TOPTAL_TRIGGERBOT_DEPLOYMENT_TOKEN }}" >> $GITHUB_ENV echo "TOPTAL_JENKINS_BUILD_TOKEN=${{ steps.parse_secrets.outputs.TOPTAL_TRIGGERBOT_BUILD_TOKEN }}" >> $GITHUB_ENV - echo "HTTP_PROXY=http://${{ steps.parse_secrets.outputs.HTTP_PROXY }}" >> $GITHUB_ENV echo "DEVBOT_TOKEN=${{ steps.parse_secrets.outputs.TOPTAL_DEVBOT_TOKEN }}" >> $GITHUB_ENV - name: Set up Node.js