From 0ffab682f7a7c04ba31b874fecd7417631f03ee6 Mon Sep 17 00:00:00 2001
From: StinkyLord <42116482+PhilipAbed@users.noreply.github.com>
Date: Sat, 9 Apr 2022 10:37:31 +0300
Subject: [PATCH] docs: new renovate flow graph (#14862)

---
 docs/development/assets/renovate-flow.md | 57 ++++++++++++++++++++++++
 1 file changed, 57 insertions(+)
 create mode 100644 docs/development/assets/renovate-flow.md

diff --git a/docs/development/assets/renovate-flow.md b/docs/development/assets/renovate-flow.md
new file mode 100644
index 0000000000..6955bfd235
--- /dev/null
+++ b/docs/development/assets/renovate-flow.md
@@ -0,0 +1,57 @@
+```mermaid
+flowchart TB
+    subgraph Start
+    A[lib/renovate.ts] --> B[getConfig ordered by cli->env->file->default]
+    A --> C[global initialize]
+    A --> D[init platform]
+    A --> E[set and ensure dir]
+    A --> F[init cache limit commits]
+    A --> G[init host rules]
+    A --> H[validations]
+    A --> I[auto discover repositories]
+    end
+
+    subgraph Repository
+    J[workers/repository/index.ts, for each repository]
+    J --> K[initRepo]
+    J --> L[extractDependencies]
+    J --> M[ensureOnboardingPr]
+    J --> N[updateRepository]
+    J --> O[finalize repository]
+    end
+
+    subgraph initializeRepository
+    X[initRepo]
+    X--> P[InitializeConfig]
+    X--> Q[InititalizeCaches]
+    X--> R[initApis]
+    X--> S[getRepoConfig]
+    X--> T[checkIfConfigured]
+    X--> U[applySecretsToConfig]
+    X--> V[setUserRepoConfig]
+    X--> W[detectVulnerabilityAlerts]
+    end
+
+    subgraph extractDependencies
+    Z[repository/process/index.ts]
+    Z --> AA[read dashboard body, put it into config]
+    Z --> AB[ for each config.basebranches]
+    AB --> |if exists| AC[getBaseBranch and extract all dependencies from managers]
+    AB --> |if exists| AD[getBaseBranch and lookup new dependency versions]
+    end
+
+    subgraph updateRepository
+    BA[repository/process/write.ts]
+    BA--> BB[for each update branch]
+    BB --> BC[process branch]
+    BC --> BD[do all validation]
+    BC --> BF[schedules]
+    BC --> BG[updates]
+    BC --> BH[ensurePR]
+    end
+
+    Start ---> Repository
+    K ---> initializeRepository
+    L ----> extractDependencies
+    N -----> updateRepository
+```
-- 
GitLab