From 53faa1ea8183b7be129c86f07a69ec5413386237 Mon Sep 17 00:00:00 2001 From: sairaj18 Date: Thu, 21 Nov 2024 18:11:11 +0530 Subject: [PATCH 01/11] updated workflows to use coreint-automation reusable workflows --- .github/workflows/automated_release.yaml | 11 ++ .github/workflows/prerelease.yml | 213 +---------------------- .github/workflows/push_pr.yml | 107 +----------- .github/workflows/release.yml | 57 +----- .github/workflows/repolinter.yml | 28 +-- .github/workflows/security.yaml | 17 ++ 6 files changed, 52 insertions(+), 381 deletions(-) create mode 100644 .github/workflows/automated_release.yaml create mode 100644 .github/workflows/security.yaml diff --git a/.github/workflows/automated_release.yaml b/.github/workflows/automated_release.yaml new file mode 100644 index 0000000..21b3e17 --- /dev/null +++ b/.github/workflows/automated_release.yaml @@ -0,0 +1,11 @@ +name: Automated release creation + +on: + workflow_dispatch: + schedule: + - cron: "0 19 * * 4" + +jobs: + release_management: + uses: newrelic/coreint-automation/.github/workflows/reusable_release_automation.yaml@v3 + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml index 67ef8f1..055cc59 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -7,208 +7,13 @@ on: tags: - 'v*' -env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - NRJMX_VERSION: '2.6.0' - INTEGRATION: "jmx" - ORIGINAL_REPO_NAME: 'newrelic/nri-jmx' - REPO_FULL_NAME: ${{ github.event.repository.full_name }} - TAG: ${{ github.event.release.tag_name }} - jobs: - snyk: - name: Run security checks via snyk - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v2 - - name: Login to DockerHub - uses: docker/login-action@v3 - with: - username: ${{ secrets.OHAI_DOCKER_HUB_ID }} - password: ${{ secrets.OHAI_DOCKER_HUB_PASSWORD }} - - name: Run Snyk to check for vulnerabilities - env: - SNYK_TOKEN: ${{ secrets.CAOS_SNYK_TOKEN }} - run: make ci/snyk-test - - test-nix: - name: Run unit tests on *Nix - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v2 - - name: Login to DockerHub - uses: docker/login-action@v3 - with: - username: ${{ secrets.OHAI_DOCKER_HUB_ID }} - password: ${{ secrets.OHAI_DOCKER_HUB_PASSWORD }} - - name: Unit tests - run: make ci/test - - test-windows: - name: Run unit tests on Windows - runs-on: windows-2019 - env: - GOPATH: ${{ github.workspace }} - defaults: - run: - working-directory: src/github.com/${{env.ORIGINAL_REPO_NAME}} - steps: - - name: Checkout - uses: actions/checkout@v2 - with: - path: src/github.com/${{env.ORIGINAL_REPO_NAME}} - - name: Install Go - uses: actions/setup-go@v5 - with: - go-version-file: 'src/github.com/${{env.ORIGINAL_REPO_NAME}}/go.mod' - - name: Running unit tests - shell: pwsh - run: | - .\build\windows\unit_tests.ps1 - - # can't run this step inside of container because of tests specific - test-integration-nix: - name: Run integration tests on *Nix - runs-on: ubuntu-20.04 - defaults: - run: - working-directory: src/github.com/${{env.ORIGINAL_REPO_NAME}} - steps: - - name: Check out code - uses: actions/checkout@v2 - with: - fetch-depth: 1 - path: src/github.com/${{env.ORIGINAL_REPO_NAME}} - - name: Install Go - uses: actions/setup-go@v5 - with: - go-version-file: 'src/github.com/${{env.ORIGINAL_REPO_NAME}}/go.mod' - - name: Integration test - env: - GOPATH: ${{ github.workspace }} - run: make integration-test - - prerelease: - name: Build binary for *Nix/Win, create archives for *Nix/Win, create packages for *Nix, upload all artifacts into GH Release assets - runs-on: ubuntu-20.04 - needs: [test-nix, test-windows, snyk, test-integration-nix] - env: - GPG_MAIL: 'infrastructure-eng@newrelic.com' - GPG_PASSPHRASE: ${{ secrets.OHAI_GPG_PASSPHRASE }} - GPG_PRIVATE_KEY_BASE64: ${{ secrets.OHAI_GPG_PRIVATE_KEY_BASE64 }} # base64 encoded - steps: - - uses: actions/checkout@v2 - - name: Login to DockerHub - uses: docker/login-action@v3 - with: - username: ${{ secrets.OHAI_DOCKER_HUB_ID }} - password: ${{ secrets.OHAI_DOCKER_HUB_PASSWORD }} - - name: Pre release - run: make ci/prerelease - - name: Notify failure via Slack - if: ${{ failure() }} - uses: archive/github-actions-slack@master - with: - slack-bot-user-oauth-access-token: ${{ secrets.COREINT_SLACK_TOKEN }} - slack-channel: ${{ secrets.COREINT_SLACK_CHANNEL }} - slack-text: "❌ `${{ env.REPO_FULL_NAME }}`: prerelease pipeline failed." - - package-win: - name: Create MSI & Upload into GH Release assets - runs-on: windows-2019 - needs: [prerelease] - env: - GOPATH: ${{ github.workspace }} - PFX_CERTIFICATE_BASE64: ${{ secrets.OHAI_PFX_CERTIFICATE_BASE64 }} # base64 encoded - PFX_CERTIFICATE_DESCRIPTION: 'New Relic' - PFX_PASSPHRASE: ${{ secrets.OHAI_PFX_PASSPHRASE }} - defaults: - run: - working-directory: src/github.com/${{env.ORIGINAL_REPO_NAME}} - strategy: - matrix: - goarch: [ amd64 ] # 386 not supported in jmx integrations - test-upgrade: [true,false] - steps: - - name: Checkout - uses: actions/checkout@v2 - with: - path: src/github.com/${{env.ORIGINAL_REPO_NAME}} - - name: Get PFX certificate from GH secrets - shell: bash - run: printf "%s" "$PFX_CERTIFICATE_BASE64" | base64 -d - > wincert.pfx - - name: Download zip from GH Release assets and extract .exe - shell: pwsh - run: | - build\windows\download_zip_extract_exe.ps1 "$env:INTEGRATION" ${{ matrix.goarch }} "$env:TAG" "$env:REPO_FULL_NAME" - - name: Download nrjmx - shell: bash - run: | - build/windows/download_nrjmx.sh - - name: Create MSI - shell: pwsh - run: | - build\windows\package_msi.ps1 -integration "$env:INTEGRATION" -arch ${{ matrix.goarch }} -tag "$env:TAG" -pfx_passphrase "$env:PFX_PASSPHRASE" -pfx_certificate_description "$env:PFX_CERTIFICATE_DESCRIPTION" - - name: Test win packages installation - uses: newrelic/integrations-pkg-test-action/windows@v1 - with: - tag: ${{ env.TAG }} - integration: nri-${{ env.INTEGRATION }} - arch: ${{ matrix.goarch }} - upgrade: ${{ matrix.test-upgrade }} - pkgType: "exe" # JMX integrations are shipped in .exe format - - name: Upload MSI to GH - if: startsWith(matrix.test-upgrade, 'false') - shell: bash - run: | - build/windows/upload_msi.sh ${INTEGRATION} ${{ matrix.goarch }} ${TAG} - - name: Notify failure via Slack - if: ${{ failure() }} - uses: archive/github-actions-slack@master - with: - slack-bot-user-oauth-access-token: ${{ secrets.COREINT_SLACK_TOKEN }} - slack-channel: ${{ secrets.COREINT_SLACK_CHANNEL }} - slack-text: "❌ `${{ env.REPO_FULL_NAME }}`: prerelease pipeline failed." - - publish-to-s3: - name: Send release assets to S3 - runs-on: ubuntu-20.04 - needs: [package-win] - steps: - - name: Login to DockerHub - uses: docker/login-action@v3 - with: - username: ${{ secrets.OHAI_DOCKER_HUB_ID }} - password: ${{ secrets.OHAI_DOCKER_HUB_PASSWORD }} - - name: Publish to S3 action - uses: newrelic/infrastructure-publish-action@v1 - env: - AWS_S3_BUCKET_NAME: "nr-downloads-ohai-staging" - AWS_S3_LOCK_BUCKET_NAME: "onhost-ci-lock-staging" - with: - disable_lock: false - run_id: ${{ github.run_id }} - tag: ${{env.TAG}} - app_name: "nri-${{env.INTEGRATION}}" - repo_name: ${{ env.ORIGINAL_REPO_NAME }} - access_point_host: "staging" - schema: "ohi-jmx" # ohi-jmx for integrations that bundle JMX on windows installers - aws_region: "us-east-1" - aws_role_arn: ${{ secrets.OHAI_AWS_ROLE_ARN_STAGING }} - aws_role_session_name: ${{ secrets.OHAI_AWS_ROLE_SESSION_NAME_STAGING }} - aws_access_key_id: ${{ secrets.OHAI_AWS_ACCESS_KEY_ID_STAGING }} - aws_secret_access_key: ${{ secrets.OHAI_AWS_SECRET_ACCESS_KEY_STAGING }} - aws_s3_bucket_name: ${{ env.AWS_S3_BUCKET_NAME }} - # used for locking in case of concurrent releases - aws_s3_lock_bucket_name: ${{ env.AWS_S3_LOCK_BUCKET_NAME }} - # used for signing package stuff - gpg_passphrase: ${{ secrets.OHAI_GPG_PASSPHRASE }} - gpg_private_key_base64: ${{ secrets.OHAI_GPG_PRIVATE_KEY_BASE64 }} - - name: Test uploaded package installability - uses: newrelic/integrations-pkg-test-action/linux@v1 - with: - tag: ${{ env.TAG }} - integration: nri-${{ env.INTEGRATION }} - packageLocation: repo - stagingRepo: true - upgrade: false + pre-release: + uses: newrelic/coreint-automation/.github/workflows/reusable_pre_release.yaml@v3 + with: + tag: ${{ github.event.release.tag_name }} + integration: "jmx" + windows_goarch_matrix: ["amd64"] # 386 not supported in jmx integrations + win_package_type: exe # JMX integrations are shipped in .exe format + publish_schema: "ohi-jmx" # ohi-jmx for integrations that bundle JMX on windows installers + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/push_pr.yml b/.github/workflows/push_pr.yml index f7a57ce..b27ce94 100644 --- a/.github/workflows/push_pr.yml +++ b/.github/workflows/push_pr.yml @@ -7,13 +7,6 @@ on: - master pull_request: -env: - TAG: "v0.0.0" # needed for goreleaser windows builds - REPO_FULL_NAME: ${{ github.event.repository.full_name }} - ORIGINAL_REPO_NAME: "newrelic/nri-jmx" - NRJMX_VERSION: '2.6.0' - DOCKER_LOGIN_AVAILABLE: ${{ secrets.OHAI_DOCKER_HUB_ID }} - jobs: static-analysis: name: Run all static analysis checks @@ -37,97 +30,9 @@ jobs: with: only-new-issues: true - snyk: - name: Run security checks via snyk - runs-on: ubuntu-20.04 - env: - SNYK_TOKEN: ${{ secrets.CAOS_SNYK_TOKEN }} - steps: - - uses: actions/checkout@v2 - - name: Login to DockerHub - if: ${{env.DOCKER_LOGIN_AVAILABLE}} - uses: docker/login-action@v3 - with: - username: ${{ secrets.OHAI_DOCKER_HUB_ID }} - password: ${{ secrets.OHAI_DOCKER_HUB_PASSWORD }} - - name: Scan code for vulnerabilities - if: ${{env.SNYK_TOKEN}} - run: make ci/snyk-test - - test-nix: - name: Run unit tests on *Nix - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v2 - - name: Login to DockerHub - if: ${{env.DOCKER_LOGIN_AVAILABLE}} - uses: docker/login-action@v3 - with: - username: ${{ secrets.OHAI_DOCKER_HUB_ID }} - password: ${{ secrets.OHAI_DOCKER_HUB_PASSWORD }} - - name: Unit tests - run: make ci/test - - test-windows: - name: Run unit tests on Windows - runs-on: windows-2019 - env: - GOPATH: ${{ github.workspace }} - defaults: - run: - working-directory: src/github.com/${{ env.ORIGINAL_REPO_NAME }} - steps: - - name: Checkout - uses: actions/checkout@v2 - with: - path: src/github.com/${{env.ORIGINAL_REPO_NAME}} - - name: Install Go - uses: actions/setup-go@v5 - with: - go-version-file: 'src/github.com/${{env.ORIGINAL_REPO_NAME}}/go.mod' - - name: Running unit tests - shell: pwsh - run: | - .\build\windows\unit_tests.ps1 - - # can't run this step inside of container because of tests specific - test-integration-nix: - name: Run integration tests on *Nix - runs-on: ubuntu-20.04 - defaults: - run: - working-directory: src/github.com/${{env.ORIGINAL_REPO_NAME}} - steps: - - name: Check out code - uses: actions/checkout@v2 - with: - fetch-depth: 1 - path: src/github.com/${{env.ORIGINAL_REPO_NAME}} - - name: Install Go - uses: actions/setup-go@v5 - with: - go-version-file: 'src/github.com/${{env.ORIGINAL_REPO_NAME}}/go.mod' - - name: Login to DockerHub - if: ${{env.DOCKER_LOGIN_AVAILABLE}} - uses: docker/login-action@v3 - with: - username: ${{ secrets.OHAI_DOCKER_HUB_ID }} - password: ${{ secrets.OHAI_DOCKER_HUB_PASSWORD }} - - name: Integration test - env: - GOPATH: ${{ github.workspace }} - run: make integration-test - - test-build: - name: Test binary compilation for all platforms:arch - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v2 - - name: Login to DockerHub - if: ${{env.DOCKER_LOGIN_AVAILABLE}} - uses: docker/login-action@v3 - with: - username: ${{ secrets.OHAI_DOCKER_HUB_ID }} - password: ${{ secrets.OHAI_DOCKER_HUB_PASSWORD }} - - name: Build all platforms:arch - run: make ci/build + push-pr: + uses: newrelic/coreint-automation/.github/workflows/reusable_push_pr.yaml@v3 + with: + integration: jmx + run_test_build_fake_prerelease: true + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b4e5788..5f9110e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,54 +7,11 @@ on: tags: - 'v*' -env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - INTEGRATION: "jmx" - ORIGINAL_REPO_NAME: ${{ github.event.repository.full_name }} - TAG: ${{ github.event.release.tag_name }} - jobs: - - publish-to-s3: - name: Send release assets to S3 - runs-on: ubuntu-20.04 - steps: - - name: Login to DockerHub - uses: docker/login-action@v3 - with: - username: ${{ secrets.OHAI_DOCKER_HUB_ID }} - password: ${{ secrets.OHAI_DOCKER_HUB_PASSWORD }} - - name: Publish to S3 action - uses: newrelic/infrastructure-publish-action@v1 - env: - AWS_S3_BUCKET_NAME: "nr-downloads-main" - AWS_S3_LOCK_BUCKET_NAME: "onhost-ci-lock" - AWS_REGION: "us-east-1" - with: - # lock enabled - disable_lock: false - run_id: ${{ github.run_id }} - tag: ${{env.TAG}} - app_name: "nri-${{env.INTEGRATION}}" - repo_name: ${{ env.ORIGINAL_REPO_NAME }} - access_point_host: "production" - # 'ohi' is for integrations - schema: "ohi-jmx" # ohi-jmx for integrations that bundle JMX on windows installers - aws_region: ${{ env.AWS_REGION }} - aws_role_arn: ${{ secrets.OHAI_AWS_ROLE_ARN_PRODUCTION }} - aws_role_session_name: ${{ secrets.OHAI_AWS_ROLE_SESSION_NAME_PRODUCTION }} - aws_access_key_id: ${{ secrets.OHAI_AWS_ACCESS_KEY_ID_PRODUCTION }} - aws_secret_access_key: ${{ secrets.OHAI_AWS_SECRET_ACCESS_KEY_PRODUCTION }} - aws_s3_bucket_name: ${{ env.AWS_S3_BUCKET_NAME }} - # used for locking in case of concurrent releases - aws_s3_lock_bucket_name: ${{ env.AWS_S3_LOCK_BUCKET_NAME }} - # used for signing package stuff - gpg_passphrase: ${{ secrets.OHAI_GPG_PASSPHRASE }} - gpg_private_key_base64: ${{ secrets.OHAI_GPG_PRIVATE_KEY_BASE64 }} - - name: Test package from prod repo - uses: newrelic/integrations-pkg-test-action/linux@v1 - with: - tag: ${{ env.TAG }} - integration: 'nri-${{ env.INTEGRATION }}' # Required, with nri- prefix - packageLocation: repo - upgrade: false + release: + uses: newrelic/coreint-automation/.github/workflows/reusable_on_release.yaml@v3 + with: + integration: jmx + tag: ${{ github.event.release.tag_name }} + publish_schema: "ohi-jmx" # ohi-jmx for integrations that bundle JMX on windows installers + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/repolinter.yml b/.github/workflows/repolinter.yml index acb921f..6c4cb6b 100644 --- a/.github/workflows/repolinter.yml +++ b/.github/workflows/repolinter.yml @@ -2,30 +2,6 @@ # workflow_dispatch to work properly name: Repolinter Action -# NOTE: This workflow will ONLY check the default branch! -# Currently there is no elegant way to specify the default -# branch in the event filtering, so branches are instead -# filtered in the "Test Default Branch" step. -on: [push, workflow_dispatch] - jobs: - repolint: - name: Run Repolinter - runs-on: ubuntu-latest - steps: - - name: Test Default Branch - id: default-branch - uses: actions/github-script@v2 - with: - script: | - const data = await github.repos.get(context.repo) - return data.data && data.data.default_branch === context.ref.split('/').slice(-1)[0] - - name: Checkout Self - if: ${{ steps.default-branch.outputs.result == 'true' }} - uses: actions/checkout@v2 - - name: Run Repolinter - if: ${{ steps.default-branch.outputs.result == 'true' }} - uses: newrelic/repolinter-action@v1 - with: - config_url: https://raw.githubusercontent.com/newrelic/.github/main/repolinter-rulesets/community-plus.yml - output_type: issue + repolinter: + uses: newrelic/coreint-automation/.github/workflows/reusable_repolinter.yaml@v3 diff --git a/.github/workflows/security.yaml b/.github/workflows/security.yaml new file mode 100644 index 0000000..c24a584 --- /dev/null +++ b/.github/workflows/security.yaml @@ -0,0 +1,17 @@ +name: Security Scan + +on: + push: + branches: + - master + - main + - renovate/** + pull_request: + schedule: + - cron: "0 3 * * *" + +jobs: + security: + uses: newrelic/coreint-automation/.github/workflows/reusable_security.yaml@v3 + with: + skip-dirs: "build" \ No newline at end of file From aa8a106e6f301be52f14d737bfe4a76b89cfe15b Mon Sep 17 00:00:00 2001 From: sairaj18 Date: Thu, 21 Nov 2024 19:06:10 +0530 Subject: [PATCH 02/11] added fixes for push-pr jobs --- .github/workflows/prerelease.yml | 2 ++ .github/workflows/push_pr.yml | 46 ++++++++++++++++++-------------- 2 files changed, 28 insertions(+), 20 deletions(-) diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml index 055cc59..d26f695 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -6,6 +6,8 @@ on: - prereleased tags: - 'v*' +env: + NRJMX_VERSION: '2.6.0' # TODO check if we should update it to latest release version jobs: pre-release: diff --git a/.github/workflows/push_pr.yml b/.github/workflows/push_pr.yml index b27ce94..f9adfb6 100644 --- a/.github/workflows/push_pr.yml +++ b/.github/workflows/push_pr.yml @@ -7,32 +7,38 @@ on: - master pull_request: +env: + NRJMX_VERSION: '2.6.0' # TODO check if we should update it to latest release version + jobs: - static-analysis: - name: Run all static analysis checks - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v2 - - uses: newrelic/newrelic-infra-checkers@v1 - - name: Semgrep - uses: returntocorp/semgrep-action@v1 - with: - auditOn: push + # reusable_push_pr contains static-analysis but it does not contain the Semgrep step + # static-analysis job in reusable_push_pr cannot be disabled + # uncommenting the below leads to the following error "creating validator: parsing markdown: parsing markdown headers: unexpected additional L1 header \"2.4.7 (2021-06-10)\" found, only a single L1 header is allowed" + # TODO check if we can remove the below code and ignore the Semgrep step + # static-analysis: + # name: Run all static analysis checks + # runs-on: ubuntu-20.04 + # steps: + # - uses: actions/checkout@v2 + # - uses: newrelic/newrelic-infra-checkers@v1 + # - name: Semgrep + # uses: returntocorp/semgrep-action@v1 + # with: + # auditOn: push - - name: Install Go - uses: actions/setup-go@v5 - with: - go-version-file: 'go.mod' + # - name: Install Go + # uses: actions/setup-go@v5 + # with: + # go-version-file: 'go.mod' - - name: golangci-lint - uses: golangci/golangci-lint-action@v6 - continue-on-error: ${{ github.event_name != 'pull_request' }} - with: - only-new-issues: true + # - name: golangci-lint + # uses: golangci/golangci-lint-action@v6 + # continue-on-error: ${{ github.event_name != 'pull_request' }} + # with: + # only-new-issues: true push-pr: uses: newrelic/coreint-automation/.github/workflows/reusable_push_pr.yaml@v3 with: integration: jmx - run_test_build_fake_prerelease: true secrets: inherit \ No newline at end of file From ef24626798d9b2ef4f435b1338cc45907293f9e4 Mon Sep 17 00:00:00 2001 From: sairaj18 Date: Thu, 21 Nov 2024 19:08:38 +0530 Subject: [PATCH 03/11] moved NRJMX_VERSION from env to jobs declaration --- .github/workflows/prerelease.yml | 3 +-- .github/workflows/push_pr.yml | 4 +--- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml index d26f695..c371300 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -6,8 +6,6 @@ on: - prereleased tags: - 'v*' -env: - NRJMX_VERSION: '2.6.0' # TODO check if we should update it to latest release version jobs: pre-release: @@ -18,4 +16,5 @@ jobs: windows_goarch_matrix: ["amd64"] # 386 not supported in jmx integrations win_package_type: exe # JMX integrations are shipped in .exe format publish_schema: "ohi-jmx" # ohi-jmx for integrations that bundle JMX on windows installers + NRJMX_VERSION: '2.6.0' # TODO check if we should update it to latest release version secrets: inherit \ No newline at end of file diff --git a/.github/workflows/push_pr.yml b/.github/workflows/push_pr.yml index f9adfb6..1839d20 100644 --- a/.github/workflows/push_pr.yml +++ b/.github/workflows/push_pr.yml @@ -7,9 +7,6 @@ on: - master pull_request: -env: - NRJMX_VERSION: '2.6.0' # TODO check if we should update it to latest release version - jobs: # reusable_push_pr contains static-analysis but it does not contain the Semgrep step # static-analysis job in reusable_push_pr cannot be disabled @@ -41,4 +38,5 @@ jobs: uses: newrelic/coreint-automation/.github/workflows/reusable_push_pr.yaml@v3 with: integration: jmx + NRJMX_VERSION: '2.6.0' # TODO check if we should update it to latest release version secrets: inherit \ No newline at end of file From 9662fb79daea44ad17e8063ddb064c4a2aaf86d8 Mon Sep 17 00:00:00 2001 From: sairaj18 Date: Thu, 21 Nov 2024 19:16:58 +0530 Subject: [PATCH 04/11] disabled integration_nix test in reusable_push_pr and running it in push_pr.yml --- .github/workflows/push_pr.yml | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/.github/workflows/push_pr.yml b/.github/workflows/push_pr.yml index 1839d20..d417033 100644 --- a/.github/workflows/push_pr.yml +++ b/.github/workflows/push_pr.yml @@ -7,6 +7,9 @@ on: - master pull_request: +env: + NRJMX_VERSION: '2.6.0' # TODO check if we should update it to latest release version + jobs: # reusable_push_pr contains static-analysis but it does not contain the Semgrep step # static-analysis job in reusable_push_pr cannot be disabled @@ -34,9 +37,31 @@ jobs: # with: # only-new-issues: true + # can't run this step inside of container because of tests specific + test-integration-nix: + name: Run integration tests on *Nix + runs-on: ubuntu-20.04 + defaults: + run: + working-directory: src/github.com/${{env.ORIGINAL_REPO_NAME}} + steps: + - name: Check out code + uses: actions/checkout@v2 + with: + fetch-depth: 1 + path: src/github.com/${{env.ORIGINAL_REPO_NAME}} + - name: Install Go + uses: actions/setup-go@v5 + with: + go-version-file: 'src/github.com/${{env.ORIGINAL_REPO_NAME}}/go.mod' + - name: Integration test + env: + GOPATH: ${{ github.workspace }} + run: make integration-test + push-pr: uses: newrelic/coreint-automation/.github/workflows/reusable_push_pr.yaml@v3 with: integration: jmx - NRJMX_VERSION: '2.6.0' # TODO check if we should update it to latest release version + run_integration_nix: false secrets: inherit \ No newline at end of file From f93ab75fca3b125049ad613abefe90d92bd6aa73 Mon Sep 17 00:00:00 2001 From: sairaj18 Date: Fri, 22 Nov 2024 11:06:29 +0530 Subject: [PATCH 05/11] fix parse error in changelog.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ab4d9c1..59d086b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,7 +12,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). Please notice that old [V3](https://docs.newrelic.com/docs/create-integrations/infrastructure-integrations-sdk/specifications/host-integrations-standard-configuration-format/) configuration format is deprecated, but still supported. -## 2.4.7 (2021-06-10) +## 2.4.7 - 2021-06-10 ### Changed - ARM support From 6793903897d00843fa142c70ce0a3ef949a6cfc3 Mon Sep 17 00:00:00 2001 From: sairaj18 Date: Fri, 22 Nov 2024 11:15:36 +0530 Subject: [PATCH 06/11] fix parse error in changelog.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 59d086b..ce9d48e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,7 +12,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). Please notice that old [V3](https://docs.newrelic.com/docs/create-integrations/infrastructure-integrations-sdk/specifications/host-integrations-standard-configuration-format/) configuration format is deprecated, but still supported. -## 2.4.7 - 2021-06-10 +### 2.4.7 (2021-06-10) ### Changed - ARM support From a5e5c922c2806d1e2f5badde396b385a7bc9ac96 Mon Sep 17 00:00:00 2001 From: sairaj18 Date: Fri, 22 Nov 2024 11:17:43 +0530 Subject: [PATCH 07/11] fix parse error in changelog.md --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ce9d48e..3b11496 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,7 +12,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/). Please notice that old [V3](https://docs.newrelic.com/docs/create-integrations/infrastructure-integrations-sdk/specifications/host-integrations-standard-configuration-format/) configuration format is deprecated, but still supported. -### 2.4.7 (2021-06-10) +## 2.4.7 (2021-06-10) + ### Changed - ARM support From 17ccf85a7646a50ef1b32a1f7cf0c9a2a0e35241 Mon Sep 17 00:00:00 2001 From: sairaj18 Date: Fri, 22 Nov 2024 11:43:15 +0530 Subject: [PATCH 08/11] fix parse error in changelog.md and added unreleased changes --- CHANGELOG.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3b11496..02b697c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,15 @@ -[[#]] Change Log +# Change Log All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## Unreleased + +### enhancements +- leveraged reusable workflows to automate releases + ## 2.5.0 ### Added @@ -13,7 +18,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/). Please notice that old [V3](https://docs.newrelic.com/docs/create-integrations/infrastructure-integrations-sdk/specifications/host-integrations-standard-configuration-format/) configuration format is deprecated, but still supported. ## 2.4.7 (2021-06-10) - ### Changed - ARM support From 86ae4141bd6e389c0ebce99de5eefd6f5e720c9a Mon Sep 17 00:00:00 2001 From: sairaj18 Date: Fri, 22 Nov 2024 11:50:07 +0530 Subject: [PATCH 09/11] typo fix --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 02b697c..9a349f9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -# Change Log +# Changelog All notable changes to this project will be documented in this file. From a50cb411e839b4656200b63c7f55882875a6a7e2 Mon Sep 17 00:00:00 2001 From: sairaj18 Date: Fri, 22 Nov 2024 12:06:59 +0530 Subject: [PATCH 10/11] updated changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9a349f9..471efb7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## Unreleased ### enhancements -- leveraged reusable workflows to automate releases +- leveraged reusable workflows for pipelines ## 2.5.0 ### Added From 84fe994d18cb8541cf8cd6d009e749aeaff85d31 Mon Sep 17 00:00:00 2001 From: sairaj18 Date: Fri, 22 Nov 2024 12:36:50 +0530 Subject: [PATCH 11/11] updated the prerelease.yml file --- .github/workflows/prerelease.yml | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml index c371300..c8c15c9 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -7,7 +7,31 @@ on: tags: - 'v*' +env: + NRJMX_VERSION: '2.6.0' # TODO check if we should update it to latest release version + jobs: + test-integration-nix: + name: Run integration tests on *Nix + runs-on: ubuntu-20.04 + defaults: + run: + working-directory: src/github.com/${{env.ORIGINAL_REPO_NAME}} + steps: + - name: Check out code + uses: actions/checkout@v2 + with: + fetch-depth: 1 + path: src/github.com/${{env.ORIGINAL_REPO_NAME}} + - name: Install Go + uses: actions/setup-go@v5 + with: + go-version-file: 'src/github.com/${{env.ORIGINAL_REPO_NAME}}/go.mod' + - name: Integration test + env: + GOPATH: ${{ github.workspace }} + run: make integration-test + pre-release: uses: newrelic/coreint-automation/.github/workflows/reusable_pre_release.yaml@v3 with: @@ -16,5 +40,4 @@ jobs: windows_goarch_matrix: ["amd64"] # 386 not supported in jmx integrations win_package_type: exe # JMX integrations are shipped in .exe format publish_schema: "ohi-jmx" # ohi-jmx for integrations that bundle JMX on windows installers - NRJMX_VERSION: '2.6.0' # TODO check if we should update it to latest release version secrets: inherit \ No newline at end of file