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

Clean up mirror repos #1550

Open
1 of 9 tasks
mattwynne opened this issue May 16, 2021 · 16 comments
Open
1 of 9 tasks

Clean up mirror repos #1550

mattwynne opened this issue May 16, 2021 · 16 comments
Labels
🏦 debt Tech debt

Comments

@mattwynne
Copy link
Member

mattwynne commented May 16, 2021

When we first moved to the monorepo, many of the package managers we used needed a library to be in its own repo, so we set up individual read-only mirror repos which are copied to when there are changes in this repo.

The context has changed, and we don't need them any more. The represent a significant amount of complexity, and things will be simpler if we can do away with them.

@mattwynne
Copy link
Member Author

@jaysonesmith or anyone else from @cucumber/go can you help me understand whether we still need the subrepos for publishing common go modules?

@aurelien-reeves
Copy link
Contributor

We can easily specify a go module which is in a monorepo:
https://golang.org/ref/mod#module-path
https://golang.org/ref/mod#vcs-dir
So in our case, that should be as simple as something like the following: github.com/cucumber/common/messages/go/v42

@ciaranmcnulty
Copy link
Contributor

Would be great if this eliminates the rsync'ing

mattwynne added a commit that referenced this issue Jun 16, 2021
Ref #1550

Co-authored-by: Aurelien Reeves <[email protected]>
mattwynne added a commit that referenced this issue Jun 16, 2021
Ref: #1550

NB: Until #1608 has been merged to main, we're using a temporary branch ref in
go.mod. This will need to be removed before this PR is merged.
mattwynne added a commit that referenced this issue Jun 16, 2021
* Point go module paths to monorepo

Ref #1550

Co-authored-by: Aurelien Reeves <[email protected]>

* Fix Go module self-references

Co-authored-by: Aurelien Reeves <[email protected]>
mattwynne added a commit that referenced this issue Jun 16, 2021
* Also rebuild go packages if go.mod changes

* Attempt to use a VCS path to reference gherkin->messages in Go

* Point go module paths to monorepo

Ref #1550

Co-authored-by: Aurelien Reeves <[email protected]>

* Update Go module refs from gherkin->messages

Ref: #1550

NB: Until #1608 has been merged to main, we're using a temporary branch ref in
go.mod. This will need to be removed before this PR is merged.

* Update Go module refs from demo-formatter -> messages

Ref #1550

* Update Go module refs from json-formatter -> messages

Ref #1550

* Fix Go module self-references

* Use main branch again in Go module refs

Co-authored-by: Aurelien Reeves <[email protected]>
@aslakhellesoy
Copy link
Contributor

I disagree with use symlinks instead of rsync and delete rsync scripts/functions - symlinks work poorly in git.

We may be able to replace some of the copied files with relative file paths within the repo, but we might not be able to do it for all rsync'ed files.

For example, I think .mocharc.json files must be in the same directory as package.json - there might be more cases like that.

@ciaranmcnulty
Copy link
Contributor

symlinks work poorly in git

Is that a Windows issue?

@aslakhellesoy
Copy link
Contributor

I thought it was a Windows issue (used to be at least), but have no simple way of verifying if it works now. Maybe it does now: https://github.community/t/windows-symlinks-do-they-play-well-with-git-projects/730

If symlinks work on Windows too, it would certainly simplify things!

@ciaranmcnulty
Copy link
Contributor

I have similar vague memories :)

I think under WSL2 it's fine but no idea how it works on 'real' Windows nowadays

@ciaranmcnulty
Copy link
Contributor

If we don't have separate repos in future though I agree that we should minimise the use of symlinks in favour of relative paths

@mattwynne
Copy link
Member Author

@gasparnagy @aurelien-reeves @enkessler can you add anything about the symlinks situation on Windows these days?

@gasparnagy
Copy link
Member

gasparnagy commented Jun 18, 2021

@mattwynne I did a quick check. you can create symlinks, but only with admin privileges. so with normal console where you would do a git pull it does not work.

How does git support symlinks? Could anyone point me to a git repo that had symlinks inside - i would try to see what happens if i pull...

btw the win command for creating symlinks is

mklink symlink-file target-file

@gasparnagy
Copy link
Member

It seems you can enable creating symlinks without admin, but it requires you to enable developer mode (i don't have that enabled... and never heard about it yet). Unfortunately developer mode enables a bunch of other things, like SSH server, that you might not want to have on a laptop for example...
https://docs.microsoft.com/en-us/windows/apps/get-started/enable-your-device-for-development

@mattwynne
Copy link
Member Author

@mattwynne
Copy link
Member Author

You should be able to do:

> type link-to-readme.md
# symlink-test

@aurelien-reeves
Copy link
Contributor

aurelien-reeves commented Jun 23, 2021

have separate repos in future though I agree that we should minimise the use of symlinks i

I agree.
Why to use symlinks where relative path may be enough?

Symlinks may still be confusing sometimes when relative path are explicit anyway.

@gasparnagy
Copy link
Member

@gasparnagy try https://github.com/mattwynne/symlink-test ?

Does not work. Git clone just clones it as normal file that contains the name of the linked file... :(

> type link-to-readme.md
README.md

So I think we can say that we should not use symlinks if we want to have contributors with Windows...

@mattwynne
Copy link
Member Author

Why to use symlinks where relative path may be enough?

Of course! I hadn't thought of that. Relative paths should work just fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏦 debt Tech debt
Projects
Development

No branches or pull requests

5 participants