Skip to content

Add test results upload on demand#642

Open
mawilk90 wants to merge 1 commit intolinode:devfrom
mawilk90:hotfix/align_tod_reports_upload
Open

Add test results upload on demand#642
mawilk90 wants to merge 1 commit intolinode:devfrom
mawilk90:hotfix/align_tod_reports_upload

Conversation

@mawilk90
Copy link
Contributor

@mawilk90 mawilk90 commented Feb 6, 2026

📝 Description

Added workflow logic to upload test results for manual runs on demand only

@mawilk90 mawilk90 requested a review from a team as a code owner February 6, 2026 13:13
@mawilk90 mawilk90 added the improvement for improvements in existing functionality in the changelog. label Feb 6, 2026
@mawilk90 mawilk90 requested review from ezilber-akamai and lgarber-akamai and removed request for a team February 6, 2026 13:13
@mawilk90 mawilk90 added the testing for updates to the testing suite in the changelog. label Feb 6, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an opt-in workflow_dispatch input to control whether E2E test reports are uploaded, preventing automatic uploads on manually triggered runs unless explicitly requested.

Changes:

  • Introduces a test_report_upload input (default false) for manual workflow runs.
  • Updates conditional logic for uploading test reports to only run on push/PR events by default, or when explicitly enabled for workflow_dispatch.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
.github/workflows/e2e-test.yml Adds test_report_upload input and gates the report upload job for manual runs.
.github/workflows/e2e-test-pr.yml Adds test_report_upload input and gates the “Upload test results” step for manual runs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


- name: Upload test results
if: always()
if: always() && github.repository == 'linode/linode_api4-python' && (github.event_name == 'pull_request' || (github.event_name == 'workflow_dispatch' && inputs.test_report_upload == 'true'))
Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

github.repository == 'linode/linode_api4-python' does not exclude uploads for PRs coming from forks, because for pull_request events github.repository typically refers to the base repository (still linode/linode_api4-python). If the goal is to prevent uploads on fork PRs, gate on the PR head repo instead (e.g., github.event.pull_request.head.repo.full_name == github.repository or !github.event.pull_request.head.repo.fork) while keeping the current behavior for workflow_dispatch.

Suggested change
if: always() && github.repository == 'linode/linode_api4-python' && (github.event_name == 'pull_request' || (github.event_name == 'workflow_dispatch' && inputs.test_report_upload == 'true'))
if: always() && github.repository == 'linode/linode_api4-python' && ((github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) || (github.event_name == 'workflow_dispatch' && inputs.test_report_upload == 'true'))

Copilot uses AI. Check for mistakes.
needs: [integration-tests]
if: always() && github.repository == 'linode/linode_api4-python' # Run even if integration tests fail and only on main repository
# Run even if integration tests fail on main repository AND push event OR test_report_upload is true in case of manual run
if: always() && github.repository == 'linode/linode_api4-python' && (github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && inputs.test_report_upload == 'true'))
Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This if: condition is getting hard to read/maintain inline. Consider using a folded scalar (if: >-) to format it across multiple lines (same expression), or consolidating the event gating into a single clearly named expression to reduce future mistakes when extending supported triggers.

Suggested change
if: always() && github.repository == 'linode/linode_api4-python' && (github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && inputs.test_report_upload == 'true'))
if: >-
always() &&
github.repository == 'linode/linode_api4-python' &&
(
github.event_name == 'push' ||
(github.event_name == 'workflow_dispatch' && inputs.test_report_upload == 'true')
)

Copilot uses AI. Check for mistakes.
Comment on lines +44 to +51
test_report_upload:
description: 'Indicates whether to upload the test report to object storage. Defaults to "false"'
required: false
default: 'false'
type: choice
options:
- 'true'
- 'false'
Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For workflow_dispatch inputs, using type: boolean (instead of a string choice of 'true'/'false') simplifies the conditionals (no string comparison) and better communicates intent to callers.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improvement for improvements in existing functionality in the changelog. testing for updates to the testing suite in the changelog.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant