Skip to content

Commit

Permalink
DAT-16417 Extensions nightly build review (#136)
Browse files Browse the repository at this point in the history
* chore(create-release.yml): update version of sonar-push.yml to v0.5.8
chore(extension-attach-artifact-release.yml): update version of get_draft_release.sh, sign_artifact.sh, and upload_asset.sh to v0.5.8
chore(extension-release-prepare.yml): update version of extension-release-rollback.yml to v0.5.8
chore(extension-release-published.yml): update version of extension-release-prepare.yml to v0.5.8
chore(os-extension-test.yml): update version of sonar-pull-request.yml to v0.5.8
chore(package-linux.yml): update version of package-deb-pom.xml and sign_artifact.sh to v0.5.8
chore(pom-release-published.yml): update version of extension-release-prepare.yml to v0.5.8
chore(pro-extension-test.yml): update version of sonar-pull-request.yml to v0.5.8

* chore(workflows): add Slack notification on build failure for nightly builds

Add Slack notification on build failure for nightly builds in the OS extension and Pro extension test workflows. This will notify the team on Slack when a build fails, providing details such as the branch, commit, and repository. The notification is sent using the rtCamp/action-slack-notify GitHub Action.

The Slack notification includes the following information:
- Color: The status of the job (success, failure, etc.)
- Message: A link to view the details of the GitHub Actions run
- Title: A message indicating that the build failed, including the branch, commit, and repository
- Username: The username displayed for the Slack notification
- Webhook: The Slack webhook URL for sending the notification
- Icon Emoji: The emoji displayed for the Slack notification

* fix(workflows): update Slack notification titles to reflect test failures

The Slack notification titles in the `os-extension-test.yml` and `pro-extension-test.yml` workflows were updated to better reflect the nature of the failures. The previous titles indicated that the build failed, but the actual issue was with the tests. The titles were changed to "❌ Tests failed on branch [branch name] for commit [commit hash] in repository [repository name]". This change improves the accuracy and clarity of the notification messages.

* chore(os-extension-test.yml): update sonar-pull-request.yml workflow version to DAT-16417 for compatibility and consistency

* fix(workflows): fix conditional expression in Slack notification step to properly check for failure and nightly inputs

The conditional expression in the Slack notification step was not properly checking for failure and nightly inputs. This commit fixes the conditional expression by adding the missing dollar sign before the `inputs` variable.

* fix(workflows): update Slack notification messages to include the full URL to the GitHub Actions run

The Slack notification messages in the workflows `os-extension-test.yml` and `pro-extension-test.yml` have been updated to include the full URL to the GitHub Actions run. This will allow users to easily view the details of the failed build or tests directly from the Slack notification.

* chore(workflows): update Slack notification messages in os-extension-test.yml and pro-extension-test.yml

The Slack notification messages in the os-extension-test.yml and pro-extension-test.yml workflows have been updated to include a link to view the details on GitHub Actions. This will provide easier access to the specific workflow runs for failed builds and tests.

The SLACK_MESSAGE environment variable has been modified to include the GitHub Actions URL using the $GITHUB_SERVER_URL, $GITHUB_REPOSITORY, and $GITHUB_RUN_ID variables. This will dynamically generate the URL based on the current workflow run.

Additionally, the SLACK_TITLE environment variable has been updated to include the branch name and commit information for better context in the Slack notification.

* fix(os-extension-test.yml): fix syntax error in SLACK_MESSAGE environment variable to correctly reference GitHub Actions variables

The syntax error in the SLACK_MESSAGE environment variable has been fixed to correctly reference the GitHub Actions variables. This ensures that the Slack notification includes the correct link to view the details of the failed build on GitHub Actions.

* fix(workflows): update SLACK_MESSAGE in os-extension-test.yml and pro-extension-test.yml to use correct syntax for GitHub Actions variables

The SLACK_MESSAGE environment variable in the os-extension-test.yml and pro-extension-test.yml workflows was using incorrect syntax for referencing GitHub Actions variables. This has been updated to use the correct syntax `${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}`. This ensures that the Slack notification includes the correct link to view the details of the GitHub Actions run.

* fix(workflows): update Slack notification titles to include repository name for better context
feat(workflows): add repository name to Slack notification footer for better identification

* chore(workflows): add SLACK_FOOTER environment variable to include the GitHub repository name in Slack notifications for both os-extension-test.yml and pro-extension-test.yml workflows

* chore(workflows): update Slack notification messages to include the username @filipelautert and enable link names

The Slack notification messages in the GitHub Actions workflows have been updated to include the username @filipelautert. This change improves the visibility of the user who triggered the workflow run.

Additionally, the `SLACK_LINK_NAMES` environment variable has been set to true. This enables link names in the Slack messages, making it easier to mention and reference users and channels in the messages.

* chore(workflows): update Slack notification messages in os-extension-test.yml and pro-extension-test.yml

The Slack notification messages in the os-extension-test.yml and pro-extension-test.yml workflows have been updated to mention the username "filipe" instead of "filipelautert". This change improves the accuracy and consistency of the notification messages.

* fix(workflows): update Slack notification messages to mention specific user

The Slack notification messages in the workflows `os-extension-test.yml` and `pro-extension-test.yml` have been updated to mention the user with the ID `U042HRTL4DT`. This change was made to improve the visibility of the notifications and ensure that the relevant user is notified.

* chore(os-extension-test.yml): update sonar-pull-request.yml workflow version to v0.5.8 for better compatibility and stability
  • Loading branch information
jandroav authored Dec 12, 2023
1 parent 9decdc7 commit afa23aa
Show file tree
Hide file tree
Showing 8 changed files with 70 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:

jobs:
sonar:
uses: liquibase/build-logic/.github/workflows/sonar-push.yml@v0.5.7
uses: liquibase/build-logic/.github/workflows/sonar-push.yml@v0.5.8
secrets: inherit
with:
extraCommand: ${{ inputs.extraCommand }}
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/extension-attach-artifact-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ jobs:
- name: Get Reusable Script Files
run: |
curl -o $PWD/.github/get_draft_release.sh https://raw.githubusercontent.com/liquibase/build-logic/v0.5.7/.github/get_draft_release.sh
curl -o $PWD/.github/sign_artifact.sh https://raw.githubusercontent.com/liquibase/build-logic/v0.5.7/.github/sign_artifact.sh
curl -o $PWD/.github/upload_asset.sh https://raw.githubusercontent.com/liquibase/build-logic/v0.5.7/.github/upload_asset.sh
curl -o $PWD/.github/get_draft_release.sh https://raw.githubusercontent.com/liquibase/build-logic/v0.5.8/.github/get_draft_release.sh
curl -o $PWD/.github/sign_artifact.sh https://raw.githubusercontent.com/liquibase/build-logic/v0.5.8/.github/sign_artifact.sh
curl -o $PWD/.github/upload_asset.sh https://raw.githubusercontent.com/liquibase/build-logic/v0.5.8/.github/upload_asset.sh
chmod +x $PWD/.github/get_draft_release.sh
chmod +x $PWD/.github/sign_artifact.sh
chmod +x $PWD/.github/upload_asset.sh
Expand Down Expand Up @@ -176,7 +176,7 @@ jobs:
- name: Get upload_zip.sh Script File
if: inputs.zip == 'true'
run: |
curl -o $PWD/.github/upload_zip.sh https://raw.githubusercontent.com/liquibase/build-logic/v0.5.7/.github/upload_zip.sh
curl -o $PWD/.github/upload_zip.sh https://raw.githubusercontent.com/liquibase/build-logic/v0.5.8/.github/upload_zip.sh
chmod +x $PWD/.github/upload_zip.sh
- name: Attach Zip File to Draft Release
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/extension-release-prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ jobs:
release-rollback:
needs: prepare-release
if: ${{ always() && contains(needs.*.result, 'failure') }}
uses: liquibase/build-logic/.github/workflows/extension-release-rollback.yml@v0.5.7
uses: liquibase/build-logic/.github/workflows/extension-release-rollback.yml@v0.5.8
secrets: inherit
with:
extraCommand: ${{ inputs.extraCommand }}
2 changes: 1 addition & 1 deletion .github/workflows/extension-release-published.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ jobs:
maven-release:
needs: release
uses: liquibase/build-logic/.github/workflows/extension-release-prepare.yml@v0.5.7
uses: liquibase/build-logic/.github/workflows/extension-release-prepare.yml@v0.5.8
secrets: inherit
with:
extraCommand: ${{ inputs.extraCommand }}
30 changes: 29 additions & 1 deletion .github/workflows/os-extension-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,20 @@ jobs:
if: ${{ inputs.nightly }}
run: mvn -B dependency:go-offline clean package -DskipTests=true -Dliquibase.version=master-SNAPSHOT

- name: Notify Slack on Build Failure
if: ${{ failure() && inputs.nightly }}

uses: rtCamp/action-slack-notify@v2
env:
SLACK_COLOR: ${{ job.status }}
SLACK_MESSAGE: 'View details on GitHub Actions: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} <@U042HRTL4DT>'
SLACK_TITLE: '❌ ${{ github.repository }} ❌ Build failed on branch ${{ github.ref }} for commit ${{ github.sha }} in repository ${{github.repository}}'
SLACK_USERNAME: liquibot
SLACK_WEBHOOK: ${{ secrets.NIGHTLY_BUILDS_SLACK_WEBHOOK }}
SLACK_ICON_EMOJI: ':robot_face:'
SLACK_FOOTER: '${{ github.repository }}'
SLACK_LINK_NAMES: true

- name: Build and Package
if: ${{ !inputs.nightly }}
run: mvn -B dependency:go-offline clean package -DskipTests=true
Expand Down Expand Up @@ -164,6 +178,19 @@ jobs:
- name: Run Tests
run: mvn -B test -P 'coverage' ${{ inputs.extraMavenArgs }}

- name: Notify Slack on Build Failure
if: ${{ failure() && inputs.nightly }}
uses: rtCamp/action-slack-notify@v2
env:
SLACK_COLOR: ${{ job.status }}
SLACK_MESSAGE: 'View details on GitHub Actions: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} <@U042HRTL4DT>'
SLACK_TITLE: '❌ ${{ github.repository }} ❌ Tests failed on branch ${{ github.ref }} for commit ${{ github.sha }} in repository ${{github.repository}}'
SLACK_USERNAME: liquibot
SLACK_WEBHOOK: ${{ secrets.NIGHTLY_BUILDS_SLACK_WEBHOOK }}
SLACK_ICON_EMOJI: ':robot_face:'
SLACK_FOOTER: '${{ github.repository }}'
SLACK_LINK_NAMES: true

- name: Archive Test Results - ${{ matrix.os }}
if: ${{ always() }}
uses: actions/upload-artifact@v3
Expand All @@ -174,8 +201,9 @@ jobs:
**/target/site/jacoco/jacoco.xml
sonar-pr:
if: ${{ !inputs.nightly }}
needs: [ unit-test ]
uses: liquibase/build-logic/.github/workflows/sonar-pull-request.yml@v0.5.7
uses: liquibase/build-logic/.github/workflows/sonar-pull-request.yml@v0.5.8
secrets: inherit
with:
extraCommand: ${{ inputs.extraCommand }}
10 changes: 5 additions & 5 deletions .github/workflows/package-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@ jobs:
# Under the src folder is where specific packages files live. The GitHub action inputs will modify the universal package-deb-pom.xml to tell the process which assets to use during the packaging step
mkdir -p $PWD/.github/src/${{ inputs.artifactId }}/deb/control
mkdir -p $PWD/.github/src/${{ inputs.artifactId }}/main/archive
curl -o $PWD/.github/src/${{ inputs.artifactId }}/deb/control/control https://raw.githubusercontent.com/liquibase/build-logic/v0.5.7/src/${{ inputs.artifactId }}/deb/control/control
curl -o $PWD/.github/src/${{ inputs.artifactId }}/deb/control/postinst https://raw.githubusercontent.com/liquibase/build-logic/v0.5.7/src/${{ inputs.artifactId }}/deb/control/postinst
curl -o $PWD/.github/src/${{ inputs.artifactId }}/main/archive/${{ inputs.artifactId }}-env.sh https://raw.githubusercontent.com/liquibase/build-logic/v0.5.7/src/${{ inputs.artifactId }}/main/archive/${{ inputs.artifactId }}-env.sh
curl -o $PWD/.github/package-deb-pom.xml https://raw.githubusercontent.com/liquibase/build-logic/v0.5.7/.github/package-deb-pom.xml
curl -o $PWD/.github/sign_artifact.sh https://raw.githubusercontent.com/liquibase/build-logic/v0.5.7/.github/sign_artifact.sh
curl -o $PWD/.github/src/${{ inputs.artifactId }}/deb/control/control https://raw.githubusercontent.com/liquibase/build-logic/v0.5.8/src/${{ inputs.artifactId }}/deb/control/control
curl -o $PWD/.github/src/${{ inputs.artifactId }}/deb/control/postinst https://raw.githubusercontent.com/liquibase/build-logic/v0.5.8/src/${{ inputs.artifactId }}/deb/control/postinst
curl -o $PWD/.github/src/${{ inputs.artifactId }}/main/archive/${{ inputs.artifactId }}-env.sh https://raw.githubusercontent.com/liquibase/build-logic/v0.5.8/src/${{ inputs.artifactId }}/main/archive/${{ inputs.artifactId }}-env.sh
curl -o $PWD/.github/package-deb-pom.xml https://raw.githubusercontent.com/liquibase/build-logic/v0.5.8/.github/package-deb-pom.xml
curl -o $PWD/.github/sign_artifact.sh https://raw.githubusercontent.com/liquibase/build-logic/v0.5.8/.github/sign_artifact.sh
chmod +x $PWD/.github/sign_artifact.sh
- name: Import GPG key
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pom-release-published.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,5 +68,5 @@ jobs:
maven-release:
needs: release
uses: liquibase/build-logic/.github/workflows/extension-release-prepare.yml@v0.5.7
uses: liquibase/build-logic/.github/workflows/extension-release-prepare.yml@v0.5.8
secrets: inherit
29 changes: 28 additions & 1 deletion .github/workflows/pro-extension-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,19 @@ jobs:
if: ${{ inputs.nightly }}
run: mvn -B dependency:go-offline clean package -DskipTests=true -Dliquibase.version=master-SNAPSHOT

- name: Notify Slack on Build Failure
if: ${{ failure() && inputs.nightly }}
uses: rtCamp/action-slack-notify@v2
env:
SLACK_COLOR: ${{ job.status }}
SLACK_MESSAGE: 'View details on GitHub Actions: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} <@U042HRTL4DT>'
SLACK_TITLE: '❌ ${{ github.repository }} ❌ Build failed on branch ${{ github.ref }} for commit ${{ github.sha }} in repository ${{github.repository}}'
SLACK_USERNAME: liquibot
SLACK_WEBHOOK: ${{ secrets.NIGHTLY_BUILDS_SLACK_WEBHOOK }}
SLACK_ICON_EMOJI: ':robot_face:'
SLACK_FOOTER: '${{ github.repository }}'
SLACK_LINK_NAMES: true

- name: Build and Package
if: ${{ !inputs.nightly }}
run: mvn -B dependency:go-offline clean package -DskipTests=true
Expand Down Expand Up @@ -225,6 +238,19 @@ jobs:
- name: Run Tests
run: mvn -B test -P 'coverage' ${{ inputs.extraMavenArgs }}

- name: Notify Slack on Build Failure
if: ${{ failure() && inputs.nightly }}
uses: rtCamp/action-slack-notify@v2
env:
SLACK_COLOR: ${{ job.status }}
SLACK_MESSAGE: 'View details on GitHub Actions: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} <@U042HRTL4DT>'
SLACK_TITLE: '❌ ${{ github.repository }} ❌ Tests failed on branch ${{ github.ref }} for commit ${{ github.sha }} in repository ${{github.repository}}'
SLACK_USERNAME: liquibot
SLACK_WEBHOOK: ${{ secrets.NIGHTLY_BUILDS_SLACK_WEBHOOK }}
SLACK_ICON_EMOJI: ':robot_face:'
SLACK_FOOTER: '${{ github.repository }}'
SLACK_LINK_NAMES: true

- name: Archive Test Results - ${{ matrix.os }}
if: ${{ always() }}
uses: actions/upload-artifact@v3
Expand All @@ -235,8 +261,9 @@ jobs:
**/target/site/jacoco/jacoco.xml
sonar-pr:
if: ${{ !inputs.nightly }}
needs: [ unit-test ]
uses: liquibase/build-logic/.github/workflows/sonar-pull-request.yml@v0.5.7
uses: liquibase/build-logic/.github/workflows/sonar-pull-request.yml@v0.5.8
secrets: inherit
with:
extraCommand: ${{ inputs.extraCommand }}

0 comments on commit afa23aa

Please sign in to comment.