Skip to content

docs(gateway): document the plugin_ordering_algorithm option - #5936

Open
findns94 wants to merge 9 commits into
mainfrom
walker.zhao/FTI-7177
Open

docs(gateway): document the plugin_ordering_algorithm option#5936
findns94 wants to merge 9 commits into
mainfrom
walker.zhao/FTI-7177

Conversation

@findns94

@findns94 findns94 commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Description

Add standalone explainers for both dynamic plugin ordering algorithms and document the new
plugin_ordering_algorithm option that selects which one runs.

  • app/gateway/plugins/plugin-ordering-legacy.md (new): the legacy algorithm on its own terms
    -- its real DFS post-order mechanism (a plugin's whole dependency chain is placed immediately
    before it, however far the chain reaches), a hand-worked trace, why before and after build
    the identical dependency edge under this algorithm, and its pros, cons, and corner cases.
  • app/gateway/plugins/plugin-ordering-priority-preserving.md (new, replaces
    plugin-ordering.md): the principle behind priority_preserving ("at each step, run the
    highest-priority plugin whose after requirements are already met"), a hand-worked
    step-by-step example so readers can predict the exact order, a priority_preserving-vs-legacy
    comparison on the identical configuration (the FTI-7177 displacement and the before !=
    after asymmetry, with concrete sorted results attributed to whichever algorithm produced
    them), the guarantees and non-guarantees (including the non-optimal-placement case and its
    fix), how request scope changes the result, and how to adopt priority_preserving on upgrade.
  • app/_gateway_entities/plugin.md: point the "Dynamic plugin ordering" reference callout and
    the plugin_ordering_algorithm known-limitations bullet at both new pages instead of the one
    merged page.
  • app/_indices/gateway.yaml: replace the single "How Gateway Works" navigation entry with one
    per page.
  • app/_redirects: redirect the old /gateway/plugins/plugin-ordering/ URL to the
    priority_preserving page.
  • .github/styles/base/Dictionary.txt: add priority_preserving so Vale's spelling check
    accepts it outside of code spans (frontmatter descriptions, table keys) -- same convention as
    the other snake_case config values already in that file.

Fixes FTI-7177

Preview Links

https://deploy-preview-5936--kongdeveloper.netlify.app/gateway/plugins/plugin-ordering-priority-preserving/
https://deploy-preview-5936--kongdeveloper.netlify.app/gateway/plugins/plugin-ordering-legacy/
https://deploy-preview-5936--kongdeveloper.netlify.app/gateway/entities/plugin/#dynamic-plugin-ordering

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).

@findns94 findns94 self-assigned this Jul 14, 2026
@findns94
findns94 requested a review from a team as a code owner July 14, 2026 10:03
Copilot AI review requested due to automatic review settings July 14, 2026 10:03
@netlify

netlify Bot commented Jul 14, 2026

Copy link
Copy Markdown

Deploy Preview for kongdeveloper ready!

Name Link
🔨 Latest commit 31ffc0f
🔍 Latest deploy log https://app.netlify.com/projects/kongdeveloper/deploys/6a854a8ad8d84e000811ad60
😎 Deploy Preview https://deploy-preview-5936--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

Adds a new Gateway reference page explaining how dynamic plugin ordering is computed (including a worked example and a new vs legacy comparison) and wires it into the existing Plugin entity docs and Gateway index navigation.

Changes:

  • Adds a standalone explainer page for dynamic plugin ordering behavior and upgrade guidance.
  • Updates the Plugin entity reference to link out to the explainer and mentions plugin_ordering_algorithm.
  • Adds the new page to the Gateway “How Gateway Works” index section.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
app/gateway/plugins/plugin-ordering.md New reference page describing the ordering rule/algorithm behavior, examples, and limitations.
app/_gateway_entities/plugin.md Links to the new explainer from the Dynamic plugin ordering section and mentions algorithm selection.
app/_indices/gateway.yaml Adds the new page to the Gateway documentation index/navigation.

Comment thread app/gateway/plugins/plugin-ordering.md Outdated
Comment thread app/gateway/plugins/plugin-ordering.md Outdated
Comment thread app/gateway/plugins/plugin-ordering.md Outdated
Comment thread app/gateway/plugins/plugin-ordering.md Outdated
Comment thread app/_gateway_entities/plugin.md Outdated
@findns94
findns94 marked this pull request as draft July 14, 2026 10:53
@lena-larionova lena-larionova added this to the Gateway 3.16 milestone Jul 14, 2026
findns94 and others added 7 commits August 19, 2026 09:17
…g_algorithm option

Add a standalone explainer for dynamic plugin ordering and document the new
`plugin_ordering_algorithm` option that selects which ordering algorithm runs.

  * app/gateway/plugins/plugin-ordering.md (new): the principle behind dynamic
    ordering ("at each step, run the highest-priority plugin whose `after`
    requirements are already met"), a hand-worked step-by-step example so readers can
    predict the exact order, a new-vs-legacy comparison (including the FTI-7177
    displacement and the `before` != `after` asymmetry, with concrete sorted results),
    the guarantees and non-guarantees, how request scope changes the result, and how
    to adopt `new` on upgrade.
  * app/_gateway_entities/plugin.md: trim the "Dynamic plugin ordering" reference
    section to link to the new explainer, and note the `plugin_ordering_algorithm`
    option under known limitations.
  * app/_indices/gateway.yaml: add the new page to the "How Gateway Works" navigation.

FTI-7177

Signed-off-by: Walker Zhao <walker.zhao@konghq.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
works_on:
  - on-prem
  - konnect

Signed-off-by: Walker Zhao <walker.zhao@konghq.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@findns94
findns94 force-pushed the walker.zhao/FTI-7177 branch 2 times, most recently from 751cc22 to 4fb064f Compare August 19, 2026 02:06
@findns94
findns94 requested a lite review from Copilot August 19, 2026 02:17

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

The doc was written against an early build and still called the algorithm
"new" -- the shipped option is `legacy` / `priority_preserving`
(kong.conf.default). Rename throughout, replace the placeholder A/B/C and
e/d/c/b/a examples with real kong-ee plugins and priorities, and add a
worked example (with the fix) for the one documented hard limitation: an
unconfigured plugin can occasionally move further than a hand-picked order
would need, in roughly one configuration in twenty that uses `ordering`.

Also fixes a real accuracy bug carried by the old examples: an unconfigured
plugin's absolute slot can shift when a mover passes through it, even
though its order relative to other unconfigured plugins does not -- the
old text claimed it "stays put" / "keeps its place," which wasn't true for
the abstract example's `c`.

Adds a short section on plugins that share a priority (routine for cloned
plugins that don't override it) and bumps min_version to 3.16, matching
the changelog entries this doc describes.

Signed-off-by: Walker Zhao <walker.zhao@konghq.com>
@findns94
findns94 force-pushed the walker.zhao/FTI-7177 branch from 4fb064f to 9e0b26f Compare August 19, 2026 03:50
@findns94
findns94 marked this pull request as ready for review August 19, 2026 03:52
…ing pages

One merged page made it hard to say which algorithm produced which
behavior. Split it into plugin-ordering-legacy.md and
plugin-ordering-priority-preserving.md, each self-contained, and redirect
the old URL to the priority_preserving page.

The legacy page documents its real mechanism for the first time: a DFS
post-order topological sort driven by a priority-ordered outer loop, where
before/after build the identical dependency edge and a plugin's whole
dependency chain gets appended ahead of everything else the moment the
walk reaches it. Verified against the real module (topsort_plugins.lua +
plugin_dependency.lua), including that its unguarded recursion does NOT
overflow the stack at realistic -- or even 500,000-plugin -- chain
lengths, so that is not listed as a limitation.

The priority_preserving page keeps last round's content, reorganized so
every comparison names which algorithm produced which result, with the
legacy contrast moved up next to the worked example instead of appearing
several sections later.

Updates the two cross-links in plugin.md, the one nav entry in
_indices/gateway.yaml, and adds a redirect for the retired URL.

Signed-off-by: Walker Zhao <walker.zhao@konghq.com>
@findns94 findns94 changed the title docs(gateway): explain dynamic plugin ordering and the plugin_ordering_algorithm option docs(gateway): document the plugin_ordering_algorithm option Aug 19, 2026
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.

3 participants