Skip to content

Commit f76cc7b

Browse files
authored
Merge pull request #233 from coder13/dev
Promote verified dev release candidate
2 parents b89c3da + 09ddba8 commit f76cc7b

8 files changed

Lines changed: 125 additions & 8 deletions

File tree

.github/workflows/ci.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
pull_request:
55
push:
66
branches:
7+
- dev
78
- master
89

910
jobs:
@@ -17,6 +18,12 @@ jobs:
1718
- name: Validate production metrics configuration
1819
run: scripts/test-compose-metrics-config.sh
1920

21+
- name: Validate CI branch coverage
22+
run: scripts/test-ci-branches.sh
23+
24+
- name: Validate CodeQL branch coverage
25+
run: scripts/test-codeql-branches.sh
26+
2027
server:
2128
name: Server lint and unit tests
2229
runs-on: ubuntu-latest

.github/workflows/codeql.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
pull_request:
55
push:
66
branches:
7+
- dev
78
- master
89
schedule:
910
- cron: '23 10 * * 1'

CONTRIBUTING.md

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,27 @@ Do not run separate installs or create lockfiles inside workspaces.
2121

2222
## Branches
2323

24-
Create branches from the latest `master`:
24+
Create feature branches from the latest integration branch:
2525

2626
```sh
2727
git fetch origin
28-
git switch -c your-branch origin/master
28+
git switch -c your-branch origin/dev
2929
```
3030

3131
If you use a fork, replace `origin` with the remote that tracks the canonical
32-
repository. Pull requests should target `master`.
32+
repository. Pull requests should target `dev`; `master` receives only a
33+
reviewed promotion from `dev`.
34+
35+
The branch flow is feature branch → `dev` → release-candidate validation →
36+
reviewed promotion to `master`. CI runs on every pull request and on pushes to
37+
both `dev` and `master`, so the merge commit on `dev` is the release candidate
38+
that must be validated. Do not merge a feature branch directly to `master`.
3339

3440
Keep each pull request limited to one coherent change. Before publishing,
35-
inspect both the commit list and the complete diff against `master` to make sure
36-
the branch does not include work inherited from another feature branch.
41+
inspect both the commit list and the complete diff against `dev` to make sure
42+
the branch does not include work inherited from another feature branch. Compare
43+
a release promotion against both `origin/master` and the intended `origin/dev`
44+
commit so its scope is explicit.
3745

3846
## Code Style
3947

@@ -109,3 +117,9 @@ explains what changed and why.
109117
Do not include credentials, production data, access tokens, or private logs. If
110118
you discover a vulnerability, follow [SECURITY.md](SECURITY.md) instead of
111119
opening a public issue.
120+
121+
## Release Promotion
122+
123+
Use the [release workflow](docs/release-workflow.md) before promoting `dev` to
124+
`master`. It records the required CI, review, migration, deploy, and rollback
125+
evidence; it does not authorize a production deployment by itself.

docs/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ This directory contains the durable technical documentation for Let's Cube.
1616
— resumable migration, parity, privacy, and rollback contract
1717
- [Production operations](operations.md) — deployment, health checks, rollback,
1818
backups, restore, and capacity management
19+
- [Release workflow](release-workflow.md) — feature-to-`dev` integration,
20+
`dev`-to-`master` promotion evidence, and deployment handoff
1921

2022
## Feature contracts
2123

docs/development.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,6 @@ and `http://localhost:9000/health/socket`.
197197

198198
### Tooling changes break unexpectedly
199199

200-
The repository combines React 16, Material UI v4, Jest 26, ESLint 6, and modern
201-
Vite. Run client unit tests and `yarn workspace letscube-client build` after
202-
dependency or build-tool changes; success in only one path is not sufficient.
200+
The client uses React 18, Material UI 6, Jest 30, ESLint 9, and Vite 8. Run
201+
client unit tests and `yarn workspace letscube-client build` after dependency or
202+
build-tool changes; success in only one path is not sufficient.

docs/release-workflow.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Release Workflow
2+
3+
`dev` is the integration branch. `master` is the reviewed release branch.
4+
Production deployment remains a separately authorized operation described in
5+
[Production operations](operations.md).
6+
7+
## Branch Flow
8+
9+
1. Open each focused feature pull request against `dev`.
10+
2. Review and merge the feature into `dev`.
11+
3. Treat the resulting `dev` merge commit as the release candidate. Its push
12+
CI and CodeQL push runs must finish before promotion is considered.
13+
4. Open a reviewed promotion from that exact `dev` commit to `master`.
14+
5. After the promotion is merged and its `master` push CI passes, perform the
15+
separately authorized deployment procedure.
16+
17+
Do not bypass `dev` by merging feature work directly to `master`. A new commit
18+
on `dev` after release-candidate validation requires a new validation run.
19+
20+
## Promotion Evidence
21+
22+
Before approving a `dev` to `master` promotion, record or link the following in
23+
the promotion pull request:
24+
25+
- the exact `dev` commit SHA and its successful CI and CodeQL push runs,
26+
including Cypress for full-stack changes;
27+
- the review that approved the promotion and any issue or milestone links;
28+
- focused and broad checks relevant to the change, including checks not run;
29+
- schema migration compatibility and data-backfill evidence when persistence
30+
changes are included; and
31+
- the intended deployment target plus the rollback path validated under
32+
[Production operations](operations.md#failed-deployments-and-rollback).
33+
34+
## Release Blockers
35+
36+
A reviewer or release maintainer must block promotion when any required CI check
37+
fails, the candidate SHA is unclear, review is incomplete, a migration cannot
38+
run alongside the previous application image, deployment preflight or backup
39+
restore evidence is missing, rollback has not been verified, or a security or
40+
privacy concern is unresolved. Production deployment also stops without the
41+
explicit operational authorization required by the operations guide.
42+
43+
## Deployment Handoff
44+
45+
After `master` CI is green, follow the operations guide in order:
46+
47+
1. complete the [preflight](operations.md#preflight) checks;
48+
2. deploy with the documented procedure;
49+
3. perform the [verification and monitoring](operations.md#verification-and-monitoring)
50+
checks; and
51+
4. use the documented rollback procedure if readiness or verification fails.
52+
53+
This checklist is release evidence, not a substitute for the production
54+
authorization, secrets, backups, or host-level checks described in the
55+
operations guide.

scripts/test-ci-branches.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
5+
WORKFLOW="$SCRIPT_DIR/../.github/workflows/ci.yml"
6+
7+
for branch in dev master; do
8+
if ! awk '
9+
/^ push:/ { in_push = 1; next }
10+
in_push && /^ [^[:space:]]/ { exit }
11+
in_push && $0 == " - " branch { found = 1 }
12+
END { exit !found }
13+
' branch="$branch" "$WORKFLOW"; then
14+
echo "CI must run on pushes to $branch." >&2
15+
exit 1
16+
fi
17+
done
18+
19+
echo "CI push branch coverage checks passed."

scripts/test-codeql-branches.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
5+
WORKFLOW="$SCRIPT_DIR/../.github/workflows/codeql.yml"
6+
7+
for branch in dev master; do
8+
if ! awk '
9+
/^ push:/ { in_push = 1; next }
10+
in_push && /^ [^[:space:]]/ { exit }
11+
in_push && $0 == " - " branch { found = 1 }
12+
END { exit !found }
13+
' branch="$branch" "$WORKFLOW"; then
14+
echo "CodeQL must run on pushes to $branch." >&2
15+
exit 1
16+
fi
17+
done
18+
19+
echo "CodeQL push branch coverage checks passed."

0 commit comments

Comments
 (0)