Skip to content

Commit a647249

Browse files
committed
CONTRIBUTING_GO.md: fix modules to use new monorepo path
Update the commands and examples to use the new go.podman.io paths. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
1 parent fd44aab commit a647249

File tree

1 file changed

+21
-13
lines changed

1 file changed

+21
-13
lines changed

CONTRIBUTING_GO.md

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -32,22 +32,29 @@ The bot automatically opens new PRs with updates that should be merged by mainta
3232

3333
However sometimes, especially during development, it can be the case that you like to update a dependency.
3434

35-
To do so you can use the `go get` command, for example to update containers/storage to the a specific version use:
35+
To do so you can use the `go get` command, for example to update the storage library to the a specific version use:
3636
```
37-
$ go get github.com/containers/storage@v1.55.1
37+
$ go get go.podman.io/storage@v1.60.0
3838
```
3939

4040
Or to update it to the latest commit from main use:
4141
```
42-
$ go get github.com/containers/storage@main
42+
$ go get go.podman.io/storage@main
4343
```
4444

45-
This command will update the go.mod/go.sum files, because we use [go's vendor mechanism](https://go.dev/ref/mod#vendoring)
46-
you must also update the files in the vendor dir. To do so use
45+
This command will update the go.mod/go.sum files, in some repos we use [go's vendor mechanism](https://go.dev/ref/mod#vendoring)
46+
so there you must also update the files in the vendor dir. To do so use:
4747
```
4848
$ make vendor
4949
```
5050

51+
If you are working in the [container-libs](https://github.com/containers/container-libs) monorepo use:
52+
```
53+
make tidy
54+
```
55+
This command syncs the dependency versions across all modules in the repo.
56+
57+
5158
Then commit the changes and open a PR. If you want to add other changes it is recommended to keep the
5259
dependency updates in their own commit as this makes reviewing them much easier.
5360

@@ -58,16 +65,16 @@ dependencies to ensure all our tools use the same properly tested library versio
5865

5966
Sometimes it is helpful (or a maintainer asks for it) to test your library changes in the final binary, e.g. podman.
6067

61-
Assume we like to test a containers/common PR in Podman so that we can have the full CI tests run there.
62-
First you need to push your containers/common changes to your github fork (if not already done).
68+
Assume we like to test a container-libs/common PR in Podman so that we can have the full CI tests run there.
69+
First you need to push your container-libs/common changes to your github fork (if not already done).
6370
Now open the podman repository, create a new branch there and then use.
6471
```
65-
$ go mod edit -replace github.com/containers/common=github.com/<account name>/<fork name>@<branch name>
72+
$ go mod edit -replace go.podman.io/common=github.com/<account name>/<fork name>/common@<branch name>
6673
```
67-
Replace the variable with the correct values, in my case it the reference might be `github.com/Luap99/common@netns-dir`, where
74+
Replace the variable with the correct values, in my case it the reference might be `github.com/Luap99/container-libs/common@myfeature`, where
6875
- account name == `Luap99`
69-
- fork name == `common`
70-
- branch name that I like to test == `netns-dir`
76+
- fork name == `container-libs`
77+
- branch name that I like to test == `myfeature`
7178

7279
Then just run the vendor command again.
7380
```
@@ -89,12 +96,13 @@ If you performed a the git bisect and the resulting commit is one that updated a
8996
the problem is in that library instead. In such cases it may be needed to find the bad commit from this
9097
repository instead. Thankfully this is not much more difficult than the normal bisect usage.
9198

92-
Clone the library repository locally (for this example assume we it is github.com/containers/storage),
99+
Clone the library repository locally (for this example assume we it is github.com/containers/container-libs)
100+
which contains the storage library as module in a subdirectory,
93101
I assume it is in a directory next to the podman repo.
94102

95103
Then in podman run (where you replace the path to the storage repo with your actual one)
96104
```
97-
$ go mod edit -replace github.com/containers/storage=/path/to/storage
105+
$ go mod edit -replace go.podman.io/storage=/path/to/container-libs/storage
98106
$ make vendor
99107
```
100108

0 commit comments

Comments
 (0)