Skip to content

Conversation

@ghost
Copy link

@ghost ghost commented Nov 19, 2025

Updated the script to safely parse the testing SDK branch from the PR body, handling case insensitivity and whitespace.

The goal here is to fix the usage of backticks such as in foo, and contractions that we've been using such as we've

plus of course the usage of multiple backticks to include code

TESTING_SDK_BRANCH = main

fixes: #118

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@ghost ghost requested review from wangyb-A and yaythomas as code owners November 19, 2025 16:00
@leandrodamascena leandrodamascena changed the title Enhance branch parsing in integration tests workflow chore: enhance branch parsing in integration tests workflow Nov 19, 2025
yaythomas
yaythomas previously approved these changes Nov 19, 2025
' \
| head -n1 \
| tr -d "\r"
)
Copy link
Member

Choose a reason for hiding this comment

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

suggestion: make/use a python script rather than bash :-)

Copy link
Author

Choose a reason for hiding this comment

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

You are funny :D

print(f"Using testing SDK branch: {ref}")
PYTHON
env:
PR_BODY: ${{ github.event.pull_request.body }}
Copy link
Member

Choose a reason for hiding this comment

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

this could live as a script in the ops/ dir - easier to test there :-)

@ghost ghost force-pushed the integ-test-parse-fix branch from 0d00570 to e31155c Compare November 19, 2025 16:45
Comment on lines +16 to +21
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0

- name: Run parser tests
run: python ops/__tests__/test_parse_sdk_branch.py

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium test

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}

Copilot Autofix

AI about 1 month ago

To fix this problem, add a permissions key to your workflow file, restricting the GITHUB_TOKEN privileges. Place this key either at the root, affecting all jobs, or under the relevant job. In this case, since only one job exists, it's simplest and clearest to place it at the workflow root (right after the name: and before on:), specifying minimal permissions. A starting point is contents: read, which covers checking out code. If your workflow or job needs additional permissions, you can add them as needed. For this workflow, which just checks out code and runs a Python test file, this minimal set appears sufficient. Add:

permissions:
  contents: read

right after the name: field and before on:.


Suggested changeset 1
.github/workflows/test-parser.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/test-parser.yml b/.github/workflows/test-parser.yml
--- a/.github/workflows/test-parser.yml
+++ b/.github/workflows/test-parser.yml
@@ -1,4 +1,6 @@
 name: Test Parser
+permissions:
+  contents: read
 
 on:
   pull_request:
EOF
@@ -1,4 +1,6 @@
name: Test Parser
permissions:
contents: read

on:
pull_request:
Copilot is powered by AI and may make mistakes. Always verify output.
@ghost ghost marked this pull request as draft November 19, 2025 16:48
@ghost ghost changed the title chore: enhance branch parsing in integration tests workflow ci(sdk): enhance branch parsing in integration tests workflow Nov 19, 2025
@ghost ghost closed this Nov 19, 2025
@ghost ghost reopened this Nov 19, 2025
@ghost ghost changed the title ci(sdk): enhance branch parsing in integration tests workflow ci(sdk): fix branch parsing for integ framework Nov 19, 2025
@ghost ghost closed this Nov 19, 2025
@ghost ghost reopened this Nov 19, 2025
@ghost ghost marked this pull request as ready for review November 19, 2025 16:57
@yaythomas yaythomas merged commit 9084f7f into main Nov 19, 2025
9 of 10 checks passed
@ghost ghost deleted the integ-test-parse-fix branch November 19, 2025 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Parsing in end to end testing

3 participants