fix(ci): make smoke-test matrix valid (matrix context not allowed in job-level if)#42
Closed
sdserranog wants to merge 4 commits into
Closed
fix(ci): make smoke-test matrix valid (matrix context not allowed in job-level if)#42sdserranog wants to merge 4 commits into
sdserranog wants to merge 4 commits into
Conversation
The `matrix` context is not available in a job-level `if:`, so the previous condition (`matrix.template == 'ai-sdk' && ...`) made the whole workflow invalid. Emit a JSON template list from the changes job and build the matrix via fromJSON, guarding on a non-empty list. Preserves the per-template gating: core change tests all templates, otherwise only the changed ones.
setup-node cache:npm and npm ci both require a package-lock.json, which this bun-based repo doesn't have — CI failed with 'Dependencies lock file is not found'. Install with bun (matching release.yml), and make setup-bun unconditional in smoke-test so the langchain leg can install root deps to run the built CLI.
- Format langchain template with ruff (main.py, routes/arcade.py, routes/plan.py) so 'ruff format --check' passes. - Feed doctor dummy CI env (gateway + LLM key) so its success path runs; it otherwise exits 1 on an unconfigured scaffold. No template changes.
The langchain smoke leg ran 'python -m app.doctor' without installing the scaffolded project's requirements, so it failed on 'ModuleNotFoundError: httpx'. Install requirements.txt after scaffolding.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
CI fails to even start with an invalid-workflow error:
The
smoke-test-templatesjob usedmatrix.templateinside its job-levelif:. Thematrixcontext is not available there (only instrategy,name,env,runs-on, and step-levelif:), so the whole workflow is rejected.Fix
Compute the list of templates to test in the
changesjob and build the matrix dynamically:changesemitstemplates— a JSON array (corechange → all three; otherwise only the changed templates).smoke-test-templatesusesmatrix: template: ${{ fromJSON(needs.changes.outputs.templates) }}and gates onif: needs.changes.outputs.templates != '[]'(also avoids an empty-matrix error).This preserves the exact per-template gating behavior while being valid.
Note
Pre-existing bug, unrelated to the release-workflow fix (#41) — it surfaced because merging to
maintriggered CI.