version_rule_helpers.go ×7

Frontier kind: Code frontier

unlabeled · c_e0ab1ed0643e

12 tests · 2655 LOC · 135 files · introduces 0 tests · 27 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
7 ranges27 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
398 ranges2655 lines · 135 files · Browse complete extent
All tests (intent)
12 testsBrowse complete intent

Neighbourhood graph

The orange circle is the focus. Violet and green circles are every ancestor and descendant, broader and narrower, at any distance; blue squares and pink diamonds are the introduced files and exact introduced tests of every visible concept, not only the focus's. Arrows point from broader to narrower concepts and bridge only concepts omitted from this view. Undirected links show source or test introduction. Concept and file size follows LOC; exact test nodes use test-count units.

Introduced files, introduced tests, and structurally relevant concept specialization

In the embedded map, ordinary wheel input scrolls the page; use the visible controls to zoom and drag to pan. Open the full-screen map for canvas navigation: wheel pans, Ctrl/Command plus wheel zooms, and arrow keys pan when this region is focused. On touch screens, open the full-screen map to pan or pinch. If JavaScript or WebGL is unavailable, use the native relationship evidence on this page.

Graph controls are ready.

Interactive rendering requires JavaScript and WebGL. Use the native relationship evidence on this page while the interactive map is unavailable.

Native relationship evidence

Every exact file and test below is linked only from the concept that introduces it.

Introduced tests

Every collected test enters the hierarchy at exactly one concept.

No tests are introduced at this concept. Its intent tests are introduced by other concepts.

Introduced code

Every collected source range enters the hierarchy at exactly one concept.

1 file ranked by introduced lines: 27 introduced LOC across 7 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/service/matching/version_rule_helpers.go 27 introduced LOC · 7 ranges

Open complete file

489
490 // isCyclic returns true if there is a cycle in the DAG of redirect rules.
491 > func isCyclic(rules []*persistencespb.RedirectRule) bool { version_rule_helpers.go
492 > makeEdgeMap := func(rules []*persistencespb.RedirectRule) map[string][]string {
493 > ret := make(map[string][]string)
494 > for _, rule := range rules {
495 > src := rule.GetRule().GetSourceBuildId()
496 > dst := rule.GetRule().GetTargetBuildId()
497 > list, ok := ret[src]
498 > if !ok {
499 > list = make([]string, 0)
500 > }
501 > list = append(list, dst)
502 > ret[src] = list
503 }
504 > return ret version_rule_helpers.go
505 }
506
507 > dag := makeEdgeMap(rules) version_rule_helpers.go
508 > visited := make(map[string]bool)
509 > for node := range dag {
510 > inStack := make(map[string]bool)
511 > if dfs(node, visited, inStack, dag) {
512 return true
513 }
516 }
517
518 > func dfs(curr string, visited, inStack map[string]bool, nodes map[string][]string) bool { version_rule_helpers.go
519 > if inStack[curr] {
520 return true
521 }
522 > if visited[curr] { version_rule_helpers.go
523 return false
524 }
525 > visited[curr] = true version_rule_helpers.go
526 > inStack[curr] = true
527 > for _, dst := range nodes[curr] {
528 > if dfs(dst, visited, inStack, nodes) {
529 return true
530 }
531 }
532 > inStack[curr] = false version_rule_helpers.go
533 > return false
534 }
535