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

gowrap fault injection #7056

Merged
merged 2 commits into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,13 @@ $(STAMPDIR)/goimports-$(GOIMPORTS_VER): | $(STAMPDIR) $(LOCALBIN)
@touch $@
$(GOIMPORTS): $(STAMPDIR)/goimports-$(GOIMPORTS_VER)

GOWRAP_VER := v1.4.1
GOWRAP := $(LOCALBIN)/gowrap
$(STAMPDIR)/gowrap-$(GOWRAP_VER): | $(STAMPDIR) $(LOCALBIN)
$(call go-install-tool,$(GOWRAP),github.com/hexdigest/gowrap/cmd/gowrap,$(GOWRAP_VER))
@touch $@
$(GOWRAP): $(STAMPDIR)/gowrap-$(GOWRAP_VER)

# Mockgen is called by name throughout the codebase, so we need to keep the binary name consistent
MOCKGEN_VER := v0.4.0
MOCKGEN := $(LOCALBIN)/mockgen
Expand Down Expand Up @@ -601,9 +608,10 @@ update-dependencies:
@go get -u -t $(PINNED_DEPENDENCIES) ./...
@go mod tidy

go-generate: $(MOCKGEN) $(GOIMPORTS) $(STRINGER)
go-generate: $(MOCKGEN) $(GOIMPORTS) $(STRINGER) $(GOWRAP)
@printf $(COLOR) "Process go:generate directives..."
@go generate ./...
$(MAKE) copyright
Copy link
Contributor Author

@stephanos stephanos Jan 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without this addition, the generated code has no copyright header. Fortunately, this step is idempotent (and fast).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thoughts:

  1. should we copyright generated code?
  2. If we do - should we add it to the template? Otherwise it will still be "Uber 2020"
  3. I remember we have this discussion about "do we even need copyright at every file"? Where does it go?

Copy link
Contributor Author

@stephanos stephanos Jan 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All good questions.

(1) The other generated code does, so I followed that here. (not a lawyer)
(2) Same as for (1)
(3) I'm told @alexshtin wants to follow up internally on that question.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am on it. Let this line be there for now.


ensure-no-changes:
@printf $(COLOR) "Check for local changes..."
Expand Down
238 changes: 0 additions & 238 deletions cmd/tools/genfaultinjection/main.go

This file was deleted.

Loading
Loading