Skip to content
Open
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
10 changes: 9 additions & 1 deletion .github/workflows/e2e-test-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ on:
pull_request_number:
description: 'The number of the PR.'
required: false
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'

name: PR E2E Tests

Expand Down Expand Up @@ -101,7 +109,7 @@ jobs:
LINODE_TOKEN: ${{ secrets.LINODE_TOKEN }}

- 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.
run: |
filename=$(ls | grep -E '^[0-9]{12}_sdk_test_report\.xml$')
python3 e2e_scripts/tod_scripts/xml_to_obj_storage/scripts/add_gha_info_to_xml.py \
Expand Down
13 changes: 11 additions & 2 deletions .github/workflows/e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,14 @@ on:
options:
- 'true'
- 'false'
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'
Comment on lines +44 to +51
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.
push:
branches:
- main
Expand Down Expand Up @@ -172,7 +180,8 @@ jobs:
process-upload-report:
runs-on: ubuntu-latest
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.
outputs:
summary: ${{ steps.set-test-summary.outputs.summary }}

Expand Down Expand Up @@ -271,4 +280,4 @@ jobs:
payload: |
channel: ${{ secrets.SLACK_CHANNEL_ID }}
thread_ts: "${{ steps.main_message.outputs.ts }}"
text: "${{ needs.process-upload-report.outputs.summary }}"
text: "${{ needs.process-upload-report.outputs.summary }}"