mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-12-05 10:37:23 +01:00
ci: map volume creation and replication peer actions
This commit is contained in:
1 parent
a1b0a6ff39
commit
585aafaafb
3 files changed
+54
-3
No files matched your search
+20
-3
@@ -10,7 +10,8 @@ expanded. Missing, empty or malformed mappings refuse the check.
|
||||
|
||||
The reviewed map uses the neutral public module names: `SnapshotRemoval`,
|
||||
`RestoreTarget`, `HolderInterface`, `EngineAdapter`, `StopAndRestart`,
|
||||
`MoveAdmission`, `Promotion`, `ProbeRound` and `FencingRound`.
|
||||
`MoveAdmission`, `Promotion`, `ProbeRound`, `FencingRound`, `VolumeCreate`
|
||||
and `ReplicationPeer`.
|
||||
Actions name top-level definitions used by the corresponding model's `Next`.
|
||||
The mapping is the source of accepted citations; private model names and
|
||||
storage locations do not belong in the public map or PR description.
|
||||
@@ -26,5 +27,21 @@ Model: EngineAdapter.Begin; MoveAdmission.Revoke; NONE (pure function of Restore
|
||||
Unmapped paths keep the existing spec-trace policy. The pure-function
|
||||
declaration is a review claim; CI checks its module, not its truth.
|
||||
|
||||
This branch is a trial. Populate the canonical mapping and run the complete
|
||||
shell self-test on Linux before enabling it by merging the workflow.
|
||||
## Adding a model or file
|
||||
|
||||
1. Have the model owner confirm its neutral public module name and the
|
||||
top-level action definitions used by `Next`. Use those names in public
|
||||
code, mapping rows and PR descriptions.
|
||||
2. Add an exact-path TSV row for each implementation and enforcement file
|
||||
that the action covers. Split actions get separate rows. Include receiving
|
||||
guards as well as senders; a reviewer checks that each file really enforces
|
||||
the cited action. Environment actions without a Go site and mutant test
|
||||
obligations are not implementation mappings.
|
||||
3. Add controls for accepted and refused citations when extending the
|
||||
checker. For mapping additions, check the real map against representative
|
||||
affected paths. Run `python3 -B .github/scripts/model-trace-check-test.py`
|
||||
and `bash .github/scripts/spec-trace-check-test.sh` on Linux.
|
||||
4. Submit the map and its evidence for review with the model change or before
|
||||
its callers land. The PR description cites the applicable public actions.
|
||||
The new rows govern later PRs once they are on the target branch; changing
|
||||
a PR's own map never changes the check that evaluates that PR.
|
||||
+22
@@ -16,6 +16,7 @@ core/authority/workspace_delete_reservation.go MoveAdmission.DelCheck
|
||||
core/authority/workspace_delete_reservation.go MoveAdmission.Reserve
|
||||
core/authority/workspace_lease_view.go HolderInterface.Grant
|
||||
core/authority/workspace_lease_view.go HolderInterface.Regrant
|
||||
core/engine/apply.go ReplicationPeer.Reconcile
|
||||
core/frontend/chunkstore/layout/claim.go EngineAdapter.Takeover
|
||||
core/frontend/chunkstore/layout/claim.go MoveAdmission.ClaimB
|
||||
core/frontend/chunkstore/layout/claim.go SnapshotRemoval.Claim
|
||||
@@ -26,8 +27,10 @@ core/frontend/chunkstore/layout/clean.go SnapshotRemoval.BeginClean
|
||||
core/frontend/chunkstore/layout/clean.go SnapshotRemoval.EndClean
|
||||
core/frontend/chunkstore/layout/commit.go EngineAdapter.Apply
|
||||
core/frontend/chunkstore/layout/commit.go SnapshotRemoval.Commit
|
||||
core/frontend/chunkstore/layout/commit.go VolumeCreate.Commit
|
||||
core/frontend/chunkstore/layout/create.go RestoreTarget.CreateHead
|
||||
core/frontend/chunkstore/layout/create.go RestoreTarget.CreateVol
|
||||
core/frontend/chunkstore/layout/create.go VolumeCreate.Claim
|
||||
core/frontend/chunkstore/layout/delete.go MoveAdmission.DelMark
|
||||
core/frontend/chunkstore/layout/delete.go MoveAdmission.DelRead
|
||||
core/frontend/chunkstore/layout/delete.go RestoreTarget.OpRelease
|
||||
@@ -46,6 +49,9 @@ core/frontend/chunkstore/layout/snapshots.go RestoreTarget.AddDep
|
||||
core/frontend/chunkstore/layout/snapshots.go SnapshotRemoval.DeleteSnap
|
||||
core/frontend/chunkstore/layout/start.go HolderInterface.Start
|
||||
core/frontend/chunkstore/layout/start.go StopAndRestart.CrashRestart
|
||||
core/frontend/chunkstore/layout/start.go VolumeCreate.Claim
|
||||
core/frontend/chunkstore/layout_create.go VolumeCreate.IssueHead
|
||||
core/frontend/chunkstore/layout_create.go VolumeCreate.IssueVol
|
||||
core/frontend/chunkstore/layout_remote.go EngineAdapter.Begin
|
||||
core/frontend/chunkstore/layout_remote.go EngineAdapter.ReadHead
|
||||
core/frontend/chunkstore/layout_remote.go EngineAdapter.SendCommit
|
||||
@@ -55,6 +61,7 @@ core/frontend/chunkstore/layout_remote.go StopAndRestart.SendCommit
|
||||
core/frontend/chunkstore/layout_remote.go StopAndRestart.SettleAbort
|
||||
core/frontend/chunkstore/layout_store.go SnapshotRemoval.ApplyDelete
|
||||
core/frontend/chunkstore/layout_store.go SnapshotRemoval.ApplyMark
|
||||
core/frontend/chunkstore/swfs.go VolumeCreate.Land
|
||||
core/frontend/durable/provider_chunk.go EngineAdapter.SettleResume
|
||||
core/frontend/durable/provider_chunk.go EngineAdapter.StartStop
|
||||
core/frontend/durable/provider_chunk.go HolderInterface.StopBegin
|
||||
@@ -64,10 +71,12 @@ core/frontend/durable/provider_layout.go EngineAdapter.SettleDown
|
||||
core/frontend/durable/provider_layout.go StopAndRestart.SettleDown
|
||||
core/frontend/durable/storage_adapter.go EngineAdapter.GuestWrite
|
||||
core/frontend/durable/storage_adapter.go HolderInterface.Write
|
||||
core/host/master/layout_ready.go VolumeCreate.Place
|
||||
core/host/master/probe_round.go FencingRound.Deliver
|
||||
core/host/master/probe_round.go FencingRound.Open
|
||||
core/host/master/product_loop.go FencingRound.Decide
|
||||
core/host/master/product_loop.go Promotion.Decide
|
||||
core/host/master/store_attestation.go ReplicationPeer.Attest
|
||||
core/host/master/workspace_service.go MoveAdmission.ReadForMove
|
||||
core/host/master/workspace_service.go StopAndRestart.ReadClean
|
||||
core/host/volume/primary_evidence.go FencingRound.Adopt
|
||||
@@ -79,13 +88,21 @@ core/host/volume/workspace_lease.go MoveAdmission.StopOnExpiry
|
||||
core/host/volume/workspace_lease.go MoveAdmission.Write
|
||||
core/host/volume/workspace_lease.go SnapshotRemoval.Expire
|
||||
core/host/volume/workspace_lease.go StopAndRestart.Write
|
||||
core/lifecycle/store.go VolumeCreate.MarkReady
|
||||
core/lifecycle/store.go VolumeCreate.Record
|
||||
core/replication/peer.go Promotion.Ship1
|
||||
core/replication/peer.go Promotion.Ship2
|
||||
core/replication/peer.go ReplicationPeer.Barrier
|
||||
core/replication/peer.go ReplicationPeer.Fail
|
||||
core/replication/peer.go ReplicationPeer.Heal
|
||||
core/replication/peer.go ReplicationPeer.Ship
|
||||
core/replication/volume.go FencingRound.Ack
|
||||
core/replication/volume.go Promotion.Ack1
|
||||
core/replication/volume.go Promotion.Rejoin
|
||||
core/replication/volume.go Promotion.Write1
|
||||
core/replication/volume.go Promotion.Write2
|
||||
core/replication/volume.go ReplicationPeer.Ack
|
||||
core/replication/volume.go ReplicationPeer.Write
|
||||
core/storage/chunk_head_belt.go HolderInterface.Fence
|
||||
core/storage/chunk_layer.go EngineAdapter.EngineReRead
|
||||
core/storage/chunk_layer.go EngineAdapter.NoOpCut
|
||||
@@ -94,4 +111,9 @@ core/storage/chunk_layer.go HolderInterface.StopCommit
|
||||
core/storage/chunk_layer.go MoveAdmission.Detach
|
||||
core/storage/chunk_layer.go MoveAdmission.Publish
|
||||
core/storage/chunk_layer.go SnapshotRemoval.Write
|
||||
core/transport/catchup_sender.go ReplicationPeer.CatchUp
|
||||
core/transport/rebuild_sender.go ReplicationPeer.Rebuild
|
||||
core/transport/replica.go FencingRound.Recv
|
||||
core/transport/replica.go ReplicationPeer.CatchUp
|
||||
core/transport/replica.go ReplicationPeer.Rebuild
|
||||
core/transport/replica.go ReplicationPeer.Ship
|
||||
|
@@ -35,6 +35,18 @@ class ModelTraceTests(unittest.TestCase):
|
||||
def test_unmapped_files_keep_existing_policy(self):
|
||||
self.assertEqual(checker.check("existing prose", ["docs/a.md", "core/a.go.bak"], self.mapping), [])
|
||||
|
||||
def test_repository_map_covers_claimed_head_create(self):
|
||||
mapping = checker.read_mapping(SCRIPT.parent.parent / "model-code-trace.tsv")
|
||||
paths = ["core/frontend/chunkstore/layout/create.go"]
|
||||
self.assertEqual(checker.check("VolumeCreate.Claim", paths, mapping), [])
|
||||
self.assertEqual(len(checker.check("VolumeCreate.Unknown", paths, mapping)), 1)
|
||||
|
||||
def test_repository_map_covers_the_replica_receiver(self):
|
||||
mapping = checker.read_mapping(SCRIPT.parent.parent / "model-code-trace.tsv")
|
||||
paths = ["core/transport/replica.go"]
|
||||
self.assertEqual(checker.check("ReplicationPeer.Ship", paths, mapping), [])
|
||||
self.assertEqual(len(checker.check("VolumeCreate.Claim", paths, mapping)), 1)
|
||||
|
||||
def test_cli_checks_nul_paths_and_model_citations(self):
|
||||
with tempfile.TemporaryDirectory() as tmp:
|
||||
mapping = Path(tmp) / "map.tsv"
|
||||
|
||||
Reference in new issue
Block a user