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

Replace glide vendoring with govendor #3843

Closed
wants to merge 1 commit into from
Closed

Conversation

ruflin
Copy link
Member

@ruflin ruflin commented Mar 29, 2017

Glide is currently broken in the beats repo and adding dependencies is painful. I initially tried out dep (https://github.com/golang/dep) but it is not working with our nested vendor directories as it always tries to do auto discovery. It is not possible to add a single package at the moment. I would like to stick with local vendor directories as it allows to build modules outside of metricbeat for example and add a module by just copy/pasting the directory.

govendor allows to exactly do that but also allows to use autodiscovery if needed. One nice part about govendor is that it also strips testing files etc. from the repo and allows only import a package and not necessarily the full repository.

In a first step I'm using govendor for the mysql metricbeat module. In a second step, all dependencies have to be added with govendor.

The following command is used to add a dependency:

govendor fetch github.com/go-sql-driver/mysql@v1.3

Further changes:

  • A vendor.json file was already in the top vendor directory. It seems it was commited in the past by accident. The file is removed.
  • Mysql dependency is fixed to version 1.3. It was not fixed to a version before.
  • glide.yaml in mysql directory removed

@ruflin ruflin added libbeat Metricbeat Metricbeat review discuss Issue needs further discussion. labels Mar 29, 2017
Glide is currently broken in the beats repo and adding dependencies is painful. I initially tried out `dep` (https://github.com/golang/dep) but it is not working with our nested vendor directories as it always tries to do auto discovery. It is not possible to add a single package at the moment. I would like to stick with local vendor directories as it allows to build modules outside of metricbeat for example and add a module by just copy/pasting the directory.

govendor allows to exactly do that but also allows to use autodiscovery if needed. One nice part about govendor is that it also strips testing files etc. from the repo and allows only import a package and not necessarily the full repository.

In a first step I'm using govendor for the mysql metricbeat module. In a second step, all dependencies have to be added with govendor.

The following command is used to add a dependency:
```
govendor fetch github.com/go-sql-driver/mysql@v1.3
```

Further changes:
* A `vendor.json` file was already in the top vendor directory. It seems it was commited in the past by accident. The file is removed.
* Mysql dependency is fixed to version 1.3. It was not fixed to a version before.
* glide.yaml in mysql directory removed
@ruflin
Copy link
Member Author

ruflin commented Mar 31, 2017

Closing in favor of #3851

@ruflin ruflin closed this Mar 31, 2017
@ruflin ruflin deleted the govendor branch March 31, 2017 06:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discuss Issue needs further discussion. libbeat Metricbeat Metricbeat review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant