-
Notifications
You must be signed in to change notification settings - Fork 13
chore: improve Makefile and add PR checklist #334
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
### Description | ||
|
||
_Provide description of this PR and changes._ | ||
|
||
### Checklist | ||
|
||
- [ ] Tests added and all succeed (`make test`) | ||
- [ ] Regenerated mocks, etc. (`make generate`) | ||
- [ ] Linted (`make lint`) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Suggestion: let's add a point to integrate this in the CLI to ensure early that the changes didn't break anything. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Something like this?:
Or were you thinking they should create a draft PR ready? So adding "If required, create a draft PR on the CLI repo." There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since we had past occasions where gaf changes broke the CLI and its Acceptance tests, I would say There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "open a PR to test", I'm not sure I follow how opening a PR would test it, unless you are suggesting that the person updates the go.mod in the CLI PR to point to their GAF PR's commit? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi @PeterSchafer, I've given the wording an attempt, let me know what you think. |
||
- [ ] Test your changes work for the [CLI](https://github.com/snyk/cli) | ||
1. Uncomment the line near the bottom of [go.mod](https://github.com/snyk/cli/blob/main/cliv2/go.mod) to point to your local GAF code. | ||
2. Run `go mod tidy` in the `cliv2` directory. | ||
3. Run the CLI tests and do any required manual testing. | ||
- Once this PR is merged, make a PR in the [CLI](https://github.com/snyk/cli/pulls) repo to increment the version of GAF in the [go.mod](https://github.com/snyk/cli/blob/main/cliv2/go.mod). |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ GOARCH = $(shell go env GOARCH) | |
|
||
GO_BIN := $(shell pwd)/.bin | ||
OVERRIDE_GOCI_LINT_V := v1.60.1 | ||
SHELL := env PATH=$(GO_BIN):$(PATH) $(SHELL) | ||
SHELL := env PATH="$(GO_BIN):$(PATH)" $(SHELL) | ||
|
||
.PHONY: format | ||
format: | ||
|
@@ -38,21 +38,27 @@ testv: | |
@go test -v ./... -race | ||
|
||
.PHONY: generate | ||
generate: | ||
generate: tools | ||
@echo "Generating generated files..." | ||
@go generate ./... | ||
@make format | ||
|
||
.PHONY: tools | ||
tools: $(GO_BIN)/golangci-lint $(GO_BIN)/cue | ||
GOBIN=$(GO_BIN) go install github.com/oapi-codegen/oapi-codegen/v2/cmd/[email protected] | ||
GOBIN=$(GO_BIN) go install github.com/golang/mock/[email protected] | ||
tools: $(GO_BIN)/cue $(GO_BIN)/golangci-lint $(GO_BIN)/oapi-codegen $(GO_BIN)/mockgen | ||
@echo "Installing tools..." | ||
|
||
$(GO_BIN)/cue: | ||
GOBIN=$(GO_BIN) go install cuelang.org/go/cmd/[email protected] | ||
|
||
$(GO_BIN)/golangci-lint: | ||
curl -sSfL 'https://raw.githubusercontent.com/golangci/golangci-lint/${OVERRIDE_GOCI_LINT_V}/install.sh' | sh -s -- -b ${GO_BIN} ${OVERRIDE_GOCI_LINT_V} | ||
|
||
$(GO_BIN)/mockgen: | ||
GOBIN=$(GO_BIN) go install github.com/golang/mock/[email protected] | ||
|
||
$(GO_BIN)/oapi-codegen: | ||
GOBIN=$(GO_BIN) go install github.com/oapi-codegen/oapi-codegen/v2/cmd/[email protected] | ||
|
||
.PHONY: update-local-findings | ||
update-local-findings: | ||
@scripts/pull-down-test-api-spec.sh | ||
|
@@ -61,9 +67,11 @@ update-local-findings: | |
.PHONY: help | ||
help: | ||
@echo "Main targets:" | ||
@echo "$(LOG_PREFIX) tools Installs the tools required for development and testing" | ||
@echo "$(LOG_PREFIX) format" | ||
@echo "$(LOG_PREFIX) lint" | ||
@echo "$(LOG_PREFIX) build" | ||
@echo "$(LOG_PREFIX) generate Regenerates generated files (e.g. mocks)" | ||
@echo "$(LOG_PREFIX) test" | ||
@echo "$(LOG_PREFIX) testv Test versbosely" | ||
@echo "$(LOG_PREFIX) GOOS Specify Operating System to compile for (see golang GOOS, default=$(GOOS))" | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Praise: Nice, long overdue!