diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 35d67129a15..a9e0e70ad3b 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -7,7 +7,7 @@ Note: Before submitting a pull request, please open an issue for discussion if y ## Checklist - [ ] I have followed [Sample Guidelines from AUTHORING_GUIDE.MD](https://github.com/GoogleCloudPlatform/python-docs-samples/blob/main/AUTHORING_GUIDE.md) - [ ] README is updated to include [all relevant information](https://github.com/GoogleCloudPlatform/python-docs-samples/blob/main/AUTHORING_GUIDE.md#readme-file) -- [ ] **Tests** pass: `nox -s py-3.9` (see [Test Environment Setup](https://github.com/GoogleCloudPlatform/python-docs-samples/blob/main/AUTHORING_GUIDE.md#test-environment-setup)) +- [ ] **Tests** pass: `nox -s py-3.10` (see [Test Environment Setup](https://github.com/GoogleCloudPlatform/python-docs-samples/blob/main/AUTHORING_GUIDE.md#test-environment-setup)) - [ ] **Lint** pass: `nox -s lint` (see [Test Environment Setup](https://github.com/GoogleCloudPlatform/python-docs-samples/blob/main/AUTHORING_GUIDE.md#test-environment-setup)) - [ ] These samples need a new **API enabled** in testing projects to pass (let us know which ones) - [ ] These samples need a new/updated **env vars** in testing projects set to pass (let us know which ones) diff --git a/.github/workflows/check-pr-manual-test.yml b/.github/workflows/check-pr-manual-test.yml new file mode 100644 index 00000000000..538a4e34dbc --- /dev/null +++ b/.github/workflows/check-pr-manual-test.yml @@ -0,0 +1,34 @@ +name: "CI: Check Manual Test Completion" +on: + pull_request: + types: [opened, edited, synchronize] +jobs: + check-task: + runs-on: ubuntu-latest + steps: + - name: Verify tests checkbox is ticked + uses: actions/github-script@v7 + with: + script: | + const prBody = context.payload.pull_request.body; + + if (!prBody) { + core.setFailed("PR description is empty. Please use the PR template and check the required boxes."); + return; + } + + // Regex checks for a markdown checkbox followed by 'nox -s py-3.' + // [ x ] or [x] means checked. [ ] means unchecked. + const checkedRegex = /- \[[xX]\] .*nox -s py-3\.\d+/; + const includesTargetText = prBody.includes("nox -s py-3."); + + if (!includesTargetText) { + core.setFailed("The required test verification line seems to be missing from the PR description."); + return; + } + + if (checkedRegex.test(prBody)) { + console.log("Success: The test execution checkbox has been marked!"); + } else { + core.setFailed("You must run the tests and check the 'nox -s py-3.9' box before this PR can be merged."); + } \ No newline at end of file diff --git a/AUTHORING_GUIDE.md b/AUTHORING_GUIDE.md index 6ae8d0a0372..37b9e1b8305 100644 --- a/AUTHORING_GUIDE.md +++ b/AUTHORING_GUIDE.md @@ -109,7 +109,7 @@ started with using a service or API — it should be in a _quickstart_ folder. ### Python Versions -Samples should support Python 3.9, 3.10, 3.11, 3.12 and 3.13. +Samples should support Python 3.10, 3.11, 3.12, 3.13 and 3.14. If the API or service your sample works with has specific Python version requirements different from those mentioned above, the sample should support