Skip to content

Fix streaming plugin specs#5854

Open
fabianrbz wants to merge 2 commits into
mainfrom
fix-straming-plugin-specs
Open

Fix streaming plugin specs#5854
fabianrbz wants to merge 2 commits into
mainfrom
fix-straming-plugin-specs

Conversation

@fabianrbz

Copy link
Copy Markdown
Contributor

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 outer
echo '...' 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

  • Tested how-to docs. If not, note why here.
  • All pages contain metadata.
  • Any new docs link to existing docs.
  • All autogenerated instructions render correctly (API, decK, Konnect, Kong Manager).
  • Style guide (capitalized gateway entities, placeholder URLs) implemented correctly.
  • Every page has a description entry in frontmatter.
  • Add new pages to the product documentation index (if applicable).

fabianrbz added 2 commits July 6, 2026 15:05
…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
@fabianrbz fabianrbz requested a review from a team as a code owner July 7, 2026 11:56
Copilot AI review requested due to automatic review settings July 7, 2026 11:56
@netlify

netlify Bot commented Jul 7, 2026

Copy link
Copy Markdown

Deploy Preview for kongdeveloper ready!

Name Link
🔨 Latest commit 2613053
🔍 Latest deploy log https://app.netlify.com/projects/kongdeveloper/deploys/6a4ce985a1425a0008a2ac70
😎 Deploy Preview https://deploy-preview-5854--kongdeveloper.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 the entity_examples drop to ensure shell-safe rendering.
  • Adds support for extracting arbitrary env vars from data-test-setup and applying them during automated test runtime setup.
  • Updates the streaming custom plugins how-to to express prereq env vars as structured name/value pairs 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">
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.

2 participants