Skip to content

Generate beta and experimental APIs, guarded by Cargo features #161

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

Merged
merged 6 commits into from
Feb 16, 2021

Conversation

swallez
Copy link
Member

@swallez swallez commented Feb 12, 2021

Generates all APIs, including beta and experimental. Non-stable APIs are guarded by new Cargo features beta-apis and experimental-apis (which also includes beta).

This allows applications to only have access to stable APIs (as previously) by default, and opt-in for unstable APIs, at their own risk since they can change in subsequent releases.

This also fixes the yaml-test-runner that relies on the tasks apis that were previously incorrectly marked as stable and are now experimental.

@swallez swallez added the enhancement New feature or request label Feb 12, 2021
@swallez swallez self-assigned this Feb 12, 2021
@swallez swallez requested a review from russcam February 12, 2021 13:10
@swallez swallez force-pushed the generate-unstable-apis branch from 5a2aad1 to 47064c2 Compare February 14, 2021 19:25
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.

This is awesome @swallez, thanks for adding!

I think there's a few more changes that should be made before merging, mostly related to documentation:

  1. Add beta-apis and experimental-apis to the listed features in elasticsearch\lib.rs and the root README.md, and indicate what each means e.g. less stable, subject to change, experimental-apis includes beta APIs, etc.

  2. Add --all-features to tasks.docs in Makefile.toml so that documentation includes all beta and experimental APIs

  3. Include wording in the generated documentation for beta and experimental APIs that indicates they are beta and experimental, respectively, and how to enable. For example, for beta, something like

    /// # Optional
    /// This requires the `beta-apis` feature to be enabled
    

    Similar to what is done for Auth components

  4. Add namespace markdown files in api_generator\docs\namespaces for

    1. autoscaling
    2. eql
    3. logstash
    4. monitoring
    5. rollup
    6. searchable_snapshots
    7. text_structure
  5. Don't generate the data_frame_transform_deprecated namespace

#[cfg(feature = "beta-apis")]
#[derive(Debug, Clone, PartialEq)]
#[doc = "API parts for the Data Frame Transform Deprecated Delete Transform API"]
pub enum DataFrameTransformDeprecatedDeleteTransformParts<'b> {
Copy link
Contributor

Choose a reason for hiding this comment

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

The whole data_frame_transform_deprecated namespace should never be generated. Looking through, I think it's the only exception.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point! Looking at the Rest spec for this, It seems we could have a rule that filters out deprecated endpoints that are not stable (this namespace is deprecated as the feature has been implemented slightly differently as stable endpoints). If it proves to require significant changes I'll hard-code the exclusion and open an issue to implement it post-7.11.

@swallez
Copy link
Member Author

swallez commented Feb 15, 2021

Thanks for the review @russcam. All good points, I'll work on this, and also on the yaml tests that keep failing ;-)

@swallez
Copy link
Member Author

swallez commented Feb 15, 2021

@russcam I have addressed all your suggestions. Can you please cross-check?

There are still some failing yaml tests that I need to investigate, but this is unrelated to those changes

@swallez swallez force-pushed the generate-unstable-apis branch from 6816139 to e61cefd Compare February 15, 2021 22:47
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 - great effort on this PR, @swallez 🎉

@swallez swallez merged commit 269eed4 into elastic:master Feb 16, 2021
@swallez swallez deleted the generate-unstable-apis branch February 16, 2021 12:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request v7.11.0-alpha.1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants