vmware-tanzu / velero

Backup and migrate Kubernetes applications and their persistent volumes
https://velero.io
Apache License 2.0
8.41k stars 1.37k forks source link

Standardize quality checks between Velero repositories #7690

Open mateusoliveira43 opened 2 months ago

mateusoliveira43 commented 2 months ago

Describe the problem/challenge you have Velero is composed of various repositories, for example:

All of them being primarily written in Go and maintained by the same people. So, it makes sense these repositories have the same quality standards

Some suggested standardization

Describe the solution you'd like

The quality checks would be enforced by CI, but have to be also possible to run locally by developers (must be documented).

A suggestion would be the creation of a auxiliary repository, that would create a development image used along all Velero repositories. Example with just golangci-lint:

FROM golang:1.22

RUN go install -v -mod=mod github.com/golangci/golangci-lint/cmd/golangci-lint@v1.55.2

WORKDIR /home/development

COPY .golangci.yaml .

WORKDIR /home/development/PROJECT

Calling that image velero-development, we would, for example, change make lint instruction to be

docker container run \
  -v $PWD:/home/development/PROJECT -it --rm \
  velero-development golangci-lint run -c /home/development/.golangci.yaml 

Anything else you would like to add:

Other tools can also be integrated, like pre-commit, to run some quality checks prior to developer commiting something.

Environment:

Vote on this issue!

This is an invitation to the Velero community to vote on issues, you can see the project's top voted issues listed here.
Use the "reaction smiley face" up to the right of this comment to vote.

github-actions[bot] commented 2 weeks ago

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 14 days. If a Velero team member has requested log or more information, please provide the output of the shared commands.

kaovilai commented 4 days ago

goimports is automatically run in vscode on save by default.. if editorconfig/ci runs equivalent of goimports that would save me some sanity around imports shuffling and having to save with this setting.

image
mateusoliveira43 commented 4 days ago

I use this is settings.json to avoid problems

    "[go]": {
        "editor.codeActionsOnSave": {
            "source.organizeImports": "never"
        }
    },