Skip to content
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
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Please read the [contributing guidelines](https://github.com/containers/common-files/blob/master/CONTRIBUTING.md) of the [Containers Group Project](https://github.com/containers).
Please read the [contributing guidelines](https://github.com/containers/container-libs/blob/main/CONTRIBUTING.md) of the [Containers Group Project](https://github.com/containers).
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!--- Please read the [contributing guidelines](https://github.com/containers/common-files/blob/master/.github/CONTRIBUTING.md) before proceeding --->
<!--- Please read the [contributing guidelines](https://github.com/containers/container-libs/blob/main/CONTRIBUTING.md) before proceeding --->
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!--- Please read the [contributing guidelines](https://github.com/containers/common-files/blob/master/.github/CONTRIBUTING.md) before proceeding --->
<!--- Please read the [contributing guidelines](https://github.com/containers/container-libs/blob/main/CONTRIBUTING.md) before proceeding --->
2 changes: 1 addition & 1 deletion CODE-OF-CONDUCT.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![Containers Logo](https://github.com/containers/common/blob/main/logos/containers-full-horiz.png)
![Containers Logo](https://github.com/containers/.github/blob/main/profile/logos/containers-full-horiz.png)
## Containers Community Code of Conduct

### Contributor Code of Conduct
Expand Down
10 changes: 6 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ This document applies to the following projects:
- [podman](https://github.com/containers/podman)
- [buildah](https://github.com/containers/buildah)
- [skopeo](https://github.com/containers/skopeo)
- [common](https://github.com/containers/common)
- [image](https://github.com/containers/image)
- [storage](https://github.com/containers/storage)
- [container-libs](https://github.com/containers/container-libs)
- [libhvee](https://github.com/containers/libhvee)
- [psgo](https://github.com/containers/psgo)
- [netavark](https://github.com/containers/netavark)
Expand All @@ -34,6 +32,10 @@ However, most of the things here listed are very generic and apply when contribu

* [Reporting Issues](#reporting-issues)
* [Submitting Pull Requests](#submitting-pull-requests)
* [Describe your Changes in Commit Messages](#describe-your-changes-in-commit-messages)
* [Sign your PRs](#sign-your-prs)
* [Code review](#code-review)
* [Rebasing](#rebasing)
* [Find bad changes with git bisect](#find-bad-changes-with-git-bisect)

## Reporting Issues
Expand Down Expand Up @@ -136,7 +138,7 @@ It’s important to describe the change in plain English for the reviewer to ver
Solve only one problem per patch.
If your description starts to get long, that’s a sign that you probably need to split up your patch.

If the patch fixes a logged bug entry, refer to that bug entry by number and URL.
If the patch fixes a logged bug entry, refer to that bug entry by number or URL.
If the patch follows from a mailing list discussion, give a URL to the mailing list archive.
Please format these lines as `Fixes:` followed by the URL or, for Github bugs, the bug number preceded by a #.
For example:
Expand Down
39 changes: 23 additions & 16 deletions CONTRIBUTING_GO.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,13 @@ At present, this means the following repositories:
- [podman](https://github.com/containers/podman)
- [buildah](https://github.com/containers/buildah)
- [skopeo](https://github.com/containers/skopeo)
- [common](https://github.com/containers/common)
- [image](https://github.com/containers/image)
- [storage](https://github.com/containers/storage)
- [container-libs](https://github.com/containers/container-libs)
- [libhvee](https://github.com/containers/libhvee)
- [psgo](https://github.com/containers/psgo)

## Topics

* [Unit Tests](#unit-tests)
* [Go Dependency updates](#go-dependency-updates)
* [Testing changes in a dependent repository](#testing-changes-in-a-dependent-repository)
* [git bisect a change in a Go dependency](#git-bisect-a-change-in-a-go-dependency)
Expand All @@ -31,22 +30,29 @@ The bot automatically opens new PRs with updates that should be merged by mainta

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

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

Or to update it to the latest commit from main use:
```
$ go get github.com/containers/storage@main
$ go get go.podman.io/storage@main
```

This command will update the go.mod/go.sum files, because we use [go's vendor mechanism](https://go.dev/ref/mod#vendoring)
you must also update the files in the vendor dir. To do so use
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)
so there you must also update the files in the vendor dir. To do so use:
```
$ make vendor
```

If you are working in the [container-libs](https://github.com/containers/container-libs) monorepo use:
```
make tidy
```
This command syncs the dependency versions across all modules in the repo.


Then commit the changes and open a PR. If you want to add other changes it is recommended to keep the
dependency updates in their own commit as this makes reviewing them much easier.

Expand All @@ -57,16 +63,16 @@ dependencies to ensure all our tools use the same properly tested library versio

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

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

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

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

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

Expand Down