Skip to content

Migrate ReferenceDocs resource to plain text#113866

Merged
DaveCTurner merged 4 commits intoelastic:mainfrom
DaveCTurner:2024/10/01/ReferenceDocs-plain-text
Oct 2, 2024
Merged

Migrate ReferenceDocs resource to plain text#113866
DaveCTurner merged 4 commits intoelastic:mainfrom
DaveCTurner:2024/10/01/ReferenceDocs-plain-text

Conversation

@DaveCTurner
Copy link
Copy Markdown
Member

Removes the dependency on XContent parsing so we can move this out of
:server and into :libs:core.

Removes the dependency on `XContent` parsing so we can move this out of
`:server` and into `:libs:core`.
@DaveCTurner DaveCTurner added >non-issue :Core/Infra/Core Core issues without another label Supportability Improve our (devs, SREs, support eng, users) ability to troubleshoot/self-service product better. v8.16.0 v9.0.0 labels Oct 1, 2024
@DaveCTurner DaveCTurner requested a review from rjernst October 1, 2024 13:06
@elasticsearchmachine elasticsearchmachine added the Team:Core/Infra Meta label for core/infra team label Oct 1, 2024
@elasticsearchmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-core-infra (Team:Core/Infra)

@thecoop
Copy link
Copy Markdown
Member

thecoop commented Oct 1, 2024

I've previously used csv for the releaseversions mapping files - I think csv is a bit more obvious that the structure matters than whitespace?

@DaveCTurner
Copy link
Copy Markdown
Member Author

CSV is more painful to edit by hand (or in IntelliJ) than plain text. The parsing is very strict, it will be obvious that the structure matters pretty quickly if you get it wrong.

@thecoop
Copy link
Copy Markdown
Member

thecoop commented Oct 1, 2024

Is it that much more painful? Here, it's just a comma between the two fields. The number of spaces is somewhat arbitrary, and could cause spurious parsing errors. And csv is consistent with the other text storage files we've used

@DaveCTurner
Copy link
Copy Markdown
Member Author

The number of spaces is somewhat arbitrary, and could cause spurious parsing errors.

The spacing is not arbitrary and the parsing errors are not spurious - the strictness in this area is 100% deliberate.

CSV is not totally trivial to parse (it supports quoted strings, and escaped commas, etc etc) so I'd want to defer that work to a library instead of hand-rolling it. But the whole point of this change is to eliminate dependencies from this code so we can move it to :libs:core.

@DaveCTurner
Copy link
Copy Markdown
Member Author

Also note that we are expecting the Docs build to parse this file independently, and that's written in Perl; this format is very easy to parse with Perl's regexes whereas a CSV (with quotes and escaping) would add complexity there too.

@thecoop
Copy link
Copy Markdown
Member

thecoop commented Oct 1, 2024

Ah, I wasn't going with full CSV, I was just going with a comma , as a separator instead of spaces needing padding - see https://github.com/elastic/elasticsearch/blob/main/server/src/main/java/org/elasticsearch/ReleaseVersions.java#L45

@DaveCTurner
Copy link
Copy Markdown
Member Author

Yeah I'd rather have spaces here. It matters less when all the values are symbols of almost the same length.

Copy link
Copy Markdown
Member

@rjernst rjernst left a comment

Choose a reason for hiding this comment

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

LGTM, one nit but I don't feel very strongly about it.

BOOTSTRAP_CHECK_CLIENT_JVM bootstrap-checks-client-jvm.html
BOOTSTRAP_CHECK_USE_SERIAL_COLLECTOR bootstrap-checks-serial-collector.html
BOOTSTRAP_CHECK_SYSTEM_CALL_FILTER bootstrap-checks-syscall-filter.html
BOOTSTRAP_CHECK_ONERROR_AND_ONOUTOFMEMORYERROR bootstrap-checks-onerror.html
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The max length for padding seems like it will get overrun. Can we start with larger padding to limit having to reformat this file in the future?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fair point. Increased to 64 because that ought to be enough for anybody ;)

@DaveCTurner DaveCTurner merged commit eb9b897 into elastic:main Oct 2, 2024
@DaveCTurner DaveCTurner deleted the 2024/10/01/ReferenceDocs-plain-text branch October 2, 2024 13:32
@elasticsearchmachine
Copy link
Copy Markdown
Collaborator

💔 Backport failed

Status Branch Result
8.x Commit could not be cherrypicked due to conflicts

You can use sqren/backport to manually backport by running backport --upstream elastic/elasticsearch --pr 113866

DaveCTurner added a commit to DaveCTurner/elasticsearch that referenced this pull request Oct 2, 2024
Removes the dependency on `XContent` parsing so we can move this out of
`:server` and into `:libs:core`.

Backport of elastic#113866 to `8.x`
stefnestor added a commit to stefnestor/elasticsearch that referenced this pull request Oct 2, 2024
gmarouli pushed a commit to gmarouli/elasticsearch that referenced this pull request Oct 3, 2024
Removes the dependency on `XContent` parsing so we can move this out of
`:server` and into `:libs:core`.
stefnestor added a commit that referenced this pull request Oct 3, 2024
* Add link to CircuitBreaker exception message

* Account #113866

* Update docs/changelog/113561.yaml
elasticsearchmachine pushed a commit that referenced this pull request Oct 3, 2024
Removes the dependency on `XContent` parsing so we can move this out of
`:server` and into `:libs:core`.

Backport of #113866 to `8.x`
matthewabbott pushed a commit to matthewabbott/elasticsearch that referenced this pull request Oct 4, 2024
Removes the dependency on `XContent` parsing so we can move this out of
`:server` and into `:libs:core`.
matthewabbott pushed a commit to matthewabbott/elasticsearch that referenced this pull request Oct 4, 2024
…ic#113561)

* Add link to CircuitBreaker exception message

* Account elastic#113866

* Update docs/changelog/113561.yaml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Core/Infra/Core Core issues without another label >non-issue Supportability Improve our (devs, SREs, support eng, users) ability to troubleshoot/self-service product better. Team:Core/Infra Meta label for core/infra team v8.16.0 v9.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants