You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs(config): update docs for CI rules and ADS architecture (#118)
- CLAUDE.md: replace ADS-over-MQTT with direct ADS references,
add CI Checks section with gotchas (pull_request_target,
header/body limits, npm cache, PR title re-trigger)
- CONTRIBUTING.md: add ci scope, document hard CI rules
(header 72, body 100, subject-case disabled), add CI
Checks section
- GIT_WORKFLOW.md: add ci scope, fix body wrap limit
(100 not 72), remove lowercase subject rule, add PR
title validation note and CLA check step
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
-`src/FlowForge.sln` — Root solution including all .NET projects
25
25
26
26
**Key architectural decisions:**
27
+
-**Direct ADS communication**: Monitor Server uses `Beckhoff.TwinCAT.Ads` + `TcpRouter` (Linux/Docker); Build Server uses `Beckhoff.TwinCAT.Ads` natively (Windows). MQTT is for FlowForge internal messaging only (build notifications, deploy status), NOT for ADS relay. See `doc/ADS_INTEGRATION.md`.
27
28
-**Keycloak as auth layer**: all authentication/authorization via Keycloak (local users, LDAP federation, external SSO — all Keycloak config). Backend only validates JWT from Keycloak. User management via FlowForge admin UI (facade over Keycloak Admin REST API).
28
29
-**Git repo as single source of truth** on GitHub — each project is a repo containing flow JSON (user-edited) and generated PLC solution (build server output); users commit/push with their own identity; service user handles repo creation only
29
30
-**Git-backed workflow**: backend handles git operations for open (fetch) and save (commit/push); build server clones repo, generates TwinCAT solution, commits/pushes back; PostgreSQL stores only metadata, auth, target registry, audit
30
31
-**Machine type templates** for new projects (e.g., 3-axis standalone, 3+1 axis standalone, x-division rotary table)
31
-
-**Build and Deploy are separate operations with permission hierarchy**: Deploy permission implies Build permission. Deploy button triggers Build + Deploy sequentially; Build button triggers Build only. Build generates PLC solution and commits to repo; Deploy activates on target PLC via ADS over MQTT — both executed by the build server (requires TwinCAT Engineering). Backend orchestrates, build server executes. Deploy lock and 4-eyes principle for production.
32
+
-**Build and Deploy are separate operations with permission hierarchy**: Deploy permission implies Build permission. Deploy button triggers Build + Deploy sequentially; Build button triggers Build only. Build generates PLC solution and commits to repo; Deploy activates on target PLC via direct ADS — both executed by the build server (requires TwinCAT Engineering). Backend orchestrates, build server executes. Deploy lock and 4-eyes principle for production.
32
33
-**Build queue**: PostgreSQL-based queue with MQTT notify; backend inserts jobs, build servers poll via REST with `FOR UPDATE SKIP LOCKED`; MQTT is lightweight wake-up signal only
33
34
-**Build servers are version-specific** (one per TwinCAT version on separate Windows Servers); target runtime readable via ADS enables automatic build server selection
34
-
-**PLC activation via ADS over MQTT** through a central MQTT broker (free, no per-server ADS route config needed)
35
35
-**Deploy safety**: target labeling/grouping, deploy protection for production targets (4-eyes principle), deploy lock on running PLCs, full audit trail via git history
36
36
-**Infrastructure**: Single Docker Compose stack (frontend/nginx, backend, Keycloak, PostgreSQL, MQTT broker, Traefik, docker-socket-proxy). Monitor containers created on-demand via docker-socket-proxy, auto-discovered by Traefik via Docker labels. Build server external on Windows Server (TwinCAT Engineering requirement), connects via REST + MQTT.
37
37
@@ -69,26 +69,73 @@ cd src/frontend && npm run dev
69
69
70
70
## Commit Conventions
71
71
72
-
Commits are validated by commitlint via husky git hook. **All commits must follow Conventional Commits format:**
72
+
Commits are validated by commitlint via husky git hook **and** by GitHub Actions CI on PRs. Both commit messages AND PR titles must pass validation.
73
+
74
+
**All commits must follow Conventional Commits format:**
-`body-max-line-length`: **100 characters max** per line in commit body
91
+
-`subject-empty`: subject must not be empty
92
+
-`subject-full-stop`: no trailing period
93
+
-`body-leading-blank`: blank line between header and body
94
+
-`footer-leading-blank`: blank line before footer
95
+
-`subject-case`: **disabled** (acronyms like DTO, MQTT, TwinCAT are common)
96
+
97
+
**PR titles** are also validated against the same rules. Keep PR titles under 72 characters.
81
98
82
-
Rules: imperative mood, lowercase subject, no trailing period, max 72 chars. Use `!` after type/scope for breaking changes.
99
+
Use `!` after type/scope for breaking changes. Use imperative mood, no trailing period.
100
+
101
+
## CI Checks
102
+
103
+
Every PR runs two GitHub Actions checks:
104
+
105
+
1.**Validate Commit Messages** (`commitlint.yml`): validates all PR commits AND the PR title against `.commitlintrc.json` rules. Triggered on `opened`, `synchronize`, `reopened` events.
106
+
2.**CLA Assistant** (`cla.yml`): checks Contributor License Agreement signature. Uses `pull_request_target` (reads workflow from `main` branch). Signatures stored on `cla-signatures` branch. Org members in allowlist skip signing.
107
+
108
+
**Important CI notes:**
109
+
- CLA workflow reads from `main` branch (`pull_request_target` event) — changes to `cla.yml` must be merged to `main` first (via hotfix) to take effect
110
+
- Commitlint workflow reads `.commitlintrc.json` from the PR branch — rule changes take effect after rebase on `develop`
111
+
- PR title changes do NOT trigger CI re-runs (no `edited` event) — push a commit to trigger `synchronize`
112
+
-`package-lock.json` is in `.gitignore` — do NOT use `cache: 'npm'` in GitHub Actions setup-node steps
83
113
84
114
## Git Workflow
85
115
86
116
Uses **GitFlow** branching model:
87
-
-`main` — production releases (tagged with semver)
88
-
-`develop` — integration branch
117
+
-`main` — production releases (tagged with semver), protected branch
118
+
-`develop` — integration branch, protected branch
89
119
-`feature/*` — new features (from/to `develop`)
90
120
-`bugfix/*` — bug fixes (from/to `develop`)
91
121
-`release/*` — release prep (from `develop`, merge to both `main` and `develop`)
92
122
-`hotfix/*` — emergency fixes (from `main`, merge to both `main` and `develop`)
123
+
-`cla-signatures` — CLA signature storage (unprotected, used by CLA bot)
93
124
94
125
PRs target `develop` for features/bugfixes. Squash-merge for feature branches, merge commit for release/hotfix branches.
126
+
127
+
**Release process:**
128
+
1. Create `release/x.y.z` from `develop`
129
+
2. Update `CHANGELOG.md` (move Unreleased to new version section)
130
+
3. Commit, push, create PR to `main`
131
+
4. Merge to `main` with merge commit (not squash)
132
+
5. Tag `main` with `vx.y.z`
133
+
6. Merge `main` back to `develop`
134
+
7. Delete release branch (local + remote)
135
+
136
+
**Hotfix process** (for CI/workflow fixes that need to be on `main` immediately):
137
+
1. Create `hotfix/*` from `main`
138
+
2. Fix, commit, push, create PR to `main`
139
+
3. Merge to `main` with merge commit
140
+
4. Cherry-pick to `develop` (or merge `main` into `develop`)
0 commit comments