Uh oh!
There was an error while loading. Please reload this page.
make http response var capture more generic - #192
Conversation
There was a problem hiding this comment.
Pull request overview
This PR expands HTTP test response variable capture so values can be extracted either from JSON using the existing jq-path mechanism, or from arbitrary response body text using a regex capture group.
Changes:
- Added
BodyRegexto HTTP response variable definitions (bodyRegexin YAML). - Updated HTTP variable parsing to support regex-based extraction and to validate variable configuration.
- Updated variable rendering and tests to reflect the new capture mode.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| render/variables.go | Uses a shared helper to describe response-variable sources (JSON path vs body regex) in rendered variable sections. |
| render/variables_test.go | Updates expected rendered output and adds coverage for regex-based response variables in the render layer. |
| client/lessons.go | Extends the response-variable schema with BodyRegex (yaml:"bodyRegex"). |
| checks/http.go | Implements regex-based capture in parseVariables and tightens configuration validation; adjusts header-regex error handling. |
| checks/http_test.go | Adds tests for body-regex capture and for rejecting invalid/underspecified response-variable configs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
theodore-s-beers
commented
Jun 11, 2026
For the time being I want to err on the side of "don't flood the student with detail." We can always add detail back over time, if needed. |
hbeckmann
left a comment
There was a problem hiding this comment.
Looks great! Also, thanks for adding tests 🙏
Uh oh!
There was an error while loading. Please reload this page.
allow capturing values from http test responses either using the json/jq system (pre-existing), or via regex against response body text