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

Use VCS module paths in Go reference from Gherkin => Messages #1608

Merged
merged 12 commits into from
Jun 16, 2021
Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 1 addition & 1 deletion .templates/go/default.mk
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ endif

dist: $(EXES)

dist/$(EXE_BASE_NAME)-%: .deps $(GO_SOURCE_FILES)
dist/$(EXE_BASE_NAME)-%: .deps $(GO_SOURCE_FILES) go.mod
mkdir -p dist
echo "EXES=$(EXES)"
echo "Building $@"
Expand Down
2 changes: 1 addition & 1 deletion cucumber-expressions/go/default.mk
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ endif

dist: $(EXES)

dist/$(EXE_BASE_NAME)-%: .deps $(GO_SOURCE_FILES)
dist/$(EXE_BASE_NAME)-%: .deps $(GO_SOURCE_FILES) go.mod
mkdir -p dist
echo "EXES=$(EXES)"
echo "Building $@"
Expand Down
2 changes: 1 addition & 1 deletion demo-formatter/go/default.mk
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ endif

dist: $(EXES)

dist/$(EXE_BASE_NAME)-%: .deps $(GO_SOURCE_FILES)
dist/$(EXE_BASE_NAME)-%: .deps $(GO_SOURCE_FILES) go.mod
mkdir -p dist
echo "EXES=$(EXES)"
echo "Building $@"
Expand Down
2 changes: 1 addition & 1 deletion gherkin/go/default.mk
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ endif

dist: $(EXES)

dist/$(EXE_BASE_NAME)-%: .deps $(GO_SOURCE_FILES)
dist/$(EXE_BASE_NAME)-%: .deps $(GO_SOURCE_FILES) go.mod
mkdir -p dist
echo "EXES=$(EXES)"
echo "Building $@"
Expand Down
2 changes: 1 addition & 1 deletion gherkin/go/go.mod
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module github.com/cucumber/gherkin-go/v19

require (
github.com/cucumber/messages-go/v16 v16.0.1
github.com/cucumber/common/messages/v16 v16.0.0
Copy link
Contributor

Choose a reason for hiding this comment

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

There is no Git tag named v16.0.0 in the monorepo. all tags are of the form library/version, so you need to use something like this:

github.com/cucumber/common/messages/v16 messages/v16.0.0

I haven't tested if this is valid go module syntax. If it isn't, we have to start using a different naming scheme for tags - perhaps with a hyphen or dot instead of a slash,

Copy link
Member Author

Choose a reason for hiding this comment

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

It seems to have ways of inferring the tag from the version string that I can't quite fathom yet. If you see the first error (...at revision messages/v16.0.0) it seems to have figured out the tag name and found it, but it has the wrong path to the actual go.mod file (missing github.com/cucumber/common/messages/go.mod)

Copy link
Member Author

Choose a reason for hiding this comment

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

In the second case it makes a different guess for the tag name, and can't find it in git: unknown revision messages/go/v16.0.0

Copy link
Contributor

Choose a reason for hiding this comment

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

go look for the module on the master branch.
But it does not exist (yet) because messages/go.mod still have module github.com/cucumber/messages-go/v16

with the following in gherkin/go/go.mod I was able to have a coherent error message:

github.com/cucumber/common/messages/go/v16 e0d826edaa5d24e50910eaa689194a8b3340c907

# go: github.com/cucumber/common/messages/go/[email protected]: parsing go.mod:
#         module declares its path as: github.com/cucumber/common/messages/v16
#                 but was required as: github.com/cucumber/common/messages/go/v16

I think we will have to update the modules like the following (in messages/go/go.mod):

module github.com/cucumber/common/messages/go/v16

So we may need at least 2 PR to make it work:

The first one updating all go.mod replacing the module path from the subrepos to the appropriate monorepo sub-directory (for example module github.com/cucumber/messages-go/v16 => module github.com/cucumber/common/messages/go/v16)

Then a second PR to update all the go require directive to point to the new location.

github.com/stretchr/testify v1.7.0
)

Expand Down
2 changes: 1 addition & 1 deletion json-formatter/go/default.mk
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ endif

dist: $(EXES)

dist/$(EXE_BASE_NAME)-%: .deps $(GO_SOURCE_FILES)
dist/$(EXE_BASE_NAME)-%: .deps $(GO_SOURCE_FILES) go.mod
mkdir -p dist
echo "EXES=$(EXES)"
echo "Building $@"
Expand Down
2 changes: 1 addition & 1 deletion messages/go/default.mk
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ endif

dist: $(EXES)

dist/$(EXE_BASE_NAME)-%: .deps $(GO_SOURCE_FILES)
dist/$(EXE_BASE_NAME)-%: .deps $(GO_SOURCE_FILES) go.mod
mkdir -p dist
echo "EXES=$(EXES)"
echo "Building $@"
Expand Down
2 changes: 1 addition & 1 deletion messages/go/go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/cucumber/messages-go/v16
module github.com/cucumber/common/messages/v16

require (
github.com/gofrs/uuid v4.0.0+incompatible
Expand Down
2 changes: 1 addition & 1 deletion tag-expressions/go/default.mk
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ endif

dist: $(EXES)

dist/$(EXE_BASE_NAME)-%: .deps $(GO_SOURCE_FILES)
dist/$(EXE_BASE_NAME)-%: .deps $(GO_SOURCE_FILES) go.mod
mkdir -p dist
echo "EXES=$(EXES)"
echo "Building $@"
Expand Down