Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add style guide and code quality standards #1694

Open
hasheddan opened this issue Nov 6, 2020 · 17 comments
Open

Add style guide and code quality standards #1694

hasheddan opened this issue Nov 6, 2020 · 17 comments
Assignees
Labels
area/release-eng Issues or PRs related to the Release Engineering subproject kind/design Categorizes issue or PR as related to design. kind/documentation Categorizes issue or PR as related to documentation. kind/feature Categorizes issue or PR as related to a new feature. lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. sig/release Categorizes an issue or PR as relevant to SIG Release.
Milestone

Comments

@hasheddan
Copy link
Contributor

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

@hasheddan hasheddan added kind/feature Categorizes issue or PR as related to a new feature. sig/release Categorizes an issue or PR as relevant to SIG Release. area/release-eng Issues or PRs related to the Release Engineering subproject labels Nov 6, 2020
@justaugustus
Copy link
Member

Thanks for opening this, Dan!
/priority important-soon
/milestone v1.21

@k8s-ci-robot k8s-ci-robot added the priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. label Nov 6, 2020
@k8s-ci-robot k8s-ci-robot added this to the v1.21 milestone Nov 6, 2020
@justaugustus justaugustus added kind/design Categorizes issue or PR as related to design. kind/documentation Categorizes issue or PR as related to documentation. labels Nov 6, 2020
@puerco
Copy link
Member

puerco commented Nov 6, 2020

+1 Thanks for pointing this out dan, I certainly would like to get some some of these well established (and understood!) to start implementing them. Sometimes I get lost and I feel waste too much time reinventing the wheel.

@saschagrunert
Copy link
Member

@hasheddan when do we want to work on this issue? Seems not part of our roadmap planning but we may wire it into some side-effort.

@justaugustus
Copy link
Member

Fun discussion w/ @wilsonehusin and some of the team on Twitter: https://twitter.com/stephenaugustus/status/1359354950019657730?s=20

Let's try and tackle this as a priority for v1.21.

@justaugustus
Copy link
Member

/assign @puerco @wilsonehusin
/unassign @hasheddan @saschagrunert
/milestone v1.22

@k8s-ci-robot k8s-ci-robot modified the milestones: v1.21, v1.22 Mar 24, 2021
@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jun 22, 2021
@fejta-bot
Copy link

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Jul 22, 2021
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Reopen this issue or PR with /reopen
  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close

@k8s-ci-robot
Copy link
Contributor

@k8s-triage-robot: Closing this issue.

In response to this:

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Reopen this issue or PR with /reopen
  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@justaugustus
Copy link
Member

I was thinking about this again, thanks to @helayoty! (ref: https://twitter.com/helayoty/status/1497366986841460738)
/reopen

@kubernetes/release-engineering -- Thoughts here?

@justaugustus justaugustus removed the lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. label Feb 26, 2022
@k8s-ci-robot k8s-ci-robot reopened this Feb 26, 2022
@k8s-ci-robot
Copy link
Contributor

@justaugustus: Reopened this issue.

In response to this:

I was thinking about this again, thanks to @helayoty! (ref: https://twitter.com/helayoty/status/1497366986841460738)
/reopen

@kubernetes/release-engineering -- Thoughts here?

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@justaugustus
Copy link
Member

justaugustus commented Feb 26, 2022

/unassign @wilsonehusin @puerco
/assign @justaugustus @helayoty

Heba, I'm going to take an initial pass using the awesome Crossplane one @hasheddan linked: https://github.com/crossplane/crossplane/blob/master/CONTRIBUTING.md

From there, we can iterate on improvements together!

@helayoty
Copy link
Member

/unassign @wilsonehusin @puerco /assign @justaugustus @helayoty

Heba, I'm going to take an initial using the awesome Crossplane one @hasheddan linked: https://github.com/crossplane/crossplane/blob/master/CONTRIBUTING.md

From there, we can iterate on improvements together!

While it's so hard now to top this amazing work, I totally agree.

@justaugustus
Copy link
Member

Heba, I'm going to take an initial pass using the awesome Crossplane one @hasheddan linked: https://github.com/crossplane/crossplane/blob/master/CONTRIBUTING.md

First pass: kubernetes/sig-release#1862

@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label May 27, 2022
@matglas
Copy link
Contributor

matglas commented Jun 8, 2022

@justaugustus the first pass form your last comment is merged.

Would a follow up for this be to reference the k/sig-release contributing doc on all sig release repos in the CONTRIBUTING.md so its clear there is sort of one central contributing guide for sig release.

Would that be basically every project in https://github.com/kubernetes/community/tree/master/sig-release#subprojects?

@justaugustus justaugustus added lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Jun 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/release-eng Issues or PRs related to the Release Engineering subproject kind/design Categorizes issue or PR as related to design. kind/documentation Categorizes issue or PR as related to documentation. kind/feature Categorizes issue or PR as related to a new feature. lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. sig/release Categorizes an issue or PR as relevant to SIG Release.
Projects
None yet
Development

No branches or pull requests

10 participants