From b50f1b82a20bb86a25d5ab0cbd0d2918c5723d9b Mon Sep 17 00:00:00 2001 From: daeyeon ko Date: Mon, 3 Feb 2025 14:25:16 +0900 Subject: [PATCH 1/5] chore: create workflows merge from master to develop and check commits (#5611) * chore: create a workflow from master to develop Signed-off-by: daeyeon ko * chore: dispatch merge workflow Signed-off-by: daeyeon ko * chore: add a workflow to check commits that are targets for revert in pr Signed-off-by: daeyeon ko * chore: workflow name Signed-off-by: daeyeon ko --------- Signed-off-by: daeyeon ko --- .../workflows/dispatch_master_to_develop.yaml | 65 +++++++++++++++++++ .github/workflows/dispatch_release.yaml | 37 ++++++++++- ...equest_check_revert_candidate_commits.yaml | 51 +++++++++++++++ 3 files changed, 152 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/dispatch_master_to_develop.yaml create mode 100644 .github/workflows/pull_request_check_revert_candidate_commits.yaml diff --git a/.github/workflows/dispatch_master_to_develop.yaml b/.github/workflows/dispatch_master_to_develop.yaml new file mode 100644 index 0000000000..b771053c24 --- /dev/null +++ b/.github/workflows/dispatch_master_to_develop.yaml @@ -0,0 +1,65 @@ +name: "[Dispatch] Master to develop" + +on: + workflow_dispatch: + inputs: + version: + description: 'enter version(x.y.z)' + required: true + default: '2.0.0' + +env: + VERSION: ${{ github.event.inputs.version }} + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + REF_BRANCH: "master" + +jobs: + merge_to_develop: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + ref: ${{env.REF_BRANCH}} + fetch-depth: 0 + fetch-tags: false + submodules: true + token: ${{ secrets.PAT_TOKEN }} + + - name: Fetch develop branch + run: | + git checkout -b develop origin/develop + + - name: Configure git + run: | + git log -n 10 --oneline + git branch + git config --global user.email "${{ vars.GIT_EMAIL }}" + git config --global user.name "${{ vars.GIT_USERNAME }}" + + - name: Import GPG key + id: import-gpg + uses: crazy-max/ghaction-import-gpg@v6.2.0 + with: + gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} + passphrase: ${{ secrets.GPG_PASSPHRASE }} + git_user_signingkey: true + git_commit_gpgsign: true + + - name: Merge master into develop + run: | + git merge --no-ff master -m "chore: merge master into develop after ${{ env.VERSION }} version tagging" + + - name: Push changes to develop using GitHub push action + uses: ad-m/github-push-action@v0.6.0 + with: + branch: develop + github_token: ${{ secrets.PAT_TOKEN }} + + - name: Notice when job fails + if: failure() + uses: 8398a7/action-slack@v3.15.0 + with: + status: ${{job.status}} + fields: repo,workflow,job + author_name: Github Action Slack diff --git a/.github/workflows/dispatch_release.yaml b/.github/workflows/dispatch_release.yaml index 4b6c8c52d5..9151af3b1b 100644 --- a/.github/workflows/dispatch_release.yaml +++ b/.github/workflows/dispatch_release.yaml @@ -20,10 +20,29 @@ env: ARCH: ${{ github.event.inputs.container_arch }} VERSION: ${{ github.event.inputs.version }} SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + REF_BRANCH: "master" jobs: + check-branch: + runs-on: ubuntu-latest + steps: + - name: Check branch with regex + run: | + if [[ ! "${{ github.ref }}" =~ ^refs/heads/(${{env.REF_BRANCH}}.*|.*${{env.REF_BRANCH}})$ ]]; then + echo `::error::Branch should always be run from '${{env.REF_BRANCH}}', Running branch: ${github.ref_name}`. + exit 1 + fi + - name: Notice when job fails + if: failure() + uses: 8398a7/action-slack@v3.15.0 + with: + status: ${{job.status}} + fields: repo,workflow,job + author_name: Github Action Slack + mirinae: runs-on: ubuntu-latest + needs: check-branch steps: - name: Invoke mirinae release workflow id: mirinae @@ -63,6 +82,7 @@ jobs: uses: actions/checkout@v3 with: submodules: true + ref: ${{ env.REF_BRANCH }} token: ${{ secrets.PAT_TOKEN }} - name: Setup Node.js @@ -91,7 +111,7 @@ jobs: - name: Import GPG key id: import-gpg - uses: crazy-max/ghaction-import-gpg@v6.2.0 + uses: crazy-max/ghaction-import-gpg@v6.2.0 with: gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} passphrase: ${{ secrets.GPG_PASSPHRASE }} @@ -129,6 +149,21 @@ jobs: github_token: ${{ secrets.PAT_TOKEN }} branch: ${{ github.ref }} + - name: Trigger dispatch_master_to_develop workflow + uses: actions/github-script@v6 + with: + github-token: ${{ secrets.PAT_TOKEN }} + script: | + github.rest.actions.createWorkflowDispatch({ + owner: "${{ github.repository_owner }}", + repo: "${{ github.event.repository.name }}", + workflow_id: "dispatch_master_to_develop.yaml", + inputs: { + version: "${{ github.event.inputs.version }}", + }, + ref: "${{env.REF_BRANCH}}", + }); + - name: Set up QEMU uses: docker/setup-qemu-action@v2 diff --git a/.github/workflows/pull_request_check_revert_candidate_commits.yaml b/.github/workflows/pull_request_check_revert_candidate_commits.yaml new file mode 100644 index 0000000000..a90cf33900 --- /dev/null +++ b/.github/workflows/pull_request_check_revert_candidate_commits.yaml @@ -0,0 +1,51 @@ +name: [Pull Request] Check Revert Candidate Commits + +on: + pull_request: + branches: [master] + +jobs: + check-commits: + runs-on: ubuntu-latest + steps: + - name: Find feat(backend) commits + id: check-commits + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + COMMITS=$(gh api repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/commits \ + --jq '.[] | select(.commit.message | test("^feat\\(backend")) | .sha + " " + .commit.message') + + if [ -z "$COMMITS" ]; then + echo "No matching commits found" + echo "found=false" >> $GITHUB_OUTPUT + else + echo "Found matching commits" + echo "found=true" >> $GITHUB_OUTPUT + COMMITS="${COMMITS//$'\n'/'%0A'}" + echo "commits=$COMMITS" >> $GITHUB_OUTPUT + fi + + - name: Comment feat(backend) commits + if: steps.check-commits.outputs.found == 'true' + uses: actions/github-script@v6 + with: + script: | + const prNumber = context.payload.pull_request.number; + const commits = `${{ steps.check-commits.outputs.commits }}`.replace(/%0A/g, '\n'); + await github.rest.issues.createComment({ + ...context.repo, + issue_number: prNumber, + body: `⚠️ The following commits require review:\n\n${commits}` + }); + + - name: Comment no feat(backend) commits + if: steps.check-commits.outputs.found == 'false' + uses: actions/github-script@v6 + with: + script: | + await github.rest.issues.createComment({ + ...context.repo, + issue_number: context.payload.pull_request.number, + body: `✅ There are no commits in this PR that require review.` + }); From f2c54721dc77f0604eb0624030a88ae35e9ae8e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piggy=20Park=20=28=EB=B0=95=EC=9A=A9=ED=83=9C=29?= Date: Tue, 4 Feb 2025 14:12:47 +0900 Subject: [PATCH 2/5] fix(dockerfile): add missing console log path (#5613) Signed-off-by: samuel.park --- apps/web/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/web/Dockerfile b/apps/web/Dockerfile index 14364e6b64..60b9c3b085 100644 --- a/apps/web/Dockerfile +++ b/apps/web/Dockerfile @@ -36,8 +36,8 @@ RUN rm /etc/nginx/conf.d/default.conf COPY apps/web/pkg/proxy.conf ${NGINX_CONF_PATH}/proxy.conf # forward request and error logs to docker log collector -RUN ln -sf /dev/stdout /var/log/nginx/spaceone-access.log \ - && ln -sf /dev/stderr /var/log/nginx/spaceone-error.log +RUN ln -sf /dev/stdout /var/log/cloudforet/nginx/spaceone-access.log \ + && ln -sf /dev/stderr /var/log/cloudforet/nginx/spaceone-error.log COPY --from=installer /app/apps/web/dist/. ${ROOT_PATH}/ From f9fe3451bd6c3167c5c4081d7cee74b75518696a Mon Sep 17 00:00:00 2001 From: admin-cloudforet Date: Tue, 4 Feb 2025 05:26:22 +0000 Subject: [PATCH 3/5] chore: version 2.0.dev307 Signed-off-by: admin-cloudforet --- apps/web/package.json | 2 +- package-lock.json | 6 +++--- package.json | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/web/package.json b/apps/web/package.json index 407ff526b2..4fd2b5cb9d 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -1,6 +1,6 @@ { "name": "web", - "version": "2.0.0-dev306", + "version": "2.0.0-dev307", "private": true, "description": "Cloudforet Console Web Application", "author": "Cloudforet", diff --git a/package-lock.json b/package-lock.json index 5260fcf35c..bd31f80bad 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "cloudforet-console", - "version": "2.0.0-dev306", + "version": "2.0.0-dev307", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "cloudforet-console", - "version": "2.0.0-dev306", + "version": "2.0.0-dev307", "workspaces": [ "apps/*", "packages/*" @@ -166,7 +166,7 @@ } }, "apps/web": { - "version": "2.0.0-dev306", + "version": "2.0.0-dev307", "license": "Apache-2.0", "dependencies": { "@amcharts/amcharts5": "^5.4.7", diff --git a/package.json b/package.json index 0746b96460..0192b7b369 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cloudforet-console", - "version": "2.0.0-dev306", + "version": "2.0.0-dev307", "private": true, "workspaces": [ "apps/*", From b57d020c54f82831ce6e1f6496b52484c571b152 Mon Sep 17 00:00:00 2001 From: daeyeon ko Date: Tue, 4 Feb 2025 16:00:55 +0900 Subject: [PATCH 4/5] chore: fix syntex error Signed-off-by: daeyeon ko --- .../workflows/pull_request_check_revert_candidate_commits.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull_request_check_revert_candidate_commits.yaml b/.github/workflows/pull_request_check_revert_candidate_commits.yaml index a90cf33900..fa3d3b921c 100644 --- a/.github/workflows/pull_request_check_revert_candidate_commits.yaml +++ b/.github/workflows/pull_request_check_revert_candidate_commits.yaml @@ -1,4 +1,4 @@ -name: [Pull Request] Check Revert Candidate Commits +name: "[Pull Request] Check Revert Candidate Commits" on: pull_request: From b876ebb1f716b26d6e098ec2e77312658a6795bb Mon Sep 17 00:00:00 2001 From: sulmo Date: Tue, 4 Feb 2025 16:16:08 +0900 Subject: [PATCH 5/5] Revert "chore: create workflows merge from master to develop and check commits (#5611)" (#5615) * Revert "chore: fix syntex error" This reverts commit b57d020c54f82831ce6e1f6496b52484c571b152. * Revert "chore: create workflows merge from master to develop and check commits (#5611)" This reverts commit b50f1b82a20bb86a25d5ab0cbd0d2918c5723d9b. Signed-off-by: sulmo --- .../workflows/dispatch_master_to_develop.yaml | 65 ------------------- .github/workflows/dispatch_release.yaml | 37 +---------- ...equest_check_revert_candidate_commits.yaml | 51 --------------- 3 files changed, 1 insertion(+), 152 deletions(-) delete mode 100644 .github/workflows/dispatch_master_to_develop.yaml delete mode 100644 .github/workflows/pull_request_check_revert_candidate_commits.yaml diff --git a/.github/workflows/dispatch_master_to_develop.yaml b/.github/workflows/dispatch_master_to_develop.yaml deleted file mode 100644 index b771053c24..0000000000 --- a/.github/workflows/dispatch_master_to_develop.yaml +++ /dev/null @@ -1,65 +0,0 @@ -name: "[Dispatch] Master to develop" - -on: - workflow_dispatch: - inputs: - version: - description: 'enter version(x.y.z)' - required: true - default: '2.0.0' - -env: - VERSION: ${{ github.event.inputs.version }} - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - REF_BRANCH: "master" - -jobs: - merge_to_develop: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - ref: ${{env.REF_BRANCH}} - fetch-depth: 0 - fetch-tags: false - submodules: true - token: ${{ secrets.PAT_TOKEN }} - - - name: Fetch develop branch - run: | - git checkout -b develop origin/develop - - - name: Configure git - run: | - git log -n 10 --oneline - git branch - git config --global user.email "${{ vars.GIT_EMAIL }}" - git config --global user.name "${{ vars.GIT_USERNAME }}" - - - name: Import GPG key - id: import-gpg - uses: crazy-max/ghaction-import-gpg@v6.2.0 - with: - gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} - passphrase: ${{ secrets.GPG_PASSPHRASE }} - git_user_signingkey: true - git_commit_gpgsign: true - - - name: Merge master into develop - run: | - git merge --no-ff master -m "chore: merge master into develop after ${{ env.VERSION }} version tagging" - - - name: Push changes to develop using GitHub push action - uses: ad-m/github-push-action@v0.6.0 - with: - branch: develop - github_token: ${{ secrets.PAT_TOKEN }} - - - name: Notice when job fails - if: failure() - uses: 8398a7/action-slack@v3.15.0 - with: - status: ${{job.status}} - fields: repo,workflow,job - author_name: Github Action Slack diff --git a/.github/workflows/dispatch_release.yaml b/.github/workflows/dispatch_release.yaml index 9151af3b1b..4b6c8c52d5 100644 --- a/.github/workflows/dispatch_release.yaml +++ b/.github/workflows/dispatch_release.yaml @@ -20,29 +20,10 @@ env: ARCH: ${{ github.event.inputs.container_arch }} VERSION: ${{ github.event.inputs.version }} SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - REF_BRANCH: "master" jobs: - check-branch: - runs-on: ubuntu-latest - steps: - - name: Check branch with regex - run: | - if [[ ! "${{ github.ref }}" =~ ^refs/heads/(${{env.REF_BRANCH}}.*|.*${{env.REF_BRANCH}})$ ]]; then - echo `::error::Branch should always be run from '${{env.REF_BRANCH}}', Running branch: ${github.ref_name}`. - exit 1 - fi - - name: Notice when job fails - if: failure() - uses: 8398a7/action-slack@v3.15.0 - with: - status: ${{job.status}} - fields: repo,workflow,job - author_name: Github Action Slack - mirinae: runs-on: ubuntu-latest - needs: check-branch steps: - name: Invoke mirinae release workflow id: mirinae @@ -82,7 +63,6 @@ jobs: uses: actions/checkout@v3 with: submodules: true - ref: ${{ env.REF_BRANCH }} token: ${{ secrets.PAT_TOKEN }} - name: Setup Node.js @@ -111,7 +91,7 @@ jobs: - name: Import GPG key id: import-gpg - uses: crazy-max/ghaction-import-gpg@v6.2.0 + uses: crazy-max/ghaction-import-gpg@v6.2.0 with: gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} passphrase: ${{ secrets.GPG_PASSPHRASE }} @@ -149,21 +129,6 @@ jobs: github_token: ${{ secrets.PAT_TOKEN }} branch: ${{ github.ref }} - - name: Trigger dispatch_master_to_develop workflow - uses: actions/github-script@v6 - with: - github-token: ${{ secrets.PAT_TOKEN }} - script: | - github.rest.actions.createWorkflowDispatch({ - owner: "${{ github.repository_owner }}", - repo: "${{ github.event.repository.name }}", - workflow_id: "dispatch_master_to_develop.yaml", - inputs: { - version: "${{ github.event.inputs.version }}", - }, - ref: "${{env.REF_BRANCH}}", - }); - - name: Set up QEMU uses: docker/setup-qemu-action@v2 diff --git a/.github/workflows/pull_request_check_revert_candidate_commits.yaml b/.github/workflows/pull_request_check_revert_candidate_commits.yaml deleted file mode 100644 index fa3d3b921c..0000000000 --- a/.github/workflows/pull_request_check_revert_candidate_commits.yaml +++ /dev/null @@ -1,51 +0,0 @@ -name: "[Pull Request] Check Revert Candidate Commits" - -on: - pull_request: - branches: [master] - -jobs: - check-commits: - runs-on: ubuntu-latest - steps: - - name: Find feat(backend) commits - id: check-commits - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - COMMITS=$(gh api repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/commits \ - --jq '.[] | select(.commit.message | test("^feat\\(backend")) | .sha + " " + .commit.message') - - if [ -z "$COMMITS" ]; then - echo "No matching commits found" - echo "found=false" >> $GITHUB_OUTPUT - else - echo "Found matching commits" - echo "found=true" >> $GITHUB_OUTPUT - COMMITS="${COMMITS//$'\n'/'%0A'}" - echo "commits=$COMMITS" >> $GITHUB_OUTPUT - fi - - - name: Comment feat(backend) commits - if: steps.check-commits.outputs.found == 'true' - uses: actions/github-script@v6 - with: - script: | - const prNumber = context.payload.pull_request.number; - const commits = `${{ steps.check-commits.outputs.commits }}`.replace(/%0A/g, '\n'); - await github.rest.issues.createComment({ - ...context.repo, - issue_number: prNumber, - body: `⚠️ The following commits require review:\n\n${commits}` - }); - - - name: Comment no feat(backend) commits - if: steps.check-commits.outputs.found == 'false' - uses: actions/github-script@v6 - with: - script: | - await github.rest.issues.createComment({ - ...context.repo, - issue_number: context.payload.pull_request.number, - body: `✅ There are no commits in this PR that require review.` - });