Skip to content

Move more parts of make check to mage#13239

Merged
jsoriano merged 15 commits intoelastic:masterfrom
jsoriano:make-check-dashboards
Aug 16, 2019
Merged

Move more parts of make check to mage#13239
jsoriano merged 15 commits intoelastic:masterfrom
jsoriano:make-check-dashboards

Conversation

@jsoriano
Copy link
Copy Markdown
Member

Use mage implementation for make check in directories
where make is still being used. Fix issues detected in
dashboards and in dev-tools directory, that was not
being checked. DashboardsFormat renamed to
CheckDashboardsFormat to be more explicit and
coherent with other check sub-targets.

Continues dashboard checking started in #13168.

License header targets are not migrated here, migration
in progesss in #13215.

@jsoriano jsoriano added review :Testing Team:Integrations Label for the Integrations team labels Aug 14, 2019
@jsoriano jsoriano requested review from a team as code owners August 14, 2019 11:47
@jsoriano jsoriano self-assigned this Aug 14, 2019
Copy link
Copy Markdown
Contributor

@kaiyan-sheng kaiyan-sheng left a comment

Choose a reason for hiding this comment

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

I just realized now all the dashboard screenshots are not up to date 😬 Just the names of the visualizations are different so hopefully it's ok.

@jsoriano
Copy link
Copy Markdown
Member Author

I just realized now all the dashboard screenshots are not up to date grimacing Just the names of the visualizations are different so hopefully it's ok.

I also hope this is ok 😬 I wouldn't change all the screenshots now.

Dashboards using custom titles for visualizations wouldn't be affected, but not all of them are using this feature.

@andrewkroh
Copy link
Copy Markdown
Member

I left a similar comment in #13215, I think it would be nice to add this to dev-tools/mage/target/common and then update each project to

import (
...

	// mage:import
	_ "github.com/elastic/beats/dev-tools/mage/target/common"
)

which will help reduce duplication.

@jsoriano
Copy link
Copy Markdown
Member Author

@andrewkroh I had tried, but I found some conflicting targets, and that Check depended on Update in some magefiles, so I postponed it. But now checking again I have discovered RegisterCheckDeps() to inject the Updates. So with this, and removing the conflicting targets, all good 🙂

All magefiles use the common targets now.

Once we have this merged I will update #13215, that has more things.

@jsoriano jsoriano force-pushed the make-check-dashboards branch from 5b58e5b to 69207d6 Compare August 15, 2019 18:28
Copy link
Copy Markdown
Member

@andrewkroh andrewkroh left a comment

Choose a reason for hiding this comment

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

Nice work!

Comment thread filebeat/magefile.go Outdated
@jsoriano
Copy link
Copy Markdown
Member Author

@andrewkroh there were a couple of legit issues in CI, I think I have solved them. One was caused by the different python envs mage and make use under the same PYTHON_ENV. This may need another quick review.

Comment thread libbeat/scripts/Makefile Outdated
@jsoriano jsoriano merged commit 95efa5f into elastic:master Aug 16, 2019
@jsoriano jsoriano deleted the make-check-dashboards branch August 16, 2019 14:05
DStape pushed a commit to DStape/beats that referenced this pull request Aug 20, 2019
Use mage implementation for make check in directories
where make is still being used. Fix issues detected in
dashboards and in dev-tools directory, that was not
being checked. DashboardsFormat renamed to
CheckDashboardsFormat to be more explicit and
coherent with other check sub-targets.
Common targets are now reused when possible.

Continues dashboard checking started in elastic#13168.
@jalvz
Copy link
Copy Markdown
Contributor

jalvz commented Aug 27, 2019

Hey, this change broke apm-server.
I understand that it can be hard to remember what might break apm-server, but https://beats-ci.elastic.co/job/elastic+apm-server+master+beats-update/ runs periodically on master and should provide feedback.
Now, it looks like that job is permanently broken... did anyone raise the alarm, or it is not really being used?

Would it be better to run that job on every pr touching libbeat code instead?

@jsoriano
Copy link
Copy Markdown
Member Author

Hey @jalvz,

I am very sorry. Actually I didn't know (or remember) that there was a build of apm-server running with the last version of libbeat.

I can take a look to what is failing after this PR if nobody is working on it, or I can help if someone is already on it.

Would it be better to run that job on every pr touching libbeat code instead?

This would be something to discuss, but it would be definitely helpful to have some way of knowing when libbeat breaks apm-server builds.

@jalvz
Copy link
Copy Markdown
Contributor

jalvz commented Aug 27, 2019

No worries, that is understandable - it is why i suggest to run it on libbeat prs (also for future beats contributors, etc)

it would be definitely helpful to have some way of knowing when libbeat breaks apm-server builds.

The conservative answer is that breaking changes on a libbeat Makefile or exported functions might break us. It practical terms, most of the times it happens with make / mage changes.

The only automated way we have to check is by running on beats CI the same command we run locally to update beats. Adding that stage would bump build times ~15 minutes, that is why you have it running only on master - but then it can get forgotten about.

Maybe a good middle ground is to trigger that stage only upon changes on devtools/mage* and libbeat/scripts/Makefile

What do you think?

@jsoriano
Copy link
Copy Markdown
Member Author

The only automated way we have to check is by running on beats CI the same command we run locally to update beats. Adding that stage would bump build times ~15 minutes, that is why you have it running only on master - but then it can get forgotten about.

I guess this can be run in parallel, so it doesn't affect the total time of builds.

Maybe a good middle ground is to trigger that stage only upon changes on devtools/mage* and libbeat/scripts/Makefile

What do you think?

That sounds reasonable, this way we'd force ourselves to make changes in a more backwards compatible way.

jsoriano added a commit to jsoriano/beats that referenced this pull request Oct 22, 2019
`mage:import` doesn't take into account vendorized dependencies, this is a
problen for custom beats, because by default they have libbeat as a
vendorized dependency. The solution would be to use go modules, but in
the meantime lets remove the use of `mage:import` from the magefiles
intended to be used by custom beats.

Revert part of elastic#13239 related to custom beats.
jsoriano added a commit that referenced this pull request Oct 25, 2019
`mage:import` doesn't take into account vendorized dependencies, this is a
problen for custom beats, because by default they have libbeat as a
vendorized dependency. The solution would be to use go modules, but in
the meantime lets remove the use of `mage:import` from the magefiles
intended to be used by custom beats.

Revert part of #13239 related to custom beats.
leweafan pushed a commit to leweafan/beats that referenced this pull request Apr 28, 2023
`mage:import` doesn't take into account vendorized dependencies, this is a
problen for custom beats, because by default they have libbeat as a
vendorized dependency. The solution would be to use go modules, but in
the meantime lets remove the use of `mage:import` from the magefiles
intended to be used by custom beats.

Revert part of elastic#13239 related to custom beats.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review Team:Integrations Label for the Integrations team :Testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants