elastic / elastic/docs-builder

[Feature Request]: Throw error when version is invalid in `applies_to`

Open
#2,094 9 comments 0 reactions 0 assignees View on GitHub
ai-triaged ai:writer-question bug cumulative_docs needs triage
Dominant language
C#
Stars
24
Forks
44
Avg merge
1d 7h
Merged PRs (30d)
146

Description

### Prerequisites

- [x] I have searched existing issues to ensure this feature hasn't already been requested
- [x] I have tested using the latest version of docs-builder

### What problem are you trying to solve?

Currently if a version is invalid (not semver), we just hide the version altogether without throwing an error, warning, or hint. This is causing the docs to be inaccurate. For example, [this functionality](https://www.elastic.co/docs/explore-analyze/elastic-inference/inference-api#recursive) was added in 9.1, but because the [version in the source file is invalid](https://github.com/elastic/docs-content/blob/main/explore-analyze/elastic-inference/inference-api.md?plain=1#L161), there's nothing to communicate to users that this is only available in 9.1 and later.

### Proposed Solution

We should throw an error or warning when a version is invalid so the user is aware.

### Examples and Research

_No response_

### Alternative Solutions

_No response_

### Additional Context

There are currently 3 instances across docs the following repos / files that use invalid versions in `applies_to`.

- [x] integration-docs: `docs/reference/cloud_asset_inventory.md` https://github.com/elastic/integration-docs/pull/928
- [x] docs-content: `explore-analyze/elastic-inference/inference-api.md` https://github.com/elastic/docs-content/pull/3613

I can fix these at the source. 🙂

### How important is this feature to you?

Important

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.