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

Add dependencies with v2 or bigger major versions #16100

Merged
merged 2 commits into from
Feb 7, 2020

Conversation

kvch
Copy link
Contributor

@kvch kvch commented Feb 5, 2020

What does this PR do?

The PR adds the major version to the import paths of modules which have major versions bigger than one.

The following modules are impacted:

  • github.com/coreos/go-systemd is updated to use v22
  • github.com/cespare/xxhash is updated to use v2

Why is it important?

We have a few dependencies with a major version bigger than v1. These modules include the major version in the import path. In order to include the correct dependencies, one needs to add the major version of the module to go.mod.

Keep in mind that every time we update a dependency to a newer major version, we need to follow-up in the import paths in our source.

Checklist

  • My code follows the style guidelines of this project
    - [ ] I have commented my code, particularly in hard-to-understand areas
    - [ ] I have made corresponding changes to the documentation
    - [ ] I have made the corresponding change to the default configuration files
    - [ ] I have added tests that prove my fix is effective or that my feature works

Related issues

@kvch kvch added [zube]: In Progress Team:Services (Deprecated) Label for the former Integrations-Services team labels Feb 5, 2020
@kvch kvch requested review from a team as code owners February 5, 2020 09:05
@kvch kvch mentioned this pull request Feb 5, 2020
18 tasks
@kvch kvch force-pushed the find-correct-major-versions branch from 3cfd6b6 to 1cdbace Compare February 5, 2020 10:15
@@ -22,7 +22,7 @@ package instance
import (
"fmt"

"github.com/coreos/go-systemd/sdjournal"
"github.com/coreos/go-systemd/v22/sdjournal"
Copy link
Member

Choose a reason for hiding this comment

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

Is go-systemd changing the import path on any release? It seems rather inconvenient.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is going to be inconvenient for us every time we update a major release with go modules. At least they are adopting the modules approach, not like a few of our dependencies. :)

@kvch kvch force-pushed the find-correct-major-versions branch from 1cdbace to 3215e84 Compare February 6, 2020 12:51
@kvch kvch force-pushed the find-correct-major-versions branch from 3215e84 to 91445e8 Compare February 6, 2020 13:00
@@ -15,7 +15,7 @@ import (
"strconv"
"time"

"github.com/cespare/xxhash"
xxhash "github.com/cespare/xxhash/v2"
Copy link

Choose a reason for hiding this comment

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

is the "rename" of v2 to xxhash required? Is it added by automation? If a package only imports vX I think one can ommit the renaming part.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No. For some reason goimports kept removing the line until I added the alias. But now I am able to remove it. So I assume it was some kind of PEBKAC. So I removed thos now.

@kvch
Copy link
Contributor Author

kvch commented Feb 7, 2020

No new errors has been introduced, merging.

@kvch kvch merged commit b4577d2 into elastic:go-modules Feb 7, 2020
kvch added a commit that referenced this pull request Feb 26, 2020
## What does this PR do?

The PR adds the major version to the import paths of modules which have major versions bigger than one.

The following modules are impacted:

- `github.com/coreos/go-systemd` is updated to use `v22`
- `github.com/cespare/xxhash` is updated to use `v2`

## Why is it important?

We have a few dependencies with a major version bigger than v1. These modules include the major version in the import path. In order to include the correct dependencies, one needs to add the major version of the module to `go.mod`.

Keep in mind that every time we update a dependency to a newer major version, we need to follow-up in the import paths in our source.
kvch added a commit that referenced this pull request Feb 27, 2020
## What does this PR do?

The PR adds the major version to the import paths of modules which have major versions bigger than one.

The following modules are impacted:

- `github.com/coreos/go-systemd` is updated to use `v22`
- `github.com/cespare/xxhash` is updated to use `v2`

## Why is it important?

We have a few dependencies with a major version bigger than v1. These modules include the major version in the import path. In order to include the correct dependencies, one needs to add the major version of the module to `go.mod`.

Keep in mind that every time we update a dependency to a newer major version, we need to follow-up in the import paths in our source.
kvch added a commit that referenced this pull request Feb 28, 2020
## What does this PR do?

The PR adds the major version to the import paths of modules which have major versions bigger than one.

The following modules are impacted:

- `github.com/coreos/go-systemd` is updated to use `v22`
- `github.com/cespare/xxhash` is updated to use `v2`

## Why is it important?

We have a few dependencies with a major version bigger than v1. These modules include the major version in the import path. In order to include the correct dependencies, one needs to add the major version of the module to `go.mod`.

Keep in mind that every time we update a dependency to a newer major version, we need to follow-up in the import paths in our source.
kvch added a commit that referenced this pull request Mar 2, 2020
## What does this PR do?

The PR adds the major version to the import paths of modules which have major versions bigger than one.

The following modules are impacted:

- `github.com/coreos/go-systemd` is updated to use `v22`
- `github.com/cespare/xxhash` is updated to use `v2`

## Why is it important?

We have a few dependencies with a major version bigger than v1. These modules include the major version in the import path. In order to include the correct dependencies, one needs to add the major version of the module to `go.mod`.

Keep in mind that every time we update a dependency to a newer major version, we need to follow-up in the import paths in our source.
kvch added a commit that referenced this pull request Mar 3, 2020
## What does this PR do?

The PR adds the major version to the import paths of modules which have major versions bigger than one.

The following modules are impacted:

- `github.com/coreos/go-systemd` is updated to use `v22`
- `github.com/cespare/xxhash` is updated to use `v2`

## Why is it important?

We have a few dependencies with a major version bigger than v1. These modules include the major version in the import path. In order to include the correct dependencies, one needs to add the major version of the module to `go.mod`.

Keep in mind that every time we update a dependency to a newer major version, we need to follow-up in the import paths in our source.
leweafan pushed a commit to leweafan/beats that referenced this pull request Apr 28, 2023
## What does this PR do?

The PR adds the major version to the import paths of modules which have major versions bigger than one.

The following modules are impacted:

- `github.com/coreos/go-systemd` is updated to use `v22`
- `github.com/cespare/xxhash` is updated to use `v2`

## Why is it important?

We have a few dependencies with a major version bigger than v1. These modules include the major version in the import path. In order to include the correct dependencies, one needs to add the major version of the module to `go.mod`.

Keep in mind that every time we update a dependency to a newer major version, we need to follow-up in the import paths in our source.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team:Services (Deprecated) Label for the former Integrations-Services team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants