Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions .github/workflows/cloud_build_failure_reporter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ on:

jobs:
report:
if: github.repository == 'GoogleCloudPlatform/cloud-sql-python-connector'

permissions:
issues: 'write'
Expand All @@ -39,13 +40,15 @@ jobs:

steps:
- uses: 'actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd' # v8
env:
TRIGGER_NAMES: ${{ inputs.trigger_names }}
with:
script: |-
// parse test names
const testNameSubstring = '${{ inputs.trigger_names }}';
const testNameSubstring = process.env.TRIGGER_NAMES || '';
const testNameFound = new Map(); //keeps track of whether each test is found
testNameSubstring.split(',').forEach(testName => {
testNameFound.set(testName, false);
testNameFound.set(testName.trim(), false);
});

// label for all issues opened by reporter
Expand Down Expand Up @@ -172,8 +175,8 @@ jobs:
const noTestFound = Array.from(testNameFound.values()).every(value => value === false);
if (noTestFound){
createOrCommentIssue(
'Missing periodic tests: ${{ inputs.trigger_names }}',
`No periodic test is found for triggers: ${{ inputs.trigger_names }}. Last checked from ${
`Missing periodic tests: ${testNameSubstring}`,
`No periodic test is found for triggers: ${testNameSubstring}. Last checked from ${
commits[0].html_url
} to ${commits[commits.length - 1].html_url}.`
);
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/schedule_reporter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@ on:

jobs:
run_reporter:
if: github.repository == 'GoogleCloudPlatform/cloud-sql-python-connector'
permissions:
issues: 'write'
checks: 'read'
contents: 'read'
uses: ./.github/workflows/cloud_build_failure_reporter.yml
with:
trigger_names: "py-continuous-test-on-merge,py-integration-test-nightly"

Loading