Delete the duplication narration git history already holds
Fifteen paragraphs of the form "this file used to hold a second copy of <cmd>: it parsed the flags again, opened a unit of work...". The fact that a second implementation existed explains nothing about the code that is there now, and the commit that removed it says so in more detail than a doc comment should. Reviewed individually rather than pattern-matched. A first pass keyed on phrases like "used to" and "this slice" flagged 130 paragraphs and would have taken out design rationale with them — it cut bootstrapper.go's "WHY ONLY THIS SLICE OF bd init IS A ROLE" because "THIS SLICE" matched a pattern meant for programme slices. That pass was reverted. Of the 69 paragraphs a tightened pass surfaced, these 15 are the ones carrying no live information; the other 54 explain an invariant, a trap, or a behaviour change a user sees, and stay.
This commit is contained in:
parent
bd6d6b1612
commit
eee1a14b00
14 changed files with 0 additions and 95 deletions
|
|
@ -12,12 +12,6 @@ import (
|
|||
// proxied-server provider, through the provider's OWN capability accessor —
|
||||
// the same two-step proxiedCommenter performs, and for the same reason: the
|
||||
// accessor is where each layer is added.
|
||||
//
|
||||
// This file used to hold a second copy of `bd count`: it parsed the flags
|
||||
// again, opened a unit of work, loaded the workspace's list configuration and
|
||||
// applied the infra policy, then executed against the use case. All of that is
|
||||
// behind the role now, so the proxied route differs from the direct one by
|
||||
// which accessor it asks and nothing else.
|
||||
func proxiedCounter() (issueops.Counter, error) {
|
||||
if uowProvider == nil {
|
||||
return nil, errors.New("proxied-server UOW provider not initialized")
|
||||
|
|
|
|||
|
|
@ -4,13 +4,6 @@ package main
|
|||
// this command's behaviour actually changed when it moved onto
|
||||
// issueops.BatchCreator.
|
||||
//
|
||||
// What the role promises is pinned at all three backends by
|
||||
// backend/conformance/batch_creator_contract.go and is not restated here. These
|
||||
// tests assert the three things only the front door can show: that the direct
|
||||
// route reaches the role at all, that the plan-wide flags it used to accept and
|
||||
// ignore now mean something, and that a refused file leaves the workspace as it
|
||||
// found it.
|
||||
//
|
||||
// They run the real bd binary against an isolated embedded-Dolt workspace, the
|
||||
// same way create_deps_atomic_test.go does, and reuse that file's hermetic
|
||||
// environment and output helpers.
|
||||
|
|
|
|||
|
|
@ -244,12 +244,6 @@ func buildCreateIssueFromInput(in createInput) *types.Issue {
|
|||
|
||||
// runCreateProxiedMarkdown creates every issue in a markdown file as ONE act,
|
||||
// through issueops.BatchCreator.
|
||||
//
|
||||
// It builds the SAME request the direct route builds, from the same shared
|
||||
// projection, so the two routes differ only in which accessor answers. The
|
||||
// unit of work, the per-item create loop, the custom-type check this handler
|
||||
// used to run against a create context it read itself, and the commit are all
|
||||
// the contract's.
|
||||
func runCreateProxiedMarkdown(_ *cobra.Command, ctx context.Context, in createInput) error {
|
||||
templates, err := parseMarkdownFile(in.markdownFile)
|
||||
if err != nil {
|
||||
|
|
|
|||
|
|
@ -13,13 +13,6 @@ import (
|
|||
|
||||
// `bd dep cycles`, and the post-add warning every route that wires an edge
|
||||
// prints, on ONE role and ONE renderer.
|
||||
//
|
||||
// This file used to be four places. The direct sweep opened the store and
|
||||
// walked [][]*types.Issue; the proxied sweep opened a unit of work and walked
|
||||
// the same slice from the use case; and each of them carried its own copy of the
|
||||
// arrow-path warning. The two copies agreed, which is the only reason nobody had
|
||||
// noticed that the slice they agreed about was map-ordered and silently
|
||||
// shortened.
|
||||
|
||||
// openCycleDetector hands back the cycle role for whichever route this
|
||||
// invocation is on, each through its OWN capability accessor.
|
||||
|
|
|
|||
|
|
@ -17,14 +17,6 @@ import (
|
|||
|
||||
// `bd dep tree` on ONE role and ONE body.
|
||||
//
|
||||
// This file used to be two handlers. The direct route resolved a partial id,
|
||||
// opened a routed store and called store.GetDependencyTree; the proxied route
|
||||
// took the id verbatim, opened a unit of work and called the use case. Each of
|
||||
// them then carried its own copy of the `both`-direction merge, the status
|
||||
// prune, the mermaid and human rendering, and the empty-tree wording. The copies
|
||||
// agreed, which is the only reason nobody noticed that a `both` walk was two
|
||||
// independent reads with no transaction spanning them.
|
||||
//
|
||||
// What is left here is the front door's own work: flag vocabulary, id
|
||||
// resolution, and rendering. The walk, the depth bound, the cycle policy, the
|
||||
// prune and the defensive cap are issueops.TreeWalker's.
|
||||
|
|
|
|||
|
|
@ -15,12 +15,6 @@ import (
|
|||
// purgeScope is what `bd purge` and `bd prune` still differ by once the
|
||||
// operation itself is behind issueops.Sweeper: a tier, a reference policy, and
|
||||
// the words each command prints.
|
||||
//
|
||||
// It used to carry the SEMANTICS too — ephemeralOnly, requireFilter,
|
||||
// ignoreReferences — and each route read them and re-derived the same
|
||||
// selection, the same pinned protection and the same safety gate from them.
|
||||
// All of that is request fields now, so what is left here is presentation plus
|
||||
// the two request values a flag chooses.
|
||||
type purgeScope struct {
|
||||
// cmdName is the user-visible command name (e.g. "purge", "prune").
|
||||
// Used in messages and the suggested `--force` hint.
|
||||
|
|
@ -97,11 +91,6 @@ EXAMPLES:
|
|||
// openSweeper hands back the bulk-clearance role for whichever route this
|
||||
// invocation is on, each through its OWN capability accessor — the store's for
|
||||
// the direct route and the provider's for the proxied one.
|
||||
//
|
||||
// Neither branch builds a filter, matches a glob, rechecks closed_at or scans
|
||||
// for citations. That is the whole of what moved behind the role, and it used
|
||||
// to be written out twice, once per route, with the selection and the deletion
|
||||
// in two DIFFERENT transactions on this one.
|
||||
func openSweeper() (issueops.Sweeper, error) {
|
||||
if usesProxiedServer() {
|
||||
return proxiedSweeper()
|
||||
|
|
|
|||
|
|
@ -12,14 +12,6 @@ import (
|
|||
// proxied-server provider, through the provider's OWN capability accessor —
|
||||
// the same two-step proxiedCounter performs, and for the same reason: the
|
||||
// accessor is where each layer is added.
|
||||
//
|
||||
// This file used to hold a second copy of `bd purge` and `bd prune`: it parsed
|
||||
// the flags again, opened a unit of work, built the candidate filter, matched
|
||||
// the glob, re-applied the pinned and closed_at rechecks, ran its own
|
||||
// reference scan, and then printed 190 lines of output that had to be kept
|
||||
// character-identical to the direct route's by hand. All of that is behind the
|
||||
// role now, so the proxied route differs from the direct one by which accessor
|
||||
// it asks and nothing else.
|
||||
func proxiedSweeper() (issueops.Sweeper, error) {
|
||||
if uowProvider == nil {
|
||||
return nil, errors.New("proxied-server UOW provider not initialized")
|
||||
|
|
|
|||
|
|
@ -16,12 +16,6 @@ import (
|
|||
// the same two-step proxiedCounter performs, and for the same reason: the
|
||||
// accessor is where each layer is added.
|
||||
//
|
||||
// This file used to hold a second copy of `bd query`: it parsed the expression
|
||||
// again, evaluated it again, applied the default closed exclusion again, and
|
||||
// carried its own copy of the limit*3-floor-100 over-fetch. All of that is
|
||||
// behind the role now, so the proxied route differs from the direct one by
|
||||
// which accessor it asks.
|
||||
//
|
||||
// TWO --offset REFUSALS LEFT WITH IT, in opposite directions. "--offset is not
|
||||
// supported with OR/predicate queries" is GONE: it existed because an offset
|
||||
// into a window that had already dropped matches meant nothing, and the window
|
||||
|
|
|
|||
|
|
@ -116,11 +116,6 @@ Examples:
|
|||
// openStatsReporter hands back the summary role for whichever route this
|
||||
// invocation is on, each through its OWN capability accessor — the store's for
|
||||
// the direct route and the provider's for the proxied one.
|
||||
//
|
||||
// Neither branch builds a filter, folds a summary or opens a unit of work.
|
||||
// That is the whole of what moved behind the role: this command used to hold
|
||||
// the assignee filter, the ready-work filter and the status fold on the direct
|
||||
// route, and a second copy of all three on the proxied one.
|
||||
func openStatsReporter() (issueops.StatsReporter, error) {
|
||||
if usesProxiedServer() {
|
||||
return proxiedStatsReporter()
|
||||
|
|
|
|||
|
|
@ -13,13 +13,6 @@ import (
|
|||
// the same two-step proxiedCounter performs, and for the same reason: the
|
||||
// accessor is where each layer is added.
|
||||
//
|
||||
// This file used to hold a second copy of `bd status`: it opened a unit of
|
||||
// work, ran the statistics query, and — under --assigned — built the assignee
|
||||
// filter, ran the ready-work query and folded the five status counts itself,
|
||||
// beside a direct route doing the same three things again. All of that is
|
||||
// behind the role now, so the proxied route differs from the direct one by
|
||||
// which accessor it asks and nothing else.
|
||||
//
|
||||
// The role is asked for at the TOP of the command, before any work: this
|
||||
// command resolves no ids, so there is nothing to look up first and no
|
||||
// lookup-only provider to trip over.
|
||||
|
|
|
|||
|
|
@ -87,15 +87,6 @@ func proxiedIssueLifecycle() (issueops.Lifecycle, error) {
|
|||
// applyUpdateProxiedOne applies one issue's update — plain or --claim —
|
||||
// through issueops.Lifecycle rather than through a hand-rolled attempt.
|
||||
//
|
||||
// THE UPDATE IS NOT IMPLEMENTED HERE, and that is the point. The read-merge-write,
|
||||
// the merge-shaped metadata and note edits resolved against the row re-read
|
||||
// inside the mutation transaction, the assignee fence, the close policy, the
|
||||
// conditional-update compare-and-set, the claim's own CAS and eligibility
|
||||
// rules, the issue-or-wisp resolve, the whole-attempt conflict retry and the
|
||||
// commit all belong to the contract. Every one of them had a second
|
||||
// implementation in this file until this commit; the claim already answered to
|
||||
// the contract, and now the plain update does too.
|
||||
//
|
||||
// What stays here is this surface's own protocol: the template guard, the
|
||||
// advisory reassign pre-read, the per-id failure taxonomy the multi-id batch
|
||||
// needs, the notes-overwrite warning and the completion hooks — none of which
|
||||
|
|
|
|||
|
|
@ -28,11 +28,6 @@ func proxiedVersionReconciler() (issueops.VersionReconciler, error) {
|
|||
// reconcileVersionProxiedServer records this binary's version on the proxied
|
||||
// route, and is the twin of autoMigrateOnVersionBump's tail.
|
||||
//
|
||||
// This file used to open its own unit of work and hold the commit message for
|
||||
// a decision made in a use case; the direct route made the SAME decision from a
|
||||
// second copy of the comparison in cmd/bd. Both now ask the role, and the
|
||||
// difference between the routes is which accessor answers.
|
||||
//
|
||||
// EVERY FAILURE HERE IS SWALLOWED TO A DEBUG LINE, deliberately, and
|
||||
// issueops.VersionReconciler says that this is what its callers do. This runs
|
||||
// from PersistentPreRun before every proxied command: a workspace whose markers
|
||||
|
|
|
|||
|
|
@ -16,11 +16,6 @@ import (
|
|||
// dimensions are the wisps merge (SkipWisps), template exclusion (IsTemplate),
|
||||
// the default gate exclusion (ExcludeTypes), and infra-type routing to the
|
||||
// ephemeral tier (Ephemeral).
|
||||
//
|
||||
// It moved here from cmd/bd when the Counter role took the filter off both
|
||||
// front doors. That is a strict improvement in what it guards: it used to
|
||||
// compare a CLI helper against the shared list builder, and now it compares
|
||||
// the two SHARED builders that every route and every backend goes through.
|
||||
func TestBuildCountFilterIncludeInfraMirrorsListFilter(t *testing.T) {
|
||||
cfg := ListConfig{}
|
||||
for _, issueType := range []string{"", "task", "gate", "message"} {
|
||||
|
|
|
|||
|
|
@ -25,11 +25,6 @@ import (
|
|||
// New returns the issue-count surface backed by a store handle. *DoltStore and
|
||||
// *EmbeddedDoltStore answer identically because the difference between them is
|
||||
// below storage.DoltStorage, not above it.
|
||||
//
|
||||
// The counter supplies its own ConfigSource from the store it already holds,
|
||||
// so a caller ON THE ROLE cannot half-perform the "load config, build filter,
|
||||
// execute" ritual: it has no way to reach the pieces. That ritual is exactly
|
||||
// what both `bd count` routes used to run for themselves, once each.
|
||||
func New(store storage.DoltStorage) (issueops.Counter, error) {
|
||||
if store == nil {
|
||||
return nil, &issueops.ErrUnsupported{Op: "storecounter.New", Backend: "nil"}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue