-
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
Replace generate_imports python script with mage imports #14498
Conversation
Signed-off-by: chrismark <[email protected]>
Signed-off-by: chrismark <[email protected]>
Signed-off-by: chrismark <[email protected]>
Signed-off-by: chrismark <[email protected]>
Signed-off-by: chrismark <[email protected]>
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.
Yet another python script in the way to be removed 😃
Signed-off-by: chrismark <[email protected]>
Signed-off-by: chrismark <[email protected]>
Signed-off-by: chrismark <[email protected]>
Signed-off-by: chrismark <[email protected]>
Signed-off-by: chrismark <[email protected]>
Signed-off-by: chrismark <[email protected]>
Signed-off-by: chrismark <[email protected]>
if err != nil { | ||
return errors.Wrap(err, "error gettting current directory") | ||
} | ||
return sh.Run("ln", "-sf", filepath.Join(pwd, vendorPath, "elastic/beats/metricbeat/scripts/generate_imports_helper.py"), filepath.Join(pwd, vendorPath, "elastic/beats/script/generate_imports_helper.py")) |
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.
This is sth which requires a careful look, not sure if it's ok to remove. Maybe @fearful-symmetry can comment here.
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.
The new go generator has its own code for linking that, so I'm not sure what's using this?
beats/generator/common/beatgen/setup/setup.go
Lines 55 to 62 in 72f2bf9
func LinkImportsHelper() error { | |
vendorPath := "./vendor/github.com/" | |
pwd, err := os.Getwd() | |
if err != nil { | |
return errors.Wrap(err, "error gettting current directory") | |
} | |
return sh.Run("ln", "-sf", filepath.Join(pwd, vendorPath, "elastic/beats/metricbeat/scripts/generate_imports_helper.py"), filepath.Join(pwd, vendorPath, "elastic/beats/script/generate_imports_helper.py")) | |
} |
Signed-off-by: chrismark <[email protected]>
(cherry picked from commit 6b46c29)
This PR tries to refactor and unify the way we create
include/list.go
files. This came after we moved light modules to OSS and while trying to create a light module under OSS. In that case this module will be included inlist.go
file despite the fact that it has no.go
files. This was not a problem when light modules where underx-pack
because there thelist.go
was created bymage
and the script was taking into consideration the existence of.go
files in a module so as to decide if it should be included inlist.go
.So far we had:
x-pack
way: https://github.com/elastic/beats/blob/master/x-pack/metricbeat/magefile.go#L128oss
way: https://github.com/elastic/beats/blob/master/metricbeat/Makefile#L46This PR refactors the OSS part so as to make use of the
mage
respective target likewisex-pack
.cc: @jsoriano , @exekias