Fix streaming plugin specs#5854
Open
fabianrbz wants to merge 2 commits into
Open
Conversation
…le-quoted
Psych emits single-quoted YAML for condition values starting with `!`
(e.g. `'!http.path.contains("skip")'`), which collides with the outer
`echo '...'` wrapper in the rendered deck command and breaks copy-paste.
Added `requote_conditions` to the EntityExamples drop to rewrite only
`condition:` scalars from single-quoted to double-quoted YAML after
HashToYAML serialisation, leaving all other fields unaltered.
gateway in automated tests with arbitrary variables
✅ Deploy Preview for kongdeveloper ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses copy/paste breakage in rendered entity_examples output (due to Psych emitting single-quoted condition values starting with !) and extends the automated test harness to support passing arbitrary environment variables through gateway setup prereqs.
Changes:
- Requotes YAML
condition:scalars in theentity_examplesdrop to ensure shell-safe rendering. - Adds support for extracting arbitrary env vars from
data-test-setupand applying them during automated test runtime setup. - Updates the streaming custom plugins how-to to express prereq env vars as structured
name/valuepairs and annotates code blocks for the test runner.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/automated-tests/instructions/setup.js | Extracts env_variables from setup objects and returns them alongside runtime/version flags. |
| tools/automated-tests/instructions/runner.js | Adds env var flag injection into the runtime setup command prior to running instructions. |
| tools/automated-tests/config/runtimes.yaml | Introduces a dedicated setup.env_variables.command used when env vars are present. |
| app/_plugins/drops/entity_examples.rb | Rewrites single-quoted condition: YAML scalars to double-quoted for safer rendering. |
| app/_includes/prereqs/products/gateway.md | Adds env vars into the data-test-setup JSON used by automated tests. |
| app/_how-tos/gateway/stream-custom-plugins.md | Updates prereq env var shape and adds data-test-step annotations for blocks. |
| let wasm; | ||
| let env_variables = {}; | ||
| if (typeof setup === "object") { | ||
| // It should be one key/value pair, e.g. { gateway: 'x.y' } |
Comment on lines
+42
to
+47
| function appendEnvFlags(command, env_variables) { | ||
| const flags = Object.entries(env_variables) | ||
| .map(([key, value]) => (value ? `-e ${key}=${value}` : `-e ${key}`)) | ||
| .join(" "); | ||
| return `${command} ${flags}`; | ||
| } |
Comment on lines
47
to
+51
| commands: | ||
| - curl -Ls https://get.konghq.com/quickstart | bash -s -- -r "" -i $KONG_IMAGE_NAME -t $KONG_IMAGE_TAG -e KONG_LICENSE_DATA | ||
|
|
||
| env_variables: | ||
| command: curl -Ls https://get.konghq.com/quickstart | bash -s -- -r "" -i $KONG_IMAGE_NAME -t $KONG_IMAGE_TAG -e KONG_LICENSE_DATA |
| {{vanilla_snippet | liquify | indent: 3}} | ||
| {% else %} | ||
| <div data-test-setup='{ "gateway": "{{page.min_version.gateway}}" }' markdown="1"> | ||
| <div data-test-setup='{ "gateway": "{{page.min_version.gateway}}"{% for variable in include.env_variables %}{% if variable.value %}, "{{variable.name}}": "{{variable.value}}"{% else %}{% assign parts = variable.name | split: "=" %}, "{{parts[0]}}": "{{parts[1]}}"{% endif %}{% endfor %} }' markdown="1"> |
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.
Description
fix(entity_examples): requote single-quoted condition scalars as double-quoted.
Psych emits single-quoted YAML for condition values starting with
!(e.g.
'!http.path.contains("skip")'), which collides with the outerecho '...'wrapper in the rendered deck command and breaks copy-paste.fix: variables passed to gateway's prereq and add support for running
gateway in automated tests with arbitrary variables
Preview Links
Checklist
descriptionentry in frontmatter.