-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Fix generator jobs for go modules #16288
Fix generator jobs for go modules #16288
Conversation
16ff9cc
to
efe5ff9
Compare
@@ -480,3 +481,35 @@ func main() { | |||
|
|||
When you're done with your new Beat, how about letting everyone know? Open | |||
a pull request to add your link to the {beats-ref}/community-beats.html[Community Beats] list. | |||
|
|||
[[newbeat-migrate-gomodules]] | |||
=== Migrate existing Beat to go modules |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@radoondas you may be interested on that 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ou yeah! This is something I will have a look once it is available! Thanks
Key: "beats_revision", | ||
Help: "Enter the github.com/elastic/beats revision", | ||
Default: func(cfg map[string]string) string { | ||
return "master" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we somehow reuse the versions in libbeat/docs/version.asciidoc
for this default? So if someone creates a new beat from 7.7 branch, 7.7 is used by default and so on.
Maybe we already have some helper in mage to access these versions.
038a10d
to
2d7b72f
Compare
Opened follow-up issue with possible improvements: #16555 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for opening the issue for the follow ups!
jenkins test this |
jenkins test this please |
jenkins retest this please |
3dbefdb
to
cc275ad
Compare
c6ce496
to
b9d1775
Compare
jenkins test this |
jenkins retest this please |
4895c92
to
3ec8e03
Compare
3ec8e03
to
67e8807
Compare
This comment is written to trigger a CLA check. |
* Set the correct path to `mage` for generator jobs * Generated beats use go modules for dependency management * New option `beats_revision` is added so users can select which beats revision they want to vendor * if one does not want to depend on `elastic/beats`, he/she needs to add the appropriate `replace` directive to the generated `go.mod` As Beats is moving to go modules for dependency management, generated Beats should use that as well. Documentation is provided to help users migrate to go modules in their own Beats. Also, about the new option. (cherry picked from commit a846029)
* Set the correct path to `mage` for generator jobs * Generated beats use go modules for dependency management * New option `beats_revision` is added so users can select which beats revision they want to vendor * if one does not want to depend on `elastic/beats`, he/she needs to add the appropriate `replace` directive to the generated `go.mod` As Beats is moving to go modules for dependency management, generated Beats should use that as well. Documentation is provided to help users migrate to go modules in their own Beats. Also, about the new option. (cherry picked from commit a846029)
What does this PR do?
mage
for generator jobsbeats_revision
is added so users can select which beats revision they want to vendorelastic/beats
, he/she needs to add the appropriatereplace
directive to the generatedgo.mod
Why is it important?
As Beats is moving to go modules for dependency management, generated Beats should use that as well.
Documentation is provided to help users migrate to go modules in their own Beats. Also, about the new option.
Checklist
How to test
Run the test which is executed by the jobs:
Then go to the generated beat and play around with the available make commands. For example run
make copyVendor
ormake create-metricseat
, etc.