diff --git a/.github/workflows/collector-builder.yml b/.github/workflows/collector-builder.yml index ae1aa487c8..785f072ef9 100644 --- a/.github/workflows/collector-builder.yml +++ b/.github/workflows/collector-builder.yml @@ -123,6 +123,16 @@ jobs: -e @'${{ github.workspace }}/ansible/secrets.yml' \ ansible/ci-build-builder.yml + - name: Report build failure to Jira + if: (!cancelled()) + uses: stackrox/actions/test/junit2jira@main + with: + dry-run: ${{ github.event_name != 'push' }} + jira-user: ${{ secrets.JIRA_USER }} + jira-token: ${{ secrets.JIRA_TOKEN }} + directory: junit-reports + gcp-metrics: false + create-multiarch-manifest: needs: - builder-needs-rebuilding @@ -165,21 +175,12 @@ jobs: base-image: quay.io/rhacs-eng/collector-builder:${{ env.COLLECTOR_BUILDER_TAG }} archs: ${{ env.ARCHS }} - notify: - runs-on: ubuntu-24.04 - if: always() && contains(join(needs.*.result, ','), 'failure') && github.event_name != 'pull_request' - needs: - - build-builder-image - - create-multiarch-manifest - steps: - - name: Slack notification - uses: rtCamp/action-slack-notify@v2 - env: - SLACK_WEBHOOK: ${{ secrets.SLACK_COLLECTOR_ONCALL_WEBHOOK }} - SLACK_CHANNEL: team-acs-collector-oncall - SLACK_COLOR: failure - SLACK_LINK_NAMES: true - SLACK_TITLE: "Builder image build has failed" - MSG_MINIMAL: actions url,commit - SLACK_MESSAGE: | - @acs-collector-oncall + - name: Report build failure to Jira + if: (!cancelled()) + uses: stackrox/actions/test/junit2jira@main + with: + dry-run: ${{ github.event_name != 'push' }} + jira-user: ${{ secrets.JIRA_USER }} + jira-token: ${{ secrets.JIRA_TOKEN }} + directory: junit-reports + gcp-metrics: false diff --git a/.github/workflows/collector.yml b/.github/workflows/collector.yml index a1ee87c037..562c9e1499 100644 --- a/.github/workflows/collector.yml +++ b/.github/workflows/collector.yml @@ -88,6 +88,16 @@ jobs: -e @'${{ github.workspace }}/ansible/secrets.yml' \ ansible/ci-build-collector.yml + - name: Report build failure to Jira + if: (!cancelled()) + uses: stackrox/actions/test/junit2jira@main + with: + dry-run: ${{ github.event_name != 'push' }} + jira-user: ${{ secrets.JIRA_USER }} + jira-token: ${{ secrets.JIRA_TOKEN }} + directory: junit-reports + gcp-metrics: false + create-multiarch-manifest: needs: - build-collector-image @@ -126,21 +136,12 @@ jobs: base-image: quay.io/rhacs-eng/collector:${{ inputs.collector-tag }} archs: ${{ env.ARCHS }} - notify: - runs-on: ubuntu-24.04 - if: always() && contains(join(needs.*.result, ','), 'failure') && github.event_name != 'pull_request' - needs: - - build-collector-image - - create-multiarch-manifest - steps: - - name: Slack notification - uses: rtCamp/action-slack-notify@v2 - env: - SLACK_WEBHOOK: ${{ secrets.SLACK_COLLECTOR_ONCALL_WEBHOOK }} - SLACK_CHANNEL: team-acs-collector-oncall - SLACK_COLOR: failure - SLACK_LINK_NAMES: true - SLACK_TITLE: "Collector image build has failed" - MSG_MINIMAL: actions url,commit - SLACK_MESSAGE: | - @acs-collector-oncall + - name: Report build failure to Jira + if: (!cancelled()) + uses: stackrox/actions/test/junit2jira@main + with: + dry-run: ${{ github.event_name != 'push' }} + jira-user: ${{ secrets.JIRA_USER }} + jira-token: ${{ secrets.JIRA_TOKEN }} + directory: junit-reports + gcp-metrics: false diff --git a/.github/workflows/gardenlinux-bumper.yml b/.github/workflows/gardenlinux-bumper.yml index af51c7a9ba..af4ec29887 100644 --- a/.github/workflows/gardenlinux-bumper.yml +++ b/.github/workflows/gardenlinux-bumper.yml @@ -41,21 +41,3 @@ jobs: labels: | all-integration-tests draft: false - - notify: - runs-on: ubuntu-24.04 - if: always() && contains(join(needs.*.result, ','), 'failure') && github.event_name == 'schedule' - needs: - - run-bumper - steps: - - name: Slack notification - uses: rtCamp/action-slack-notify@v2 - env: - SLACK_WEBHOOK: ${{ secrets.SLACK_COLLECTOR_ONCALL_WEBHOOK }} - SLACK_CHANNEL: team-acs-collector-oncall - SLACK_COLOR: failure - SLACK_LINK_NAMES: true - SLACK_TITLE: Garden Linux version bumper failed - MSG_MINIMAL: actions url,commit - SLACK_MESSAGE: | - @acs-collector-oncall diff --git a/.github/workflows/integration-test-containers.yml b/.github/workflows/integration-test-containers.yml index 9d6a1590fc..29b03405fd 100644 --- a/.github/workflows/integration-test-containers.yml +++ b/.github/workflows/integration-test-containers.yml @@ -123,6 +123,16 @@ jobs: -e @'${{ github.workspace }}/ansible/secrets.yml' \ ansible/ci-build-tests.yml + - name: Report build failure to Jira + if: (!cancelled()) + uses: stackrox/actions/test/junit2jira@main + with: + dry-run: ${{ github.event_name != 'push' }} + jira-user: ${{ secrets.JIRA_USER }} + jira-token: ${{ secrets.JIRA_TOKEN }} + directory: junit-reports + gcp-metrics: false + common-variables: runs-on: ubuntu-24.04 outputs: @@ -179,21 +189,12 @@ jobs: run: | make -C "${{ matrix.directory }}" build-and-push - notify: - runs-on: ubuntu-24.04 - if: always() && contains(join(needs.*.result, ','), 'failure') && github.event_name != 'pull_request' - needs: - - build-test-image - - rebuild-containers - steps: - - name: Slack notification - uses: rtCamp/action-slack-notify@v2 - env: - SLACK_WEBHOOK: ${{ secrets.SLACK_COLLECTOR_ONCALL_WEBHOOK }} - SLACK_CHANNEL: team-acs-collector-oncall - SLACK_COLOR: failure - SLACK_LINK_NAMES: true - SLACK_TITLE: "Failed to rebuild test containers" - MSG_MINIMAL: actions url,commit - SLACK_MESSAGE: | - @acs-collector-oncall + - name: Report build failure to Jira + if: (!cancelled()) + uses: stackrox/actions/test/junit2jira@main + with: + dry-run: ${{ github.event_name != 'push' }} + jira-user: ${{ secrets.JIRA_USER }} + jira-token: ${{ secrets.JIRA_TOKEN }} + directory: junit-reports + gcp-metrics: false diff --git a/.github/workflows/integration-tests-vm-type.yml b/.github/workflows/integration-tests-vm-type.yml index 8f7a033685..7238b476eb 100644 --- a/.github/workflows/integration-tests-vm-type.yml +++ b/.github/workflows/integration-tests-vm-type.yml @@ -140,6 +140,21 @@ jobs: rm -f "$file" done + - name: Report test failures to Jira + # Run even when tests failed (that is the point), but not when the job + # was cancelled or when running benchmarks (which produce no JUnit XML). + if: (!cancelled()) && !inputs.run-benchmarks + id: junit2jira + uses: stackrox/actions/test/junit2jira@main + with: + # Only create real Jira issues on push; dry-run on pull requests. + dry-run: ${{ github.event_name != 'push' }} + jira-user: ${{ secrets.JIRA_USER }} + jira-token: ${{ secrets.JIRA_TOKEN }} + directory: integration-tests/container-logs + # gcloud is already authenticated earlier in this job, so the action + # reuses that session for the metrics upload (no gcp-account needed). + - name: Store artifacts if: always() # Don't fail the job on upload errors (e.g. ECONNRESET) — diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index fb51f58a22..74c7763639 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -130,24 +130,3 @@ jobs: job-tag: ${{ inputs.job-tag }} collector-repo: ${{ inputs.collector-repo }} secrets: inherit - - notify: - runs-on: ubuntu-24.04 - if: always() && contains(join(needs.*.result, ','), 'failure') && github.event_name != 'pull_request' - needs: - - amd64-integration-tests - - arm64-integration-tests - - s390x-integration-tests - - ppc64le-integration-tests - steps: - - name: Slack notification - uses: rtCamp/action-slack-notify@v2 - env: - SLACK_WEBHOOK: ${{ secrets.SLACK_COLLECTOR_ONCALL_WEBHOOK }} - SLACK_CHANNEL: team-acs-collector-oncall - SLACK_COLOR: failure - SLACK_LINK_NAMES: true - SLACK_TITLE: "Integration tests failed." - MSG_MINIMAL: actions url,commit - SLACK_MESSAGE: | - @acs-collector-oncall diff --git a/.github/workflows/k8s-integration-tests.yml b/.github/workflows/k8s-integration-tests.yml index 38c3307f5a..d517ad76ef 100644 --- a/.github/workflows/k8s-integration-tests.yml +++ b/.github/workflows/k8s-integration-tests.yml @@ -96,6 +96,20 @@ jobs: -e @/tmp/vars.yml \ ansible/k8s-integration-tests.yml + - name: Report test failures to Jira + # Run even when tests failed (that is the point), but not when the job + # was cancelled. + if: (!cancelled()) + id: junit2jira + uses: stackrox/actions/test/junit2jira@main + with: + # Only create real Jira issues on push; dry-run on pull requests. + dry-run: ${{ github.event_name != 'push' }} + jira-user: ${{ secrets.JIRA_USER }} + jira-token: ${{ secrets.JIRA_TOKEN }} + directory: integration-tests/container-logs + gcp-metrics: false + - name: Store artifacts if: always() uses: actions/upload-artifact@v4 @@ -103,21 +117,3 @@ jobs: name: k8s-logs path: | ${{ github.workspace }}/integration-tests/container-logs/**/* - - notify: - runs-on: ubuntu-24.04 - if: always() && contains(join(needs.*.result, ','), 'failure') && github.event_name != 'pull_request' - needs: - - k8s-integration-tests - steps: - - name: Slack notification - uses: rtCamp/action-slack-notify@v2 - env: - SLACK_WEBHOOK: ${{ secrets.SLACK_COLLECTOR_ONCALL_WEBHOOK }} - SLACK_CHANNEL: team-acs-collector-oncall - SLACK_COLOR: failure - SLACK_LINK_NAMES: true - SLACK_TITLE: "K8S Integration tests failed." - MSG_MINIMAL: actions url,commit - SLACK_MESSAGE: | - @acs-collector-oncall diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4907ec34e3..a5407cbbbc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -223,22 +223,3 @@ jobs: run: | cd falcosecurity-libs/ git push origin "${RELEASE}.${PATCH}" - - - name: Send message to slack - uses: rtCamp/action-slack-notify@v2 - env: - SLACK_WEBHOOK: ${{ secrets.SLACK_COLLECTOR_ONCALL_WEBHOOK }} - SLACK_CHANNEL: team-acs-collector-oncall - SLACK_COLOR: success - SLACK_LINK_NAMES: true - SLACK_TITLE: "New release tagged" - SLACKIFY_MARKDOWN: true - MSG_MINIMAL: true - SLACK_MESSAGE: | - @acs-collector-oncall a new release has just been triggered - with the following values: - - | Name | Value | - | --- | --- | - | Version | ${{ env.RELEASE }}.${{ env.PATCH }} | - | Release Type | ${{ env.RELEASE_TYPE }} | diff --git a/ansible/k8s-integration-tests.yml b/ansible/k8s-integration-tests.yml index 878e5d999e..bcf80f9d83 100644 --- a/ansible/k8s-integration-tests.yml +++ b/ansible/k8s-integration-tests.yml @@ -5,6 +5,8 @@ vars: kind_name: "{{ cluster_name | default('collector-tests') }}" c_engine: "{{ container_engine | default('docker') }}" + integration_tests_root: "{{ collector_root }}/integration-tests" + logs_root: "{{ collector_root }}/integration-tests/container-logs" tasks: - name: Check KinD is installed @@ -147,7 +149,7 @@ value: "{{ lookup('env', 'COLLECTOR_QA_TAG', default=lookup('file', collector_root + '/integration-tests/container/QA_TAG')) }}" - name: COLLECTOR_IMAGE value: "{{ collector_image }}" - args: ["-test.run", "^TestK8s.*"] + args: ["-test.run", "^TestK8s.*", "-test.v"] ports: - containerPort: 9999 volumeMounts: @@ -190,6 +192,34 @@ tags: - test-only + - name: Ensure container-logs directory exists + ansible.builtin.file: + path: "{{ logs_root }}" + state: directory + mode: "0755" + delegate_to: localhost + tags: + - test-only + + - name: Write integration test log + ansible.builtin.copy: + content: "{{ log.log }}" + dest: "{{ logs_root }}/integration-test-k8s.log" + delegate_to: localhost + tags: + - test-only + + - name: Report + community.general.make: + chdir: "{{ integration_tests_root }}" + target: report + environment: + LOG_FILE: "{{ logs_root }}/integration-test-k8s.log" + JUNIT_FILE: "integration-test-report-k8s.xml" + delegate_to: localhost + tags: + - test-only + - name: Cleanup namespace kubernetes.core.k8s: state: absent