Standardize JSON tags to camelCase across all structs · Entire

Standardize JSON tags to camelCase across all structs

cc2de54→main·

Soph·3mo ago·10 files·+155 added/-155 removed

Convert all existing snake_case JSON tags to camelCase and add camelCase tags to previously untagged public API types. This establishes a consistent JSON convention across the codebase following standard Go ecosystem practices.

Output types (Result, ProbeResult, FetchResult, BranchPlan, etc.) and input types (Endpoint, RefMapping, SyncPolicy, etc.) now all use camelCase. Custom MarshalJSON methods updated to match.

Auth/OAuth response structs in internal/auth/entiredb.go are intentionally left unchanged as they match external API formats.

Sessions

Changes

10

28 unmodified lines

...

Type Definitions


// RunSummary holds the summary for a single run of a benchmark.
type runSummary struct {
    Index      int             `json:"index"`
    TargetPath string          `json:"target_path"`
    TargetURL  string          `json:"target_url"`
    WallMillis int64           `json:"wall_millis"`
    Result     unstable.Result `json:"result"`
    Error      string          `json:"error,omitempty"`
}

// AggregateSummary holds the aggregate results of multiple runs.
type aggregateSummary struct {
    SuccessfulRuns        int      `json:"successful_runs"`
    FailedRuns            int      `json:"failed_runs"`
    BatchedRuns           int      `json:"batched_runs"`
    MinWallMillis         int64    `json:"min_wall_millis"`
    MaxWallMillis         int64    `json:"max_wall_millis"`
    AvgWallMillis         float64  `json:"avg_wall_millis"`
    MinSyncElapsedMillis  int64    `json:"min_sync_elapsed_millis"`
    MaxSyncElapsedMillis  int64    `json:"max_sync_elapsed_millis"`
    AvgSyncElapsedMillis  float64  `json:"avg_sync_elapsed_millis"`
    ... other fields ...
}

// BenchmarkReport holds the final report of a benchmark run.
type benchmarkReport struct {
    Scenario    scenario         `json:"scenario"`
    SourceURL   string           `json:"source_url"`
    Repeat      int              `json:"repeat"`
    KeepTargets bool             `json:"keep_targets"`
    WorkDir     string           `json:"work_dir"`
    Config      benchmarkConfig  `json:"config"`
    Aggregate   aggregateSummary `json:"aggregate"`
    Runs        []runSummary     `json:"runs"`
}

// BenchmarkConfig holds the configuration for running the benchmark.
type benchmarkConfig struct {
    SourceURL string                   `json:"source_url"`
    Scope     gitsync.RefScope         `json:"scope"`
    Policy    gitsync.SyncPolicy       `json:"policy"`
    Options   unstable.AdvancedOptions `json:"options"`
}

// and other types as necessary...
// FetchResult holds the outcome of a fetch operation.
type FetchResult struct {
    SourceURL      string          `json:"source_url"`
    RequestedMode  string          `json:"requested_mode"`
    Protocol       string          `json:"protocol"`
    Wants          []RefInfo       `json:"wants"`
    Haves          []plumbing.Hash `json:"haves"`
    FetchedObjects int             `json:"fetched_objects"`
    Stats          Stats           `json:"stats"`
    Measurement    Measurement     `json:"measurement"`
}