Skip to content

Add documentation for struct fields #444

Description

@nirs

Problem

Many struct fields throughout the codebase lack documentation comments. This makes it harder for developers to understand the purpose and usage of fields, especially in public APIs and report structures.

Examples

  • pkg/report/application.go: Fields like ClusterTime, SchedulingInterval, LastGroupSyncTime in DRPCSummary and VRGSummary
  • pkg/report/clusters.go: Various fields in summary structs

Proposal

Add godoc comments for all exported struct fields, following Go documentation conventions:

type DRPCSummary struct {
    Name               string               `json:"name"`
    Namespace          string               `json:"namespace"`
    // ClusterTime is the API server time when the DRPC was gathered
    ClusterTime        *time.Time           `json:"clusterTime,omitempty"`
    // SchedulingInterval is the replication scheduling interval from the DRPolicy
    SchedulingInterval ValidatedDuration    `json:"schedulingInterval"`
    // LastGroupSyncTime is the timestamp of the last successful volume synchronization
    LastGroupSyncTime  ValidatedTime        `json:"lastGroupSyncTime"`
    // ... other fields
}

Benefits

  • Improved code readability
  • Better IDE autocomplete and hover documentation
  • Clearer API contracts
  • Easier onboarding for new contributors

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

documentationImprovements or additions to documentation

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions