ek9_check_package_dependency_cycles

Answers with hasCycles, cycleCount and the cycles (closed package paths with their edges) across every package declared in the workspace, plus packagesAnalysed and sccCount.

Category: Enquiry · Compare: Package Dependency Cycle Detector

When to use it

'Do any packages in this workspace depend on each other in a loop' is one call with no arguments. The pre-release check: a cross-package cycle makes versioning incoherent and blocks independent release.

When not to use it

Details

Needs a compiled workspace: status:'not-compiled' with nextStep otherwise. Only edges whose target package is also in the workspace are walked (scope: 'workspace-wide'). cycles[].modules uses the closed-path convention - the first package is repeated at the end (['A','B','A'] means A->B->A), so edgeCount, not the array length, is the true edge count; cycles[].edges attribute each hop (from/to are package names, via the from-package's source files). sccCount deduplicates cycles by package set (one per strongly connected component) and is > 0 iff hasCycles.

Arguments

None of its own.

Recorded calls

Real calls, recorded against small projects and checked on every build - a changed answer fails it.

Clean shape

Request

{ }

Response

{
  "cycleCount" : 0,
  "cycles" : [ ],
  "hasCycles" : false,
  "meta" : {
    "serverMs" : "<timing>"
  },
  "packagesAnalysed" : 1,
  "sccCount" : 0,
  "scope" : "workspace-wide",
  "status" : "ok",
  "summary" : "no package cycles across 1 package(s)"
}

Cycle shape

Request

{ }

Response

{
  "cycleCount" : 1,
  "cycles" : [ {
    "description" : "pkgcycle.alpha → pkgcycle.beta → pkgcycle.alpha",
    "edgeCount" : 2,
    "edges" : [ {
      "from" : "pkgcycle.alpha",
      "to" : "pkgcycle.beta",
      "via" : [ "pkgcycle/alpha.ek9" ]
    }, {
      "from" : "pkgcycle.beta",
      "to" : "pkgcycle.alpha",
      "via" : [ "pkgcycle/beta.ek9" ]
    } ],
    "modules" : [ "pkgcycle.alpha", "pkgcycle.beta", "pkgcycle.alpha" ]
  } ],
  "hasCycles" : true,
  "meta" : {
    "serverMs" : "<timing>"
  },
  "packagesAnalysed" : 2,
  "sccCount" : 1,
  "scope" : "workspace-wide",
  "status" : "ok",
...

Cut short here: 2 more lines. The whole recorded call.

See also