dmsolr opened a new pull request, #8008:
URL: https://github.com/apache/shenyu/pull/8008

   ## What this PR does
   
   Implements the graph DTO model plus the validation and compilation core for 
the optional DAG plugin orchestration contract defined in #7994. This is a pure 
`shenyu-common` addition with no new dependencies and no runtime wiring yet 
(ShenyuPlugin binding is #7996).
   
   **New DTOs** (`org.apache.shenyu.common.dto` / `.enums`):
   - `GraphData` — graph header + node list (schemaVersion, namespaceId, 
deploymentBinding, graphId, revision, contentHash, entryNodeId, nodes)
   - `GraphNodeData` — a single node (nodeId, type, pluginName, next, 
conditions, defaultTarget, required)
   - `GraphBranchData` — a CHOICE branch (conditions, matchMode, target)
   - `GraphNodeTypeEnum` — `PLUGIN` / `CHOICE` / `END`
   
   **New graph package** (`org.apache.shenyu.common.graph`):
   - `GraphLimits` — structural limits (nodes, out-degree, conditions per 
branch, path length, fork depth, retained revisions, graphs per namespace)
   - `GraphValidationException` — fail-closed exception carrying the full 
violation list
   - `GraphPlan` — immutable compilation artifact (`nodesById` + `successors`, 
all unmodifiable)
   - `GraphTopology` — shared successor/type helpers (null-safe)
   - `GraphValidator` — cycle / reachability / reference integrity / CHOICE 
determinism / limits / missing-plugin (fail closed) / 
duplicate-plugin-on-a-path checks, returning a deduplicated violation list
   - `GraphCompiler` — `validateOrThrow` then builds the immutable `GraphPlan`
   - `LegacyChainImporter` — imports a linear plugin chain into an equivalent 
graph (marks global + auth plugins as required), with a stable content hash
   
   ## Related Issue
   
   Fixes #7995
   Refs #7993
   
   ## Stacked PR
   
   This PR is **stacked on #8007** (the #7994 contract branch 
`docs/plugin-graph-contract`). The compiler/validator match that contract 
exactly.
   
   **Merge order: #8007 first, then this PR.** The diff below contains only the 
19 `shenyu-common` files; the #7994 docs are not duplicated here.
   
   ## Type of change
   
   - [x] New feature / enhancement
   
   ## How was this tested
   
   - [x] Unit tests added: 56 tests (JUnit5 + Hamcrest) covering cycle / branch 
determinism / scope / path enumeration / limits / immutability / import / 
invalid-input cases
   - [x] `./mvnw -pl shenyu-common test` passed (56 tests, 0 failures)
   - [x] `./mvnw checkstyle:check -pl shenyu-common` passed (0 violations, 
including test sources)
   - [x] `./mvnw -pl shenyu-common validate` passed (Apache RAT)
   
   ## Checklist
   
   - [x] Apache 2.0 license header added to new source files
   - [x] No breaking changes to public API / config / DB schema
   - [x] Pure addition in `shenyu-common`; no new dependencies
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to