Skip to content

Commit d93201d

Browse files
authored
refactor(mq): replace custom drawing by neato (#9719)
This replaces the custom image by a dynamically generated one.
1 parent edcb8df commit d93201d

File tree

3 files changed

+87
-6
lines changed

3 files changed

+87
-6
lines changed

plugins/remark-graphviz.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { Module, render } from 'viz.js/full.render.js';
77

88
const viz = new Viz({ Module, render });
99

10-
const validLanguages = [`dot`, `circo`];
10+
const validLanguages = [`dot`, `circo`, `neato`];
1111

1212
export function remarkGraphvizPlugin(): unified.Plugin<[], mdast.Root> {
1313
const codeNodes = [];

src/content/docs/merge-queue/performance.mdx

Lines changed: 86 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ description: Optimizing your merge queue for maximum efficiency.
44
---
55

66
import MergeQueueCalculator from "../../../components/MergeQueueCalculator/MergeQueueCalculator"
7-
import rcvDiagram from "../../images/merge-queue/rcv-theorem.png"
8-
import {Image} from 'astro:assets';
97

108
As development teams scale and the volume of pull requests grows, achieving an
119
optimal balance between merge speed, reliability, and resource usage becomes a
@@ -30,9 +28,92 @@ Similar to the [CAP theorem](https://en.wikipedia.org/wiki/CAP_theorem) for
3028
data stores, you can only optimize two of these properties simultaneously. This
3129
is what we term the **RCV theorem**.
3230

33-
<figure style={{ maxWidth: '66%', margin: 'auto' }}>
34-
<Image src={rcvDiagram} alt="RCV theorem"/>
35-
</figure>
31+
```neato aria-label="Venn diagram showing the Reliability, Cost, Velocity trade-offs" role="img" style="max-width: 520px; margin: 2rem auto; display: block;"
32+
graph RCV {
33+
graph [bgcolor="transparent", margin=0, overlap=true];
34+
node [shape=circle, style="filled,setlinewidth(2)", fontname="Helvetica", fontsize=16, width=2.5, height=2.5, penwidth=2, fixedsize=true, pin=true];
35+
36+
Reliability [label="Reliability", color="#2563eb", fillcolor="#2563eb33", pos="0,0!", tooltip="Maximize test confidence"];
37+
Velocity [label="Velocity", color="#16a34a", fillcolor="#16a34a33", pos="2.2,0!", tooltip="Ship pull requests fast"];
38+
Cost [label="Cost", color="#ea580c", fillcolor="#ea580c33", pos="1.1,1.95!", tooltip="Keep CI usage low"];
39+
}
40+
```
41+
42+
<div
43+
role="note"
44+
aria-label="RCV legend"
45+
style={{
46+
display: 'flex',
47+
flexWrap: 'wrap',
48+
gap: '0.5rem',
49+
justifyContent: 'center',
50+
margin: '1rem auto 0.5rem',
51+
fontSize: '0.9rem',
52+
}}
53+
>
54+
<span
55+
style={{
56+
display: 'inline-flex',
57+
alignItems: 'center',
58+
gap: '0.35rem',
59+
padding: '0.35rem 0.75rem',
60+
borderRadius: '999px',
61+
border: '1px solid #93c5fd',
62+
}}
63+
>
64+
<span
65+
style={{
66+
width: '0.65rem',
67+
height: '0.65rem',
68+
borderRadius: '50%',
69+
background: 'linear-gradient(135deg,#2563eb,#16a34a)',
70+
}}
71+
></span>
72+
Reliability + Velocity → Parallel Checks
73+
</span>
74+
<span
75+
style={{
76+
display: 'inline-flex',
77+
alignItems: 'center',
78+
gap: '0.35rem',
79+
padding: '0.35rem 0.75rem',
80+
borderRadius: '999px',
81+
border: '1px solid #fca5a5',
82+
}}
83+
>
84+
<span
85+
style={{
86+
width: '0.65rem',
87+
height: '0.65rem',
88+
borderRadius: '50%',
89+
background: 'linear-gradient(135deg,#2563eb,#ea580c)',
90+
}}
91+
></span>
92+
Reliability + Cost → Sequential Validation
93+
</span>
94+
<span
95+
style={{
96+
display: 'inline-flex',
97+
alignItems: 'center',
98+
gap: '0.35rem',
99+
padding: '0.35rem 0.75rem',
100+
borderRadius: '999px',
101+
border: '1px solid #86efac',
102+
}}
103+
>
104+
<span
105+
style={{
106+
width: '0.65rem',
107+
height: '0.65rem',
108+
borderRadius: '50%',
109+
background: 'linear-gradient(135deg,#16a34a,#ea580c)',
110+
}}
111+
></span>
112+
Velocity + Cost → Batch Mode
113+
</span>
114+
</div>
115+
116+
<em>Pick any two—every setup sacrifices one dimension.</em>
36117

37118
Based on this trade-off, there are 3 scenarios that you can optimize for:
38119

-177 KB
Binary file not shown.

0 commit comments

Comments
 (0)