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

Fix build #185

Merged
merged 5 commits into from
Sep 6, 2021
Merged

Fix build #185

merged 5 commits into from
Sep 6, 2021

Conversation

swallez
Copy link
Member

@swallez swallez commented Sep 1, 2021

This updates the build system to handle the recent changes in Elasticsearch:

  • rest api specs and yaml test definitions are now downloadable artifacts available at artifacts.elastic.co
  • ES security is on by default, meaning we have to use authentication also for tests of the free tier APIs.

Client code has also been updated to the latest 8.0.0-SNAPSHOT APIs.

The code that downloads artifacts is in a new xtask package that follows the cargo-xtasks conventions, derived from the "Make your own make" blog post. The logic to download artifacts is complex enough that it doesn't fit as a script in Make.toml, and is therefore implemented as a CLI tool that is exposed as a task in Make.toml.

Note: utimately we may consider refactoring all of Make.toml to xtask. cargo-make is a nice platform-independent alternative to make but it comes with its own weight and as the makefile grows it starts to be hard to read and navigate. Transitioning to "real code" with the help of a few crates that ease external process management may actually be more maintainable.

@swallez swallez requested a review from russcam September 1, 2021 13:22
@swallez swallez self-assigned this Sep 1, 2021
Copy link
Contributor

@russcam russcam left a comment

Choose a reason for hiding this comment

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

LGTM 👍

I left a suggestion for a small typo.

Also looks like api_generator/docs/namespaces needs fleet.md and shutdown.md doc files

2021-09-06 09:40:40,074 WARN  [api_generator::generator::output] Missing docs file Some("./api_generator/docs\\namespaces\\fleet.md")
2021-09-06 09:40:40,084 WARN  [api_generator::generator::output] Missing docs file Some("./api_generator/docs\\namespaces\\shutdown.md")

Makefile.toml Outdated Show resolved Hide resolved
@@ -9,9 +9,9 @@ edition = "2018"
license = "Apache-2.0"

[dependencies]
anyhow = "1.0"
Copy link
Contributor

Choose a reason for hiding this comment

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

Does anyhow have some clear advantages over failure?

Copy link
Member Author

Choose a reason for hiding this comment

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

Failure has been deprecated and now suggests anyhow as a replacement. They are somehow similar, although I understand it anyhow uses the recent changes in the sdtlib's Error trait. But now that failure is deprecated we have to migrate away from it.

@swallez swallez merged commit 0bb691f into elastic:master Sep 6, 2021
description = '''Download Rest API specs and YAML tests'''
private = true
command = "cargo"
# cargo-make insists on installing cargo-xtask and ignores .cargo/config.toml
Copy link
Contributor

Choose a reason for hiding this comment

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

@swallez you can disable it by adding:
install_crate = false
see more details at:
https://github.com/sagiegurari/cargo-make#cargo-plugins

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for the hint @sagiegurari!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants