Skip to content

Commit b787b1b

Browse files
authored
Merge pull request #60 from trustedsec/chore/rename-dev-to-nightly
chore: rename the integration branch back to nightly
2 parents e73df1f + 284a35d commit b787b1b

9 files changed

Lines changed: 75 additions & 75 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ name: CI
33
on:
44
pull_request:
55
push:
6-
# `dev` is here because the `tag` job below runs inside this workflow
7-
# and is gated on `needs: [...]` plus this push trigger for main/dev.
8-
# Without it, pushes to dev run no CI at all and the tag job silently
6+
# `nightly` is here because the `tag` job below runs inside this workflow
7+
# and is gated on `needs: [...]` plus this push trigger for main/nightly.
8+
# Without it, pushes to nightly run no CI at all and the tag job silently
99
# never fires.
10-
branches: [main, dev]
10+
branches: [main, nightly]
1111

1212
# A new push to the same PR supersedes the previous run. Scoped to pull_request
1313
# only: on `main`, cancelling the previous commit's in-progress run because a
@@ -678,7 +678,7 @@ jobs:
678678
}
679679
680680
# Cuts release tags from the commits themselves, once every other job in this
681-
# run has passed. `dev` cuts release candidates for whichever version the
681+
# run has passed. `nightly` cuts release candidates for whichever version the
682682
# batch is heading toward (v0.1.0rc1, v0.1.0rc2, ...) and `main` promotes that
683683
# same target to its final release, so they order correctly at both ends:
684684
#
@@ -710,7 +710,7 @@ jobs:
710710
# pull_request, where tagging would be actively wrong.
711711
if: >-
712712
github.event_name == 'push' &&
713-
(github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev')
713+
(github.ref == 'refs/heads/main' || github.ref == 'refs/heads/nightly')
714714
# This workflow declares contents: read at the top level. This job alone
715715
# needs write, to push a tag and create a release.
716716
permissions:
@@ -745,12 +745,12 @@ jobs:
745745
id: bump
746746
run: |
747747
set -euo pipefail
748-
# main cuts the final release; dev cuts a candidate for the same
748+
# main cuts the final release; nightly cuts a candidate for the same
749749
# target. tools/next_version.py owns the decision entirely.
750750
if [ "$GITHUB_REF" = "refs/heads/main" ]; then
751751
channel=stable
752752
else
753-
channel=dev
753+
channel=nightly
754754
fi
755755
new_tag=$(python3 tools/next_version.py --channel "$channel")
756756
echo "Channel: $channel; tag: ${new_tag:-<nothing to tag>}"
@@ -781,9 +781,9 @@ jobs:
781781
git push origin "refs/tags/$NEW_TAG"
782782
fi
783783
784-
# Only main publishes. Dev candidate tags exist to make builds
784+
# Only main publishes. Nightly candidate tags exist to make builds
785785
# addressable and to give hatch-vcs a version; they are deliberately not
786-
# releases, so nothing ranking releases ever sees a candidate as latest.
786+
# releases, so nothing ranking releases ever sees a nightly as latest.
787787
- name: Create GitHub release
788788
if: steps.bump.outputs.channel == 'stable'
789789
env:

‎CLAUDE.md‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -172,15 +172,15 @@ automatically** — a breaking marker counts as a feature, because an automatic
172172
major is an irreversible published mistake waiting for one mistyped subject
173173
line. Push a major by hand and `release.yml` will publish it.
174174

175-
`dev` cuts candidates for the version the batch is heading toward
175+
`nightly` cuts candidates for the version the batch is heading toward
176176
(`v0.1.0rc1`, `v0.1.0rc2`, …) and `main` promotes that same target to its final
177177
release. Aiming candidates one version *forward* is what makes them sort
178178
correctly: `0.0.0 < 0.1.0rc1 < 0.1.0 < 0.2.0rc1 < 0.2.0`. This makes conventional
179179
commit subjects load-bearing — a `feat:` typo'd as `fix:` ships as a patch.
180180

181181
The tagging lives in a `tag` job **inside `ci.yml`**, gated on
182182
`needs: [test, test-legacy, lint, bandit, nse-root, workflow-lint, build]` and
183-
on `github.event_name == 'push'` for `main`/`dev` only. It is deliberately
183+
on `github.event_name == 'push'` for `main`/`nightly` only. It is deliberately
184184
not a separate `workflow_run`-triggered workflow, which is how this was first
185185
built: zizmor — a required job in this same file — rates `workflow_run` an
186186
error-level dangerous trigger and exits 14, because it is the standard
@@ -192,7 +192,7 @@ head SHA. Do not reintroduce `workflow_run` here.
192192
Things that fail silently rather than loudly, all guarded by
193193
`tests/test_release_versioning.py`:
194194

195-
- **`ci.yml` must run on pushes to `dev`.** Otherwise the tag job never runs
195+
- **`ci.yml` must run on pushes to `nightly`.** Otherwise the tag job never runs
196196
there and no candidate is ever cut, with no error anywhere.
197197
- **The `tag` job must keep every validating job in `needs`.** Drop one and a
198198
tag can land on a commit that failed it.
@@ -209,10 +209,10 @@ Version arithmetic belongs in `tools/next_version.py`, where it is unit-tested,
209209
never in a workflow step. hate_crack carried ~70 lines of `cut -d.` duplicated
210210
across two YAML files before extracting this module; do not reintroduce it here.
211211

212-
**`main` must contain `dev`'s commits as ancestors — merge or fast-forward
213-
`dev` into `main`, never squash.** `tools/next_version.py` computes
212+
**`main` must contain `nightly`'s commits as ancestors — merge or fast-forward
213+
`nightly` into `main`, never squash.** `tools/next_version.py` computes
214214
`git log <last-tag>..HEAD` from whichever branch is tagging. A squash merge
215-
collapses `dev`'s already-released commits into one commit unreachable
215+
collapses `nightly`'s already-released commits into one commit unreachable
216216
from any prior tag, so that range re-lists them on `main` on every subsequent
217217
push, forever. This fails quietly, not loudly: versions stay monotonic (the
218218
squash commit itself is still "since the last release"), so nothing errors —

‎CONTRIBUTING.md‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,19 +35,19 @@ produced it.
3535
`nmap` against `127.0.0.1`. Keep it that way — no test in this repo may send a
3636
packet to an address it does not own.
3737

38-
## Target `dev`, not `main`
38+
## Target `nightly`, not `main`
3939

4040
`main` is the default branch, so GitHub will preselect it — **change the base to
41-
`dev`.** `main` holds the last released state and receives work only through a
42-
batch integration merge from `dev`. A pull request landing on `main` directly
43-
breaks that and creates cleanup for the maintainers.
41+
`nightly`.** `main` holds the last released state and receives work only
42+
through a batch integration merge from `nightly`. A pull request landing on
43+
`main` directly breaks that and creates cleanup for the maintainers.
4444

4545
```bash
4646
git clone https://github.com/<you>/spoonmap
4747
cd spoonmap
48-
git checkout -b my-change origin/dev
48+
git checkout -b my-change origin/nightly
4949
# ... work ...
50-
git push -u origin my-change # then open a PR with base: dev
50+
git push -u origin my-change # then open a PR with base: nightly
5151
```
5252

5353
Branch names follow a `type/short-description` pattern matching the prefixes
@@ -59,10 +59,10 @@ immediately. Say so in the PR body.
5959
`CLAUDE.md` describes the same flow from the maintainer side under "Release
6060
Versioning", and it is worth reading if you want the reasoning. The mechanic you
6161
do not need to do anything about, but should know exists: maintainers integrate
62-
`dev` into `main` with a **merge or a fast-forward, never a squash**. CI derives
63-
every release version from the commits themselves, and a squash merge collapses
64-
already-released commits into one that no prior tag can reach, which silently
65-
corrupts every version computed afterward.
62+
`nightly` into `main` with a **merge or a fast-forward, never a squash**. CI
63+
derives every release version from the commits themselves, and a squash merge
64+
collapses already-released commits into one that no prior tag can reach, which
65+
silently corrupts every version computed afterward.
6666

6767
## Every bug fix needs a regression test
6868

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ run from jumpboxes inside client networks where an unprompted call out to
218218
performs a single check on demand. To enable the check at every startup, set
219219
`"check_for_updates": true` in `config.json`; the key defaults to `false` and
220220
omitting it entirely means `false`. Only stable releases are reported —
221-
pre-release candidates are never advertised as updates.
221+
nightly release candidates are never advertised as updates.
222222

223223
For a summary of every flag, use `--help` (or `-h`):
224224

‎spoonmap.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7339,7 +7339,7 @@ def _tool_version():
73397339

73407340

73417341
# Latest *release* specifically: GitHub's /releases/latest excludes
7342-
# pre-releases, so the vX.Y.ZrcN candidates cut on `dev` are never
7342+
# pre-releases, so the vX.Y.ZrcN candidates cut on `nightly` are never
73437343
# advertised to an operator as an available update.
73447344
_RELEASE_API_URL = (
73457345
'https://api.github.com/repos/trustedsec/spoonmap/releases/latest'

‎tests/test_next_version.py‎

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""Tests for tools/next_version.py -- the release policy itself.
22
33
The policy is ordinary semver with the bump derived from the batch: the second
4-
component moves only for features, `dev` cuts release candidates for the
4+
component moves only for features, `nightly` cuts release candidates for the
55
version the batch is heading toward, and `main` cuts the final of that same
66
target.
77
@@ -43,7 +43,7 @@
4343
("v2.20.0+g1234567", None),
4444
("2.20.0", None),
4545
("v2.20", None),
46-
("dev", None),
46+
("nightly", None),
4747
],
4848
)
4949
def test_only_released_versions_are_baseline_candidates(tag, expected):
@@ -69,7 +69,7 @@ def test_latest_final_compares_numerically_not_lexically():
6969

7070
def test_no_tags_at_all_starts_from_zero():
7171
assert latest_final([]) == (0, 0, 0)
72-
assert latest_final(["dev", "some-marker"]) == (0, 0, 0)
72+
assert latest_final(["nightly", "some-marker"]) == (0, 0, 0)
7373

7474

7575
# --- feature detection ------------------------------------------------------
@@ -148,7 +148,7 @@ def test_an_empty_batch_has_no_target():
148148
than invent a version."""
149149
assert target_version((2, 20, 0), []) is None
150150
assert compute("stable", ["v2.20.0"], []) is None
151-
assert compute("dev", ["v2.20.0"], []) is None
151+
assert compute("nightly", ["v2.20.0"], []) is None
152152

153153

154154
# --- candidate numbering ----------------------------------------------------
@@ -180,14 +180,14 @@ def test_candidate_numbering_survives_a_deleted_tag():
180180
# --- the two channels, and the ordering that motivates the whole design -----
181181

182182

183-
def test_dev_cuts_a_candidate_for_the_next_version():
183+
def test_nightly_cuts_a_candidate_for_the_next_version():
184184
tags = ["v2.20.0"]
185-
assert compute("dev", tags, ["fix: a"]) == "v2.20.1rc1"
186-
assert compute("dev", tags, ["feat: a"]) == "v2.21.0rc1"
185+
assert compute("nightly", tags, ["fix: a"]) == "v2.20.1rc1"
186+
assert compute("nightly", tags, ["feat: a"]) == "v2.21.0rc1"
187187

188188

189189
def test_main_cuts_the_final_of_the_same_target():
190-
"""Merging dev down promotes the candidate rather than inventing a
190+
"""Merging nightly down promotes the candidate rather than inventing a
191191
different number: the fix-only cycle above ends at 2.20.1, not 2.21.0."""
192192
tags = ["v2.20.0", "v2.20.1rc1", "v2.20.1rc2"]
193193
assert compute("stable", tags, ["fix: a"]) == "v2.20.1"
@@ -201,9 +201,9 @@ def test_candidates_sort_above_the_previous_release_and_below_their_own():
201201
it becomes. Asserted end to end across a whole fix-only cycle.
202202
"""
203203
shipped = parse("2.20.0")
204-
rc1 = parse(compute("dev", ["v2.20.0"], ["fix: a"]).lstrip("v"))
204+
rc1 = parse(compute("nightly", ["v2.20.0"], ["fix: a"]).lstrip("v"))
205205
rc2 = parse(
206-
compute("dev", ["v2.20.0", "v2.20.1rc1"], ["fix: a", "fix: b"]).lstrip("v")
206+
compute("nightly", ["v2.20.0", "v2.20.1rc1"], ["fix: a", "fix: b"]).lstrip("v")
207207
)
208208
final = parse(
209209
compute("stable", ["v2.20.0", "v2.20.1rc1", "v2.20.1rc2"], ["fix: a"]).lstrip(
@@ -220,7 +220,7 @@ def test_a_feature_cycle_also_orders_correctly_against_the_fix_cycle():
220220
"""2.20.1 < 2.21.0rc1 < 2.21.0 -- a candidate for the next minor must not
221221
look older than the patch release that preceded it."""
222222
patch_release = parse("2.20.1")
223-
rc = parse(compute("dev", ["v2.20.1"], ["feat: a"]).lstrip("v"))
223+
rc = parse(compute("nightly", ["v2.20.1"], ["feat: a"]).lstrip("v"))
224224
final = parse(compute("stable", ["v2.20.1", "v2.21.0rc1"], ["feat: a"]).lstrip("v"))
225225
assert patch_release < rc < final
226226

@@ -301,9 +301,9 @@ def test_commit_messages_since_baseline_excludes_the_baseline_itself(tmp_path):
301301

302302

303303
def test_baseline_need_not_be_reachable_from_head(tmp_path):
304-
"""main's release tag can sit on a commit dev does not contain.
304+
"""main's release tag can sit on a commit nightly does not contain.
305305
306-
A reachability-restricted baseline would compute the next dev from a
306+
A reachability-restricted baseline would compute the next nightly from a
307307
stale release and hand out a version below what already shipped.
308308
"""
309309
repo = tmp_path / "repo"
@@ -320,24 +320,24 @@ def test_baseline_need_not_be_reachable_from_head(tmp_path):
320320
_git("commit", "-qm", "fix: released on main", cwd=repo)
321321
_git("tag", "v2.20.1", cwd=repo)
322322

323-
_git("checkout", "-q", "-b", "dev", "v2.20.0", cwd=repo)
324-
(repo / "f.txt").write_text("dev\n")
323+
_git("checkout", "-q", "-b", "nightly", "v2.20.0", cwd=repo)
324+
(repo / "f.txt").write_text("nightly\n")
325325
_git("add", "-A", cwd=repo)
326-
_git("commit", "-qm", "fix: on the dev branch", cwd=repo)
326+
_git("commit", "-qm", "fix: on the nightly branch", cwd=repo)
327327

328328
tags = [t for t in _git("tag", cwd=repo).splitlines() if t.strip()]
329329
assert latest_final(tags) == (2, 20, 1), "baseline must see main's release tag"
330330

331331
messages = commit_messages(str(repo), (2, 20, 1))
332-
got = compute("dev", tags, messages)
332+
got = compute("nightly", tags, messages)
333333
assert got == "v2.20.2rc1", (
334-
f"the next dev must sort above the release that already shipped, got {got}"
334+
f"the next nightly must sort above the release that already shipped, got {got}"
335335
)
336336
assert parse("2.20.1") < parse(got.lstrip("v"))
337337

338338

339-
def test_main_prints_candidate_for_dev(tmp_path, capsys):
340-
"""main(["--channel", "dev", "--repo-dir", str(repo)]) returns 0 and
339+
def test_main_prints_candidate_for_nightly(tmp_path, capsys):
340+
"""main(["--channel", "nightly", "--repo-dir", str(repo)]) returns 0 and
341341
prints a candidate tag matching ^v\\d+\\.\\d+\\.\\d+rc\\d+$."""
342342
repo = tmp_path / "repo"
343343
repo.mkdir()
@@ -348,10 +348,10 @@ def test_main_prints_candidate_for_dev(tmp_path, capsys):
348348

349349
from tools.next_version import main
350350

351-
result = main(["--channel", "dev", "--repo-dir", str(repo)])
351+
result = main(["--channel", "nightly", "--repo-dir", str(repo)])
352352
assert result == 0
353353
captured = capsys.readouterr()
354-
assert captured.out.strip(), "dev must print a tag"
354+
assert captured.out.strip(), "nightly must print a tag"
355355
assert captured.out.strip().startswith("v")
356356
# Verify format: v0.0.1rc1
357357
import re
@@ -429,4 +429,4 @@ def test_a_repository_with_no_tags_cuts_the_first_patch():
429429
def test_a_first_batch_containing_a_feature_cuts_the_first_minor():
430430
"""The whole history is one batch on the first run, so a single `feat`
431431
anywhere in it takes the first release to 0.1.0 rather than 0.0.1."""
432-
assert compute("dev", [], ["fix: a", "feat: b", "docs: c"]) == "v0.1.0rc1"
432+
assert compute("nightly", [], ["fix: a", "feat: b", "docs: c"]) == "v0.1.0rc1"

‎tests/test_release_versioning.py‎

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,10 @@ def _normalize_yaml_expr(expr):
7171

7272

7373
def test_ci_runs_on_pushes_to_both_release_branches():
74-
"""A push to `dev` that runs no CI would never reach the tag job, and
74+
"""A push to `nightly` that runs no CI would never reach the tag job, and
7575
no candidate would ever be cut. Nothing errors; tags just stop appearing."""
7676
branches = _triggers(_load('ci.yml'))['push']['branches']
77-
assert 'dev' in branches
77+
assert 'nightly' in branches
7878
assert 'main' in branches
7979

8080

@@ -116,7 +116,7 @@ def test_the_tag_job_never_runs_on_pull_requests():
116116
# Must assert the full expression to catch && → || mutations
117117
expected = _normalize_yaml_expr(
118118
"github.event_name == 'push' && "
119-
"(github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev')"
119+
"(github.ref == 'refs/heads/main' || github.ref == 'refs/heads/nightly')"
120120
)
121121
assert normalized == expected, f'Expected: {expected}\nGot: {normalized}'
122122

@@ -230,17 +230,17 @@ def test_exactly_one_call_to_the_policy_module():
230230

231231

232232
def test_both_channels_are_reachable():
233-
"""main cuts the final release, dev cuts a candidate for the same
233+
"""main cuts the final release, nightly cuts a candidate for the same
234234
target. A job that only ever computed one channel would silently tag
235-
dev builds as releases, or never cut a release at all."""
235+
nightly builds as releases, or never cut a release at all."""
236236
script = _step_script(_job('ci.yml', 'tag'), 'Compute tag')
237237
assert 'channel=stable' in script
238-
assert 'channel=dev' in script
238+
assert 'channel=nightly' in script
239239

240240

241241
@pytest.mark.parametrize('branch,expected_channel', [
242242
('refs/heads/main', 'stable'),
243-
('refs/heads/dev', 'dev'),
243+
('refs/heads/nightly', 'nightly'),
244244
])
245245
def test_compute_tag_step_assigns_correct_channel(branch, expected_channel, tmp_path):
246246
"""The Compute tag step must actually WRITE the channel and new_tag outputs
@@ -287,11 +287,11 @@ def test_compute_tag_step_assigns_correct_channel(branch, expected_channel, tmp_
287287

288288
# Validate new_tag value shape without guarding. Empty is legitimate when HEAD
289289
# sits exactly on a tag (no new commits). Non-empty must match the channel's
290-
# tag format: stable uses v0.1.0, dev uses v0.1.0rc1.
290+
# tag format: stable uses v0.1.0, nightly uses v0.1.0rc1.
291291
new_tag = parsed['new_tag']
292292
if expected_channel == 'stable':
293293
tag_pattern = r'^v\d+\.\d+\.\d+$'
294-
else: # dev
294+
else: # nightly
295295
tag_pattern = r'^v\d+\.\d+\.\d+rc\d+$'
296296

297297
# Assert value is either empty or matches the channel-appropriate format.
@@ -333,7 +333,7 @@ def test_no_shell_version_arithmetic():
333333

334334

335335
def test_only_stable_publishes_a_release():
336-
"""Dev candidates exist to make builds addressable, not to be releases.
336+
"""Nightly candidates exist to make builds addressable, not to be releases.
337337
Publishing them would make anything ranking releases see a candidate as
338338
latest. Assert the full if condition, not fragments."""
339339
release_steps = [
@@ -401,7 +401,7 @@ def test_create_tag_pushes_the_tag(repo_with_remote):
401401
# also push any branch refs the local repo happens to carry) would leave
402402
# the tag assertion above passing while silently also moving/creating a
403403
# branch on the remote -- something this job has no business doing; only
404-
# main and dev themselves are supposed to advance, and only by a real
404+
# main and nightly themselves are supposed to advance, and only by a real
405405
# merge, never by this tagging step.
406406
branches_after = set(_git(remote, 'branch').split())
407407
assert branches_after == branches_before, (
@@ -435,7 +435,7 @@ def test_the_policy_module_agrees_with_this_repository():
435435
test would see."""
436436
result = subprocess.run(
437437
['python3', os.path.join(REPO_ROOT, 'tools', 'next_version.py'),
438-
'--channel', 'dev', '--repo-dir', REPO_ROOT],
438+
'--channel', 'nightly', '--repo-dir', REPO_ROOT],
439439
capture_output=True, text=True,
440440
)
441441
assert result.returncode == 0, result.stderr

0 commit comments

Comments
 (0)