Skip to content

Add style guide and code quality standards #1694

Open
@hasheddan

Description

What would you like to be added:

As the functionality and number of packages in krel continues to grow, we are starting to see divergence in how new features are implemented, tested, and maintained. We should add style guidelines and quality standards so that someone is completely new to the project can make contributions that are easily reviewed and integrated without degrading quality.

Why is this needed:

There are a few key areas that we have determined as important to maintain quality and consistency:

  • Exposing the minimum required public API in packages (i.e. bias towards private fields in structs and interfaces)
  • Follow pattern of "accepting interfaces, returning structs" (i.e Robustness principle)
  • Avoid "testing through" (i.e. make your interfaces easily mockable)
  • Generate mocks in a consistent manner (we use counterfeiter)
  • Establish and measure a (potentially flexible) threshold for unit test coverage
  • Establish what types of features require integration / e2e testing

This is not an all-inclusive list, but can serve as a good starting point for a document that we can continually iterate on.

/assign @hasheddan @saschagrunert

Metadata

Labels

area/release-engIssues or PRs related to the Release Engineering subprojectkind/designCategorizes issue or PR as related to design.kind/documentationCategorizes issue or PR as related to documentation.kind/featureCategorizes issue or PR as related to a new feature.lifecycle/frozenIndicates that an issue or PR should not be auto-closed due to staleness.priority/important-soonMust be staffed and worked on either currently, or very soon, ideally in time for the next release.sig/releaseCategorizes an issue or PR as relevant to SIG Release.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions