Repository navigation
Add PowerShell (Pwsh 7+) as a supported output language #118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
kalil0321
merged 14 commits into
kalil0321:main
from
sultanberisa:add-powershell-support
Sep 20, 2026
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
1579db1
Add PowerShell (pwsh 7+) as a supported output language
sultanberisa 6cfc8a6
Merge branch 'main' into add-powershell-support
kalil0321 4a729c5
Harden PowerShell client execution and runtime tests
kalil0321 daf733d
Require PowerShell runtime tests and CLI smoke checks in CI
kalil0321 99379e3
Add live browser-to-client generation acceptance harness
kalil0321 c8934ff
Run live OpenCode generation on Windows and Linux
kalil0321 b8bb82f
Configure live generation matrix and free-model acceptance checks
kalil0321 2d251bd
Keep live client generation local; remove slow E2E workflow
kalil0321 f343d02
Move live generation validation to an isolated local test
kalil0321 748ffb2
Add opt-in Windows generation using preinstalled Chrome
kalil0321 6d15f79
Document manual Windows generation checks
kalil0321 57b1bd6
docs: record PowerShell support and Windows validation in changelog
kalil0321 377e5f2
test: retain generated clients and raw E2E output in reports
kalil0321 6c6a0f5
test: preserve E2E evidence across Windows text encodings
kalil0321 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,6 +5,11 @@ on: | |
| branches: [main] | ||
| pull_request: | ||
| workflow_dispatch: | ||
| inputs: | ||
| live_windows: | ||
| description: 'Run only live Windows generation using preinstalled Chrome and a free model' | ||
| type: boolean | ||
| default: false | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
@@ -17,6 +22,7 @@ concurrency: | |
| # Pin action revisions so upstream tag changes cannot alter CI code. | ||
| jobs: | ||
| lint: | ||
| if: github.event_name != 'workflow_dispatch' || !inputs.live_windows | ||
| name: ruff | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
|
|
@@ -33,6 +39,7 @@ jobs: | |
| # in the logs, but it never blocks a merge. Remove `continue-on-error` once | ||
| # `uv run mypy src` is clean. | ||
| typecheck: | ||
| if: github.event_name != 'workflow_dispatch' || !inputs.live_windows | ||
| name: mypy (informational) | ||
| runs-on: ubuntu-latest | ||
| continue-on-error: true | ||
|
|
@@ -45,11 +52,15 @@ jobs: | |
| - run: uv run mypy src | ||
|
|
||
| test: | ||
| if: github.event_name != 'workflow_dispatch' || !inputs.live_windows | ||
| name: pytest (py${{ matrix.python-version }}, ${{ matrix.os }}) | ||
| timeout-minutes: 15 | ||
| runs-on: ${{ matrix.os }} | ||
| env: | ||
| # Make the matrix interpreter explicit for every uv invocation. | ||
| UV_PYTHON: ${{ matrix.python-version }} | ||
| # Exercise real PowerShell execution on every platform; do not silently skip. | ||
| RAE_REQUIRE_PWSH: "1" | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
|
|
@@ -63,4 +74,60 @@ jobs: | |
| python-version: ${{ matrix.python-version }} | ||
| # --locked: fail loudly if uv.lock is stale instead of silently re-resolving. | ||
| - run: uv sync --all-extras --locked | ||
| - name: Verify PowerShell 7+ | ||
| shell: pwsh | ||
| run: | | ||
| if ($PSVersionTable.PSVersion.Major -lt 7) { throw 'PowerShell 7+ required' } | ||
| - run: uv run reverse-api-engineer --version | ||
| - run: uv run reverse-api-engineer --help | ||
| - run: uv run pytest -q | ||
|
|
||
| live-windows: | ||
| name: Live Windows generation (Chrome already installed) | ||
| if: github.event_name == 'workflow_dispatch' && inputs.live_windows | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P2: When a live Windows dispatch runs on Prompt for AI agents |
||
| runs-on: windows-latest | ||
| timeout-minutes: 12 | ||
| env: | ||
| UV_PYTHON: '3.13' | ||
| PYTHONIOENCODING: utf-8 | ||
| PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: '1' | ||
| PLAYWRIGHT_MCP_BROWSER: chrome | ||
| RAE_OPENCODE_PACKAGE: opencode-ai@1.18.31 | ||
| steps: | ||
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 | ||
| with: | ||
| persist-credentials: false | ||
| - uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0 | ||
| with: | ||
| python-version: '3.13' | ||
| enable-cache: true | ||
| - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 | ||
| with: | ||
| node-version: '22' | ||
| - name: Locate npm cache | ||
| id: npm-cache | ||
| shell: pwsh | ||
| run: '"path=$(npm config get cache)" >> $env:GITHUB_OUTPUT' | ||
| - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 | ||
| with: | ||
| path: ${{ steps.npm-cache.outputs.path }} | ||
| key: windows-node22-opencode1.18.31-rae-mcp0.0.8-v1 | ||
| - name: Verify preinstalled Chrome and PowerShell | ||
| shell: pwsh | ||
| run: | | ||
| $chrome = Join-Path $env:ProgramFiles 'Google/Chrome/Application/chrome.exe' | ||
| if (!(Test-Path $chrome)) { throw 'Preinstalled Chrome missing; refusing browser download' } | ||
| if ($PSVersionTable.PSVersion.Major -lt 7) { throw 'PowerShell 7+ required' } | ||
| "PLAYWRIGHT_MCP_EXECUTABLE_PATH=$chrome" >> $env:GITHUB_ENV | ||
| (Get-Item $chrome).VersionInfo.ProductVersion | ||
| - run: uv sync --locked --no-dev | ||
| - name: Warm OpenCode package cache | ||
| run: npx --yes opencode-ai@1.18.31 --version | ||
| - name: Generate and execute PowerShell and Python clients | ||
| shell: pwsh | ||
| run: | | ||
| foreach ($language in @('powershell', 'python')) { | ||
| uv run --no-sync python scripts/validation/generation_e2e.py --language $language --artifacts-dir "$env:RUNNER_TEMP/rae-$language" | ||
| if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } | ||
| Get-Content "$env:RUNNER_TEMP/rae-$language/result.json" >> $env:GITHUB_STEP_SUMMARY | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| # Local live generation check | ||
|
|
||
| Run this manually with the Python environment containing the RAE package you | ||
| want to validate. Node.js/npm and a supported Playwright browser are required; | ||
| PowerShell 7+ is required for the PowerShell case. | ||
|
|
||
| ```sh | ||
| python scripts/validation/generation_e2e.py --language python | ||
| python scripts/validation/generation_e2e.py --language powershell | ||
| ``` | ||
|
|
||
| The script starts a local website, asks OpenCode to capture its API and generate | ||
| a client, then runs that client through `reverse-api-engineer run`. It changes | ||
| the server response after generation and checks both the returned data and a new | ||
| HTTP request, so cached or hardcoded answers cannot pass. | ||
|
|
||
| Only `opencode/big-pickle` is allowed. Its advertised input/output prices must | ||
| both be zero; otherwise the check fails without selecting another model. Free | ||
| model availability and network access can still affect this optional test. | ||
|
|
||
| RAE configuration is redirected inside the test process and CLI subprocesses; | ||
| OpenCode uses separate XDG directories and the browser uses an isolated profile. | ||
| No existing user configuration is overwritten. The interpreter must be the one | ||
| from the installation under test (for example `/path/to/venv/bin/python`). | ||
|
|
||
| Logs, HAR capture, generated clients and OpenCode state are retained in the | ||
| printed temporary directory. Pass `--artifacts-dir /path/to/new-directory` to | ||
| choose a location; an existing directory is rejected. The local fixture server | ||
| stops when the test ends, so retained clients need a new matching server before | ||
| they can be replayed again. | ||
|
|
||
| To run on Windows in GitHub Actions, open **CI → Run workflow** and enable | ||
| **live_windows**. This starts one Windows job, running PowerShell then Python, | ||
| with preinstalled Chrome. It does not download browsers or install Windows media | ||
| components. Python and npm dependencies are cached; the first run can be slower. | ||
| The result for each language is included in the run summary. This uses the same | ||
| free-model checks and fresh-response validation as the local command. | ||
|
|
||
| Ordinary pushes and PRs only run the deterministic unit, CLI startup and real | ||
| PowerShell execution checks across all three OSes. The live test is manual only. |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P3: The new
--versionand--helpsmoke steps duplicate coverage thattests/test_cli_no_httpx.pyalready provides in a stronger form: that test parametrizes both flags and runs them in a subprocess with a fresh interpreter (python -I) plus legacy-HTTP-import blocking on every matrix entry. The only coverage the smoke steps add is theuv-generated console-script wrapper, which is low-risk. Consider dropping these two steps, or keeping a single one (--version) if you want an entry-point smoke test, to avoid paying ~9 extrauv runinvocations per PR for near-zero added coverage.Prompt for AI agents