-
-
Notifications
You must be signed in to change notification settings - Fork 690
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
Conversation
i had a fiddle around but I can't seem to make this work. @lonnblad @jaysonesmith @aslakhellesoy @aurelien-reeves anyone care to take a look at it? |
The error I see is:
This combination seems to at least help it to figure out the right git tag. If I use
|
gherkin/go/go.mod
Outdated
@@ -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 |
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.
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,
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.
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
)
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.
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
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.
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.
Ref #1550 Co-authored-by: Aurelien Reeves <[email protected]>
…cs-module-refs-in-go
…cs-module-refs-in-go
Wooot!! Don't forget to update CHANGELOG before merging this, with an entry under And then I suppose we can archive all the mirrors and remove the mirroring stuff from the build? Including the executable we run to do the actual mirroring. |
Changelog have already been updated as part of #1616 |
I think having the CHANGELOGs reference the main issue #1550 is good enough. Do you agree? We'll need to do the new major releases of messages and gherkin as part of cucumber/godog#389 I guess. |
@aslakhellesoy I've updated the checklist at the top of #1550 - can you take a look and see if you agree with the remaining steps? |
Summary
Ref #1550 - switch to using VCS module paths within the monorepo instead of pointing to a subrepo.
TODO:
go.mod
filesMotivation and Context
If we can use module paths that point to the directory within the cucumber/common repo, we can get rid of a whole load of complexity around creating subrepo mirrors.
How Has This Been Tested?
cd gherkin/go && make
Types of changes