From cb49f1da5a3e614bf602e3eb19134440ebe00ea0 Mon Sep 17 00:00:00 2001 From: Nathan Park Date: Tue, 2 Sep 2025 13:37:55 -0700 Subject: [PATCH 1/3] add both failure and success update --- .github/workflows/pr-checks.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pr-checks.yml b/.github/workflows/pr-checks.yml index 79df8d93..cc6b9448 100644 --- a/.github/workflows/pr-checks.yml +++ b/.github/workflows/pr-checks.yml @@ -82,8 +82,9 @@ jobs: if: ${{ failure() }} run: | if [[ "${{ github.event.pull_request.user.login }}" == ${{ secrets.SAGEMAKER_BOT_USER_LOGIN }} ]]; then - echo "Integration test Failed. Putting Failure Metrics onto Cloudwatch" + echo "Integration test Failed. Putting Failure Metrics = 1 and Success = 0 onto Cloudwatch" aws cloudwatch put-metric-data --metric-name IntegrationTestFailure --namespace SageMakerPySdkCoreMonitoringMetrics --value 1 --unit Count --dimensions MetricCategory=Integration + aws cloudwatch put-metric-data --metric-name IntegrationTestSuccess --namespace SageMakerPySdkCoreMonitoringMetrics --value 0 --unit Count --dimensions MetricCategory=Integration else echo "Putting metrics has been skipped" fi @@ -91,8 +92,9 @@ jobs: if: ${{ success() }} run: | if [[ "${{ github.event.pull_request.user.login }}" == ${{ secrets.SAGEMAKER_BOT_USER_LOGIN }} ]]; then - echo "Integration test Succeeded. Putting Success Metrics onto Cloudwatch" + echo "Integration test Succeeded. Putting Success Metrics = 1 and Failure = 0onto Cloudwatch" aws cloudwatch put-metric-data --metric-name IntegrationTestSuccess --namespace SageMakerPySdkCoreMonitoringMetrics --value 1 --unit Count --dimensions MetricCategory=Integration + aws cloudwatch put-metric-data --metric-name IntegrationTestFailure --namespace SageMakerPySdkCoreMonitoringMetrics --value 0 --unit Count --dimensions MetricCategory=Integration else echo "Putting metrics has been skipped" fi @@ -130,8 +132,9 @@ jobs: if: ${{ failure() }} run: | if [[ "${{ github.event.pull_request.user.login }}" == ${{ secrets.SAGEMAKER_BOT_USER_LOGIN }} ]]; then - echo "Unit test run Failed. Putting Failure Metrics onto Cloudwatch" + echo "Unit test run Failed. Putting Failure Metrics = 1 and Success = 0 onto Cloudwatch" aws cloudwatch put-metric-data --metric-name UnitTestFailure --namespace SageMakerPySdkCoreMonitoringMetrics --value 1 --unit Count --dimensions MetricCategory=Unit-${{ matrix.python-version }} + aws cloudwatch put-metric-data --metric-name UnitTestSuccess --namespace SageMakerPySdkCoreMonitoringMetrics --value 0 --unit Count --dimensions MetricCategory=Unit-${{ matrix.python-version }} else echo "Putting metrics has been skipped" fi @@ -139,8 +142,9 @@ jobs: if: ${{ success() }} run: | if [[ "${{ github.event.pull_request.user.login }}" == ${{ secrets.SAGEMAKER_BOT_USER_LOGIN }} ]]; then - echo "Unit test run Succeeded. Putting Success Metrics onto Cloudwatch" + echo "Unit test run Succeeded. Putting Success Metrics = 1 and Failure = 0 onto Cloudwatch" aws cloudwatch put-metric-data --metric-name UnitTestSuccess --namespace SageMakerPySdkCoreMonitoringMetrics --value 1 --unit Count --dimensions MetricCategory=Unit-${{ matrix.python-version }} + aws cloudwatch put-metric-data --metric-name UnitTestFailure --namespace SageMakerPySdkCoreMonitoringMetrics --value 0 --unit Count --dimensions MetricCategory=Unit-${{ matrix.python-version }} else echo "Putting metrics has been skipped" fi From ae36f3b7f875bb278502a176514b6a6364b607f1 Mon Sep 17 00:00:00 2001 From: Nathan Park Date: Tue, 2 Sep 2025 14:59:08 -0700 Subject: [PATCH 2/3] fix a whitespace --- .github/workflows/pr-checks.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-checks.yml b/.github/workflows/pr-checks.yml index cc6b9448..3a0587fb 100644 --- a/.github/workflows/pr-checks.yml +++ b/.github/workflows/pr-checks.yml @@ -92,7 +92,7 @@ jobs: if: ${{ success() }} run: | if [[ "${{ github.event.pull_request.user.login }}" == ${{ secrets.SAGEMAKER_BOT_USER_LOGIN }} ]]; then - echo "Integration test Succeeded. Putting Success Metrics = 1 and Failure = 0onto Cloudwatch" + echo "Integration test Succeeded. Putting Success Metrics = 1 and Failure = 0 onto Cloudwatch" aws cloudwatch put-metric-data --metric-name IntegrationTestSuccess --namespace SageMakerPySdkCoreMonitoringMetrics --value 1 --unit Count --dimensions MetricCategory=Integration aws cloudwatch put-metric-data --metric-name IntegrationTestFailure --namespace SageMakerPySdkCoreMonitoringMetrics --value 0 --unit Count --dimensions MetricCategory=Integration else From ce63601dbca16d2ae7a801adf180395375ee7652 Mon Sep 17 00:00:00 2001 From: Nathan Park Date: Mon, 8 Sep 2025 13:46:26 -0700 Subject: [PATCH 3/3] fix: remove * and use checkout@v4 --- .github/workflows/pr-checks.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pr-checks.yml b/.github/workflows/pr-checks.yml index 3a0587fb..166f98d9 100644 --- a/.github/workflows/pr-checks.yml +++ b/.github/workflows/pr-checks.yml @@ -107,7 +107,7 @@ jobs: python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: ref: ${{ github.event.pull_request.head.sha }} - name: Set up Python ${{ matrix.python-version }} @@ -183,7 +183,7 @@ jobs: - name: Execute Python Coverage compute script and capture output id: execute_coverage_parse_script run: | - if [[ "${{ github.event.pull_request.user.login }}" == ${{ secrets.SAGEMAKER_BOT_USER_LOGIN }}* ]]; then + if [[ "${{ github.event.pull_request.user.login }}" == ${{ secrets.SAGEMAKER_BOT_USER_LOGIN }} ]]; then aws cloudwatch put-metric-data --metric-name UnitTestCoverage --namespace SageMakerPySdkCoreMonitoringMetrics --value $(python workflow_helper/compute_resource_coverage.py) --unit Count --dimensions MetricCategory=Unit-${{ matrix.python-version }} else echo "Putting metrics has been skipped" @@ -208,7 +208,7 @@ jobs: role-duration-seconds: 10800 - name: Execute Boto API Coverage compute script and capture output run: | - if [[ "${{ github.event.pull_request.user.login }}" == ${{ secrets.SAGEMAKER_BOT_USER_LOGIN }}* ]]; then + if [[ "${{ github.event.pull_request.user.login }}" == ${{ secrets.SAGEMAKER_BOT_USER_LOGIN }} ]]; then output=$(python workflow_helper/compute_boto_api_coverage.py) unsupported_apis=$(echo $output | cut -d ' ' -f1) supported_apis=$(echo $output | cut -d ' ' -f2) @@ -221,7 +221,7 @@ jobs: runs-on: ubuntu-latest needs: [wait-for-approval] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: ref: ${{ github.event.pull_request.head.sha }} - name: Set up Python