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

[Versioned APIs] Versioned interfaces dev docs guide #150705

Merged
merged 25 commits into from
Mar 1, 2023

Conversation

jloleysens
Copy link
Contributor

@jloleysens jloleysens commented Feb 9, 2023

Summary

Adds a dev docs guide for the core-approved versioning strategy. This strategy is subject to some iteration but is based on the work we did for the Saved Objects Management plugin in #149495.

Closes #149929

How to test

  1. Run ./scripts/dev_docs.sh
  2. Navigate to "Versioning interfaces" in the side nav menu

@jloleysens jloleysens added Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc release_note:skip Skip the PR/issue when compiling release notes backport:skip This commit does not require backporting docs DevDocs v8.8.0 labels Feb 9, 2023
@jloleysens jloleysens marked this pull request as ready for review February 9, 2023 14:25
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-core (Team:Core)

Copy link
Member

@lukeelmers lukeelmers left a comment

Choose a reason for hiding this comment

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

The example here makes sense to me. I think what will really help folks reading these docs is when we can show how it would tie into a versioned API, e.g. show a couple route handlers.

But we'll need to have clarity on our versioning strategy first, unless we want to try to design a helper for apps to use which could abstract away the need to know how exactly the versions are being implemented in a given request. Dunno how much thought we've given to this yet so it may not be possible at this stage, just throwing the idea out there. Edit: Almost forgot we had done an exploratory design for what a versioned router would look like.

dev_docs/tutorials/versioning_interfaces.mdx Outdated Show resolved Hide resolved
dev_docs/tutorials/versioning_interfaces.mdx Outdated Show resolved Hide resolved
jloleysens and others added 2 commits February 15, 2023 12:19
Co-authored-by: Luke Elmers <lukeelmers@gmail.com>
Co-authored-by: Luke Elmers <lukeelmers@gmail.com>
@jloleysens
Copy link
Contributor Author

have clarity on our versioning strategy first, unless we want to try to design a helper for apps to use which could abstract away the need to know how exactly the versions are being implemented in a given request

Yeah I agree. I've been working on some types-only designs for how a helper like this might look that I'm hoping to get feedback on: #149943

Do you think we should rather have a fuller picture of the router + client in place before merging something like this to main? Perhaps adding "[Draft]" to the title of the guide could be a good middle-ground?

Copy link
Member

@lukeelmers lukeelmers left a comment

Choose a reason for hiding this comment

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

Do you think we should rather have a fuller picture of the router + client in place before merging something like this to main?

IMO there is no need to hold merging this as it can always be updated as we know more. My point was just that I think it'll be easier for teams to grasp once they can see a complete end-to-end example.

dev_docs/tutorials/versioning_interfaces.mdx Outdated Show resolved Hide resolved
dev_docs/tutorials/versioning_interfaces.mdx Outdated Show resolved Hide resolved
dev_docs/tutorials/versioning_interfaces.mdx Outdated Show resolved Hide resolved
import type { DataSource } from '../data_source/v2';

// Optionally, re-export the entire set of types.
export * from './v1';
Copy link
Contributor

Choose a reason for hiding this comment

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

Would the re-export be overriden by any interface below it with the same name?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, exactly that

@jloleysens jloleysens changed the title [Versioned APIs] Dev docs guide [Versioned APIs] Versioned interfaces dev docs guide Feb 22, 2023
@jloleysens jloleysens self-assigned this Feb 23, 2023
Copy link
Contributor

@pgayvallet pgayvallet left a comment

Choose a reason for hiding this comment

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

As @afharo already expressed, most (all?) interfaces from the examples are missing the export keyword.

Apart from that, the examples looks good to me, and I think it could be considered a fine initial documentation.

@jloleysens jloleysens merged commit 570eb38 into elastic:main Mar 1, 2023
@jloleysens jloleysens deleted the versioning-apis-dev-doc-guide branch March 1, 2023 15:45
bmorelli25 pushed a commit to bmorelli25/kibana that referenced this pull request Mar 10, 2023
## Summary

Adds a dev docs guide for the core-approved versioning strategy. This
strategy is subject to some iteration but is based on the work we did
for the Saved Objects Management plugin in
elastic#149495.

Closes elastic#149929

## How to test

1. Run `./scripts/dev_docs.sh`
2. Navigate to "Versioning interfaces" in the side nav menu

---------

Co-authored-by: Luke Elmers <lukeelmers@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting ci:build-next-docs DevDocs docs release_note:skip Skip the PR/issue when compiling release notes Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc v8.8.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[API versioning] Document TS interface versioning as dev guide
8 participants