Skip to content

[OAS] Promote space awareness in REST docs#230594

Merged
jloleysens merged 5 commits intoelastic:mainfrom
jloleysens:oas/promote-space-awareness
Aug 7, 2025
Merged

[OAS] Promote space awareness in REST docs#230594
jloleysens merged 5 commits intoelastic:mainfrom
jloleysens:oas/promote-space-awareness

Conversation

@jloleysens
Copy link
Contributor

@jloleysens jloleysens commented Aug 5, 2025

Summary

Copies the ES approach to specifying alternate paths in our docs. This is a best effort approach to providing docs users with information about each path's space alternative. Every path that is "spaces aware" will have the following call out in the description:

Screenshot 2025-08-06 at 10 11 24

Relates to: https://github.com/elastic/docs-content-internal/issues/40

@jloleysens jloleysens self-assigned this Aug 5, 2025
@jloleysens jloleysens requested a review from a team as a code owner August 5, 2025 14:01
@jloleysens jloleysens added Team:Core Platform Core services: plugins, logging, config, saved objects, http, ES client, i18n, etc t// release_note:skip Skip the PR/issue when compiling release notes Feature:OAS Work or issues related to Core-provided mechanisms for generating OAS backport:version Backport to applied version labels v8.19.0 v9.2.0 labels Aug 5, 2025
@elasticmachine
Copy link
Contributor

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

Comment on lines +39 to +41
function getSpaceAlternatePathHtml(method, path) {
return `<div><span class="operation-verb ${method.toLocaleLowerCase()}">${method}</span>&nbsp;<span class="operation-path">/s/{space_id}${path}</span></div>\n\nSee [spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.`;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@elasticmachine
Copy link
Contributor

⏳ Build in-progress, with failures

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #41 / Serverless Observability feature flag testing - Deployment-agnostic API integration tests SyntheticsCustomStatusRule NumberOfChecks - Location threshold > 1 - ungrouped - 2 down locations - recoveryStrategy: firstUp should be down again
  • [job] [logs] FTR Configs #41 / Serverless Observability feature flag testing - Deployment-agnostic API integration tests SyntheticsCustomStatusRule NumberOfChecks - Location threshold > 1 - ungrouped - 2 down locations - recoveryStrategy: firstUp should be down again

History

cc @jloleysens

Comment on lines +17 to +29
const NON_SPACE_PATH_PREFIXES = new Set([
'/api/upgrade_assistant',
'/api/logstash/pipeline',
'/api/logstash/pipelines',
'/api/task_manager/_health',
'/api/cases/reporters',
'/api/encrypted_saved_objects/_rotate_key',
'/api/short_url',
'/api/features',
'/api/security/role',
'/api/spaces',
'/api/security/session/_invalidate',
]).values();
Copy link
Contributor Author

@jloleysens jloleysens Aug 6, 2025

Choose a reason for hiding this comment

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

This is the "best effort" aspect. Based on where we did not mention the spaces alternative in our previous docs iterations. There may be a few paths this does not catch.

The other side-effect of this is that new paths will get the spaces alternative mentioned unless they are captured here. I think this is OK, but others may feel differently.

Copy link
Member

Choose a reason for hiding this comment

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

SGTM. I wonder if another downside is: if most endpoints have the extra Space awareness callout, maybe folks won't notice this subset.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, that's true. It's kind of a drop in the bucket. The most useful one to skip is probably /api/spaces... And come to think of it /api/status too. Will add these in #230931

Copy link
Contributor

@florent-leborgne florent-leborgne left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for the improvement! If possible I'd wait for @georgewallace's input since this work relates to https://github.com/elastic/docs-content-internal/issues/40

Copy link
Contributor

@szabosteve szabosteve left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for the temporary fix!

Comment on lines +17 to +29
const NON_SPACE_PATH_PREFIXES = new Set([
'/api/upgrade_assistant',
'/api/logstash/pipeline',
'/api/logstash/pipelines',
'/api/task_manager/_health',
'/api/cases/reporters',
'/api/encrypted_saved_objects/_rotate_key',
'/api/short_url',
'/api/features',
'/api/security/role',
'/api/spaces',
'/api/security/session/_invalidate',
]).values();
Copy link
Member

Choose a reason for hiding this comment

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

SGTM. I wonder if another downside is: if most endpoints have the extra Space awareness callout, maybe folks won't notice this subset.

@jloleysens jloleysens merged commit c9fedf5 into elastic:main Aug 7, 2025
12 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.19

https://github.com/elastic/kibana/actions/runs/16797879779

@kibanamachine
Copy link
Contributor

💔 All backports failed

Status Branch Result
8.19 Backport failed because of merge conflicts

Manual backport

To create the backport manually run:

node scripts/backport --pr 230594

Questions ?

Please refer to the Backport tool documentation

@jloleysens
Copy link
Contributor Author

💚 All backports created successfully

Status Branch Result
8.19

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

jloleysens added a commit to jloleysens/kibana that referenced this pull request Aug 7, 2025
(cherry picked from commit c9fedf5)

# Conflicts:
#	oas_docs/output/kibana.serverless.yaml
#	oas_docs/output/kibana.yaml
jloleysens added a commit that referenced this pull request Aug 7, 2025
gergoabraham pushed a commit to gergoabraham/kibana that referenced this pull request Aug 7, 2025
gergoabraham pushed a commit to gergoabraham/kibana that referenced this pull request Aug 7, 2025
denar50 pushed a commit to denar50/kibana that referenced this pull request Aug 8, 2025
jloleysens added a commit that referenced this pull request Aug 8, 2025
# Backport

This will backport the following commits from `main` to `8.19`:
- [[OAS] Promote space awareness in REST docs
(#230594)](#230594)

<!--- Backport version: 10.0.1 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Jean-Louis
Leysens","email":"jeanlouis.leysens@elastic.co"},"sourceCommit":{"committedDate":"2025-08-07T07:22:09Z","message":"[OAS]
Promote space awareness in REST docs
(#230594)","sha":"c9fedf5dc26f1a9ec437ebb10ca72abae191d876","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Core","release_note:skip","Feature:OAS","backport:version","v8.19.0","v9.2.0"],"title":"[OAS]
Promote space awareness in REST
docs","number":230594,"url":"https://github.com/elastic/kibana/pull/230594","mergeCommit":{"message":"[OAS]
Promote space awareness in REST docs
(#230594)","sha":"c9fedf5dc26f1a9ec437ebb10ca72abae191d876"}},"sourceBranch":"main","suggestedTargetBranches":["8.19"],"targetPullRequestStates":[{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/230594","number":230594,"mergeCommit":{"message":"[OAS]
Promote space awareness in REST docs
(#230594)","sha":"c9fedf5dc26f1a9ec437ebb10ca72abae191d876"}}]}]
BACKPORT-->

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Michael Dokolin <dokmic@gmail.com>
NicholasPeretti pushed a commit to NicholasPeretti/kibana that referenced this pull request Aug 18, 2025
NicholasPeretti pushed a commit to NicholasPeretti/kibana that referenced this pull request Aug 18, 2025
jloleysens added a commit to jloleysens/kibana that referenced this pull request Sep 10, 2025
## Summary

Follow up on elastic#230594

(cherry picked from commit 0fb028c)

# Conflicts:
#	oas_docs/output/kibana.serverless.yaml
#	oas_docs/output/kibana.yaml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:version Backport to applied version labels Feature:OAS Work or issues related to Core-provided mechanisms for generating OAS release_note:skip Skip the PR/issue when compiling release notes Team:Core Platform Core services: plugins, logging, config, saved objects, http, ES client, i18n, etc t// v8.19.0 v8.19.1 v9.2.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants