HOCO B2B
Ways of working

Pull requests and reviews

What a pull request must contain, how big it may be, the CI checks that gate it in each repository, who reviews what in a team of three, how fast, and how a PR is merged and cleaned up.

The PR template

hoco ships .github/PULL_REQUEST_TEMPLATE.md. Every field is filled in or deleted on purpose:

FieldWhat to writeExample
TitleA Conventional Commit with the task id — it becomes the squash commit on devfeat(server): reseller lifecycle transitions [SRV-14]
SummaryWhat and why in two to five lines, with the requirement ids"Implements the reseller status machine of CRM-04…"
Task IDThe plan task(s)SRV-14
Related issuesCloses #n for every issue this fixesCloses #42
ChangesA bullet list a reviewer can follow file group by file group—
Screenshots / recordingsFor UI: light and dark; desktop and tablet widths for the back-office; a phone for mobile; RTL where relevant; a recording of at most 60 s for a flow—
API contract changed?No, or Yes: pnpm openapi:export run, label contract, Imad notified—
TestingTests added; how you verified it by hand (environment, test account, steps)"Staging, account commercial.admin@…, validated CMD-2026-000158"
ChecklistConventions, pnpm check-types, pnpm lint, pnpm test, translations fr / ar / en, docs updated, no secrets—

hoco-mobile uses the same template (MOB-01), with API contract changed? replaced by Contract version used (the pinned hoco-v1.json version) and screenshots taken on a real device.

Labels on PRs (both repositories where they apply):

LabelMeaningEffect
contractChanges packages/contractsImad's approval required; changelog entry required
mobile-impactChanges the behaviour of an operation the apps call, without touching the contract (status codes, validation, idempotency, sync semantics)Imad's approval required
uiImplements or changes a screenAkram's design review
migrationContains a Prisma (or drift) migrationReviewer reads the SQL; release notes mention it
securityAuth, permissions, scopes, payments and credit, file access, secrets handlingSecurity checklist; walkthrough at the Wednesday sync
release / hotfixRelease or hotfix PRsRepository owner only

Size limits

  • Target 400 changed lines, hard limit 800, not counting generated files (the OpenAPI document, hoco_api, lockfiles, Prisma-generated SQL, build_runner outputs, snapshots).
  • One task per PR. A task may take several PRs; a PR never mixes two tasks' features.
  • Over the limit: split it (contract → schema → endpoints → screens), or explain in the Summary why it cannot be split (a mechanical rename, a generated scaffold) and get the reviewer's agreement before the review starts.
  • Open draft PRs early for contract and migration changes: the reviewer sees the shape before the code exists.

Required checks

A PR merges only with every required check green. A red check is never merged "because it is flaky": the test is fixed, or quarantined in the same PR with an issue number.

hoco (.github/workflows/ci.yml, extended in OPS-02):

CheckRunsSince
Lint · Types · Contracts · Buildbiome ci ., pnpm check-types, contract coverage (check-coverage), OpenAPI drift (re-runs pnpm openapi:export and fails if hoco-v1.json differs from the committed one), docs check-mdx, pnpm buildPRJ-01, OPS-02
Tests (PostgreSQL · Redis · MinIO)Applies every migration to an empty PostgreSQL 17, fails if the schema has changed without a migration, seeds the reference and demo data, then runs the whole Vitest suite with Redis and MinIO, so no integration suite skipsOPS-02
Secret scan (gitleaks)gitleaks over the full historyPRJ-01
Contract breaking changesoasdiff against the last contracts-v* tag, failing on an undeclared breaking change — not wired yetSRV-03

The three named checks are the required ones (deployment runbook).

hoco-mobile (set up in MOB-01):

CheckRunsSince
analyzedart format --set-exit-if-changed, flutter analyze on every packageMOB-01
testUnit and widget tests (melos run test)MOB-01
buildStaging-flavor APKs of both appsMOB-01
API clientRegenerates hoco_api from the pinned document and fails on a diffMOB-03
gitleaksSame as hocoMOB-01
Integration and golden testsOrdering and visit flows; design-system goldensMOB-15

Who reviews what

Each repository has one main developer, so most PRs are self-reviewed with the checklist below. A second person is required only where a mistake would cross a boundary: the contract, what the apps consume, security-sensitive mobile code, and design conformance.

PR byTouchesReviewerBlocking?
AnisAnything not listed belowSelf-review checklistAnis merges once CI is green
Anispackages/contracts (label contract), or the behaviour of an operation the apps call (label mobile-impact)ImadYes — Imad's approval is required
AnisBack-office or reseller web screens (label ui)Akram, on the screenshots or the preview linkYes, for design conformance: Akram comments "Design OK" (or "Design OK, follow-ups #n")
AnisLabel securitySelf-review with the security checklist, then a 5-minute walkthrough with Imad at the Wednesday syncNot blocking the merge; findings become issues
ImadUI-only changes in hoco-mobileSelf-review checklistImad merges once CI is green
Imadhoco_api, hoco_core (HTTP, auth, storage), hoco_offline, Android or iOS permissions and manifests, signing, CIAnisYes
ImadApp screens (label ui)AkramYes, as above
Imadhoco — docs pages, contract proposalsAnisYes
DependabotDependency updatesAnis (hoco), Imad (hoco-mobile)Yes — merged within a week; a major version gets its own PR and its changelog is read

If Akram cannot review a ui PR within one working day, the author merges and opens a design-qa issue for the review, so the flow never waits on one person.

Self-review checklist — the author ticks it in the PR before merging:

  • I read the whole diff on GitHub, top to bottom, as a reviewer would.
  • The PR title, task id and Closes #n are right; the size is within limits.
  • Every item of what a reviewer checks that applies is satisfied.
  • CI is green; I did not skip or weaken a check.
  • The change still matches the contract, the requirement and the design it implements.

What a reviewer checks

AreaChecks
CorrectnessMeets the linked requirements and their acceptance criteria; edge cases and empty values; statuses and transitions exactly as in lifecycles and statuses
ContractMatches packages/contracts; error codes from the registry; cursor pagination for apps, offset for the back-office; Idempotency-Key handled on mutations, required where flagged
SecurityPermission key <module>.<action> on every operation; self and delegate scopes applied as query filters; no personal data or secrets in logs; private files only through signed URLs; input validated by the Zod schema
DataMigration safety (expand then contract); indexes for new filters and foreign keys; the change and its OutboxEvent in the same transaction; money in integer centimes; timestamps UTC, business days Africa/Algiers
UXLoading, empty, error, offline and no-permission states; French copy from the message files, no hard-coded strings; logical CSS properties (RTL-ready); keyboard and screen-reader basics
TestsNew rules have unit tests; endpoints have integration tests for the happy path, permission denied, out of scope and the main business errors
DocsSpecs, endpoint catalogue, API page or plan updated in the same PR when the change touches them

Comments start with a prefix: blocking: (must change before approval), question:, suggestion:, nit:. Only blocking: prevents an approval; an approval with nits is normal.

Response times

Working hours, Sunday to Thursday (hours).

EventExpected within
First review of a normal PR1 working day
First review of a contract PR, a hotfix or a fix on a release branch4 working hours
Re-review after changes4 working hours
The author answers review comments1 working day
Akram's design review of a ui PR1 working day
A PR with no activity2 working days → raised at the stand-up; 5 → closed or re-planned

Previews

SurfacePreviewSet up in
Docscheck-mdx and the docs build in CI; reviewers run the site locallyOPS-02
Back-office and reseller webDokploy preview deployment per PR into dev, against the staging API, link posted on the PR, removed when the PR closesOPS-02
MobileStaging-flavor APK attached to the PR as a CI artifact, plus screenshotsMOB-01
ContractThe diff of hoco-v1.json in the PR, served locally by Prism (mock server)SRV-03

Assumption — until OPS-02 sets up the web previews, ui PRs are reviewed on screenshots and recordings, and Akram checks the result on staging after the merge.

Merging and cleanup

  1. CI green, required approvals given, every conversation resolved.
  2. Squash-merge into dev with the PR title as subject. The branch is deleted automatically.
  3. Linked issues close through Closes #n (dev is the default branch).
  4. The author checks the change on staging the same working day (automatic deploy); mobile changes in the next App Distribution build.
  5. A merged contract PR is announced in the team group: "Contract 1.N.0 merged — operations … — PR #…". Imad regenerates the client (the loop).
  6. The task is reported done in Thursday's report; Anis sets status and doneOn in tasks.json (progress reporting).

On this page