Skip to content

Conversation

@fbac
Copy link
Collaborator

@fbac fbac commented Sep 9, 2025

Apply Go naming and package documentation standards across APIs, services, metrics, constants, topics, and tests to align identifiers like HTTPAddr/ID/URL and TopicKind* throughout the codebase

This change standardizes Go naming and documentation across the repository. It renames exported and unexported identifiers to conform to Go conventions (e.g., HttpHTTP, IdID, UrlURL), replaces legacy topic kind constants with topic.TopicKind* variants, consolidates retryable error imports under pkg/utils/retryerrors, and adds package-level comments. It also updates constructors, option types, metrics emitters, config types, and test utilities to the new names, and adjusts file names to snake_case for consistency.

  • Replace legacy topic constants with topic.TopicKind* and update topic.TopicKind.String, topic.Topic.IsReserved, and all call sites, including tests (e.g., pkg/topic/topic.go).
  • Rename API/server types and options to APIServer, APIServerOption, and HTTPRegistrationFunc, updating constructors and methods across API, gateway, and server layers (e.g., pkg/api/server.go, pkg/api/http_server.go).
  • Enforce ID/URL/HTTP naming across services, metrics, registry nodes, and utils, touching handlers, workers, and tests (e.g., pkg/registry/node.go, pkg/utils/grpc.go).
  • Migrate retryable errors to pkg/utils/retryerrors and update mocks, indexers, and migrator to the new package (e.g., pkg/utils/retryerrors/errors.go).
  • Update constants to CamelCase and adjust references across auth interceptors, hashing, and headers (e.g., pkg/constants/constants.go).
  • Rename constructors and methods to exported forms where needed (e.g., NewPayerAPIService, NewMetadataAPIService) and align tests/utilities (e.g., pkg/api/payer/service.go, pkg/testutils/api/api.go).
  • Add package comments across many packages and convert files to snake_case where applicable, including SQL files and generated headers.
  • Adjust metrics names and emitters to *SequenceID and update usages (e.g., pkg/metrics/sync.go).

📍Where to Start

Start with the topic kind migration and naming changes in pkg/topic/topic.go, then review API/server renames in pkg/api/server.go and registry node field changes in pkg/registry/node.go.


Macroscope summarized 7ea2571. (Automatic summaries will resume when PR exits draft mode or review begins).

@graphite-app
Copy link

graphite-app bot commented Sep 9, 2025

How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • Queue - adds this PR to the back of the merge queue
  • Hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

@fbac fbac marked this pull request as ready for review September 9, 2025 17:53
@fbac fbac requested a review from a team as a code owner September 9, 2025 17:53
Copy link
Collaborator

@mkysel mkysel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no opinion

@fbac fbac force-pushed the 09-09-go_standards branch from 39ca8a4 to 5b6b9d7 Compare September 11, 2025 15:47
@fbac fbac merged commit 09fc4bc into main Sep 11, 2025
9 of 10 checks passed
@fbac fbac deleted the 09-09-go_standards branch September 11, 2025 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants