Skip to content

GH: Add action to build 9.x series plugin docs #1826

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

Closed
wants to merge 5 commits into from

Conversation

karenzone
Copy link
Contributor

@karenzone karenzone commented Mar 19, 2025

Related: elastic/docs-tools#110

Heavy lifting for plugin generation is handled by plugindocs.rb. The GitHub action is where we reach out to the logstash repo looking for LSR doc files.

Backstory

Until recently, the generated Logstash plugins docs were pulled in with :include: statements and built as part of the Logstash Reference (logstash repo). File format = asciidoc.

With the introduction of the new Elastic doc build system, we converted the Logstash Reference docs source to MD. This change breaks our ability to generate Logstash plugin docs for 9.x and main.

This PR preserves existing GitHub action behavior for 8.x and earlier doc generation, and adds a new GitHub action to generate docs for 9.x and .main.

New: "Plugin docgen for specified 9.0 and later"
Renamed: "Plugin docgen for specified 8.x and earlier"

Note: Both GitHub actions still generate output in ADOC format. For 9.0 and later, the migration to MD will be a subsequent process. Check out [Research] Use a GitHub action as a wrapper for migration tooling #10 for an idea.

bundle exec ruby plugindocs.rb --skip-existing --output-path ../logstash-docs ../logstash/plugins_version_docs.json
- name: Build docs
working-directory: ./logstash
run: ../docs/build_docs --asciidoctor --respect_edit_url_overrides --doc docs/index.asciidoc --resource=../logstash-docs/docs/ --chunk 1 # sub in new V3 build command
Copy link
Contributor Author

@karenzone karenzone Mar 19, 2025

Choose a reason for hiding this comment

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

Sub in new V3 build command

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We're still building this repo in ADOC, so this shouldn't be a V3 command.
Tweaked in latest commit.

@karenzone
Copy link
Contributor Author

@bmorelli25 For evaluation/consideration.

@karenzone karenzone self-assigned this Mar 21, 2025
@karenzone karenzone added the LSR label Mar 21, 2025
@karenzone karenzone requested a review from jsvd March 31, 2025 17:09
@karenzone
Copy link
Contributor Author

@jsvd This is the idea I mentioned in our 1:1. Will you please take a look and see if there's potential here?

bundle exec ruby plugindocs.rb --skip-existing --output-path ../logstash-docs ../logstash/plugins_version_docs.json
- name: Build docs
working-directory: ./logstash-docs
run: ../docs/build_docs --asciidoctor --respect_edit_url_overrides --doc docs/index.asciidoc --chunk 1
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@karenzone Bet this path needs adjusting (/lsr/)

bundle exec ruby plugindocs.rb --skip-existing --output-path ../logstash-docs ../logstash/plugins_version_docs.json
- name: Build docs
working-directory: ./logstash-docs
run: ../docs/build_docs --asciidoctor --respect_edit_url_overrides --doc docs/index.asciidoc --chunk 1
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Suggested change
run: ../docs/build_docs --asciidoctor --respect_edit_url_overrides --doc docs/index.asciidoc --chunk 1
run: ../docs/build_docs --asciidoctor --respect_edit_url_overrides --doc docs/lsr/index.asciidoc --chunk 1

@jsvd
Copy link
Member

jsvd commented Apr 4, 2025

Can we backport #1817 to 9.0?

logstash-docs on main
❯ git lg docs/plugins/index.asciidoc
* 2da5f3c6 - Build LSR Plugin docs from this repo (#1817) (2 weeks ago) <Brandon Morelli>

❯ git co 9.0
Switched to branch '9.0'
Your branch is up to date with 'origin/9.0'.

logstash-docs on 9.0
❯ git lg docs/plugins/index.asciidoc
no such file

@karenzone
Copy link
Contributor Author

karenzone commented Apr 4, 2025

WRT backport:
Already in progress: #1830, but it's not going to pass CI because the ADOC files we need in logstash aren't there anymore. Chicken-Egg

@karenzone
Copy link
Contributor Author

Closing to avoid confusion.

@karenzone karenzone closed this Apr 4, 2025
@karenzone karenzone deleted the 110-lsr90 branch April 4, 2025 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants