Issue 4940: Add skip deployment flag for PR bot tests - #4947
Issue 4940: Add skip deployment flag for PR bot tests#4947stuart-bass-cgi wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a skip_deployment flag to PR comment bot /test and /test-extended commands so maintainers can rerun smoke/extended E2E tests against an already-deployed deterministic PR validation environment, avoiding the full build/deploy pipeline when appropriate.
Changes:
- Extended PR bot command parsing to recognize
skip_deploymentand pass it through to the reusable deployment workflow. - Updated the reusable workflow to conditionally bypass deployment/build stages and still run smoke/custom E2E jobs.
- Updated developer docs and added unit tests covering the new command parsing behavior.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| docs/tre-developers/github-pr-bot-commands.md | Documents the new skip_deployment flag syntax and fork PR examples for /test and /test-extended. |
| .github/workflows/pr_comment_bot.yml | Plumbs skipDeployment output from the parsing script into the reusable workflow call. |
| .github/workflows/deploy_tre_reusable.yml | Adds skipDeployment input and adjusts E2E job conditions to allow running tests when deployment is skipped. |
| .github/scripts/build.js | Parses skip_deployment, emits skipDeployment output, and updates external-PR SHA extraction to ignore the flag. |
| .github/scripts/build.test.js | Adds unit tests validating skipDeployment output behavior for internal and external PR command forms. |
|
@microsoft-github-policy-service agree company="CGI" |
|
stuart-bass-cgi thanks for the PR. A review with Opus 4.8 says: I Overall: Well-structured, focused change that solves a real developer pain point (re-running smoke/extended E2E tests without a full redeploy). Good test coverage and docs, plus a couple of nice opportunistic bug fixes. A few items to confirm before approval. 🟢 Done well
🟠 To address
🟡 Nits
Verdict: LGTM pending confirmation of (1) smoke-test check reporting and (2) the intentional flag asymmetry. Let me know if you agree! |
Unit Test Results0 tests 0 ✅ 0s ⏱️ Results for commit c3e764d. ♻️ This comment has been updated with latest results. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (3)
.github/workflows/deploy_tre_reusable.yml:887
- Same as the smoke job: when deployment jobs are skipped because of an earlier failure, this condition can still evaluate true (since
needs.*.resultmay beskippedrather thanfailure). That risks running long custom E2E tests against an environment that never successfully deployed.
e2e_tests_custom:
name: "Run E2E Tests"
if: ${{ always() && inputs.e2eTestsCustomSelector != '' && (inputs.skipDeployment || (!contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled'))) }}
runs-on: ubuntu-latest
.github/workflows/deploy_tre_reusable.yml:842
- The current job condition will allow smoke tests to run when upstream deployment jobs were skipped due to a failure (e.g., a deploy job fails, downstream needs become
skipped, and this expression doesn’t catch that). This can run E2E tests against a partially/un-deployed environment.
This issue also appears on line 884 of the same file.
e2e_tests_smoke:
name: "Run E2E Tests (Smoke)"
if: ${{ always() && (inputs.skipDeployment || (!contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled'))) }}
runs-on: ubuntu-latest
.github/scripts/build.test.js:416
- Unit tests cover
skip_deploymentfor maintainer PRs and for/teston external PRs, but there’s no coverage for/test-extended <sha> skip_deploymenton external PRs. Since the SHA parsing changed to ignore theskip_deploymenttoken, adding a test for the external/test-extendedvariant would protect against regressions (including different token ordering).
describe(`for '/test-extended'`, () => {
test(`should set command to 'run-tests-extended'`, async () => {
const context = createCommentContext({
username: 'admin',
body: '/test-extended',
});
await getCommandFromComment({ core, context, github });
expect(outputFor(mockCoreSetOutput, 'command')).toBe('run-tests-extended');
});
test(`should set skipDeployment to 'true' when skip_deployment is supplied`, async () => {
const context = createCommentContext({
username: 'admin',
body: '/test-extended skip_deployment',
});
await getCommandFromComment({ core, context, github });
expect(outputFor(mockCoreSetOutput, 'command')).toBe('run-tests-extended');
expect(outputFor(mockCoreSetOutput, 'skipDeployment')).toBe('true');
});
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 180 out of 184 changed files in this pull request and generated 3 comments.
Files not reviewed (1)
- ui/app/package-lock.json: Generated file
Suppressed comments (2)
api_app/resources/strings.py:265
- This template exposes the underlying Event Grid exception in the HTTP 503 response via
.format(e). Azure SDK exceptions may include endpoint or response details that should remain in logs; return a static client-facing message while retaininglogger.exceptionfor diagnostics.
CHANGELOG.md:9 - The PR description says this change is limited to the PR-bot
skip_deploymentflag, but this line is part of substantial unrelated FastAPI/Pydantic, authentication, backup-deletion, template, and dependency changes. This makes the stated scope and linked issue inaccurate and prevents focused validation; split the unrelated work into its corresponding PRs, or update the title/description and issue linkage to describe the full scope.
* Upgrade FastAPI to 0.139.2, Starlette to 1.3.1, and compatible OpenTelemetry dependencies, with routing updates for newer FastAPI and Pydantic v2 compatibility.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 180 out of 184 changed files in this pull request and generated 1 comment.
Files not reviewed (1)
- ui/app/package-lock.json: Generated file
Suppressed comments (8)
api_app/models/domain/airlock_request.py:108
- Making
typeoptional allows the newly supported legacy records without a type to load, but every status transition publishes an event throughevent_grid/event_sender.py:17, which unconditionally evaluatesairlock_request.type.value. Submitting or cancelling one of these records therefore updates Cosmos and then fails with a 503/AttributeError. Legacy records need a migrated/inferred type, or event-producing operations must reject them before persisting a status change.
api_app/services/airlock.py:351 - The exception text from the Azure SDK is returned verbatim to the API caller. Such messages can include endpoint, response, and infrastructure details; the detailed exception is already captured by
logger.exception. Return the generic Event Grid error here as well.
api_app/requirements.txt:26 - The PR is described as a narrowly scoped PR-bot
skip_deploymentchange, but this line is part of an unrelated Pydantic v1→v2/FastAPI migration; the diff also contains authentication, backup, Terraform, and template changes. These materially expand the risk and cannot be reviewed against issue #4940's stated acceptance criteria. Split the unrelated work into its own PR(s), or update the PR metadata and linked scope to accurately describe the combined release.
CHANGELOG.md:23 - The changelog says the certs bundle for this fix is
0.7.11, while the changed manifest publishes0.7.12(templates/shared_services/certs/porter.yaml:4). This gives operators the wrong version to deploy.
* Ignore changes to `ip_tags` on public IP resources to unblock deployments where these tags are set by Azure policy. (`core` 0.16.17, `tre-shared-service-certs` 0.7.11) ([#5019](https://github.com/microsoft/AzureTRE/issues/5019))
templates/workspaces/base/template_schema.json:119
- Although this field is marked updateable and the documentation says the choice can be changed before deletion, it only exists under conditional
allOf. Patch validation only copies updateable fields from the schema's top-levelproperties(api_app/db/repositories/resources.py:242-244), so a PATCH containing this flag is rejected. Expose conditional updateable properties to patch validation (or redesign the schema) so users can switch the uninstall behavior.
templates/workspaces/unrestricted/template_schema.json:104 - Although this field is marked updateable and the documentation says the choice can be changed before deletion, it only exists under conditional
allOf. Patch validation only copies updateable fields from the schema's top-levelproperties(api_app/db/repositories/resources.py:242-244), so a PATCH containing this flag is rejected. Expose conditional updateable properties to patch validation (or redesign the schema) so users can switch the uninstall behavior.
templates/workspaces/airlock-import-review/template_schema.json:82 - Although this field is marked updateable and the documentation says the choice can be changed before deletion, it only exists under conditional
allOf. Patch validation only copies updateable fields from the schema's top-levelproperties(api_app/db/repositories/resources.py:242-244), so a PATCH containing this flag is rejected. Expose conditional updateable properties to patch validation (or redesign the schema) so users can switch the uninstall behavior.
CHANGELOG.md:9 - The significant
/testand/test-extendedskip_deploymentenhancement described by this PR has no entry in the unreleased changelog. Add an issue-linked entry so release notes include the new PR-bot behavior.
* Upgrade FastAPI to 0.139.2, Starlette to 1.3.1, and compatible OpenTelemetry dependencies, with routing updates for newer FastAPI and Pydantic v2 compatibility.
6d57636 to
54b5fa9
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Suppressed comments (1)
.github/workflows/deploy_tre_reusable.yml:52
- This user-facing workflow enhancement has no entry under the Unreleased section of
CHANGELOG.md. Repository guidance in.github/copilot-instructions.md:181requires significant changes to be recorded there with an issue or PR reference.
skipDeployment:
description: Skip deployment jobs and run only the requested E2E tests against an existing environment
type: boolean
default: false
required: false
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
/test-extended |
|
🤖 pr-bot 🤖 🏃 Running extended tests: https://github.com/microsoft/AzureTRE/actions/runs/31794968325 (with refid (in response to this comment from stuart-bass-cgi) |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.
Suppressed comments (1)
.github/scripts/build.js:9
- This user-facing PR bot enhancement is missing the required entry under the unreleased
ENHANCEMENTSsection ofCHANGELOG.md. Please add an entry referencing issue #4940 so the change is included in release notes.
const SKIP_DEPLOYMENT_FLAG = "skip_deployment";
|
Marcus Robinson (@marrobi) - should all be resolved now |
|
/test skip-deployment |
|
🤖 pr-bot 🤖 🏃 Running tests: https://github.com/microsoft/AzureTRE/actions/runs/31800083005 (with refid (in response to this comment from stuart-bass-cgi) |
|
/test-extended skip-deployment |
|
🤖 pr-bot 🤖 🏃 Running extended tests: https://github.com/microsoft/AzureTRE/actions/runs/31804416785 (with refid (in response to this comment from stuart-bass-cgi) |
|
/test-extended-aad skip_deployment |
|
🤖 pr-bot 🤖 🏃 Running extended AAD tests: https://github.com/microsoft/AzureTRE/actions/runs/31804624444 (with refid (in response to this comment from stuart-bass-cgi) |
|
Marcus Robinson (@marrobi) - the review feedback should now be addressed in the latest commits.
One caveat on live-testing the unsupported-command warning: |
Resolves #4940
What is being addressed
PR bot
/testand/test-extendedcommands currently always run the full validation flow, including build and deployment jobs, even when the PR validation environment has already been deployed. This makes it slow to re-run smoke or extended E2E tests after transient test failures or test-only changes.How is this addressed
skip_deploymentflag for the/testand/test-extendedPR bot commands.skip_deploymentis true, skips the deployment/build/register jobs and allows the smoke and requested custom E2E jobs to run against the existing deterministic PR validation environment.skip_deploymentis supplied.