-
Notifications
You must be signed in to change notification settings - Fork 2k
docs(vrl): Automatically generate VRL function documentation #24719
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
Merged
+1,263
−11,380
Merged
Changes from 116 commits
Commits
Show all changes
123 commits
Select commit
Hold shift + click to select a range
7c4be90
Add generation of cue files from vrl Function
thomasqueirozb d028ae8
Use __mock_return_values_for_tests to show mocked examples
thomasqueirozb 73d9585
Handle kind::any
thomasqueirozb ea36b23
Replace generate-component-docs with generate-docs
thomasqueirozb 58fa9ab
Bump VRL
thomasqueirozb 4f02f21
chore(vrl): Bump vrl and add return_kind to functions
thomasqueirozb d5c6ce5
Merge branch 'function-return' into automatic-vrl-documentation
thomasqueirozb 4cc7bb4
Enable all features for vector-vrl-functions
thomasqueirozb a571dac
Add stubs and implement new params
thomasqueirozb ad740b0
Bump vrl and unstub pure
thomasqueirozb f6431ae
Bump vrl and unstub notices
thomasqueirozb 8c42a0a
Trim strings
thomasqueirozb f0c2b92
Merge remote-tracking branch 'origin/master' into automatic-vrl-docum…
thomasqueirozb b5553de
chore(vrl): Bump VRL and implement category for functions
thomasqueirozb 55e557b
Merge branch 'function-category' into automatic-vrl-documentation
thomasqueirozb e4d921a
Use .category()
thomasqueirozb 74e4020
Merge remote-tracking branch 'origin/master' into automatic-vrl-docum…
thomasqueirozb cc66ebe
chore(vrl): bump VRL and use Parameter builder
thomasqueirozb 4b8797e
Add .enum_variants to aggregate_vector_metrics
thomasqueirozb f2a3ddf
Add missing import
thomasqueirozb 06eb975
Merge branch 'parameter-enum-variant' into automatic-vrl-documentation
thomasqueirozb 44cacba
Add support for enum_variants
thomasqueirozb 443e765
Merge remote-tracking branch 'origin/master' into automatic-vrl-docum…
thomasqueirozb 2504f35
Add Raises block to remap rendering
thomasqueirozb c157925
Merge remote-tracking branch 'origin/master' into automatic-vrl-docum…
thomasqueirozb decc387
Bump vrl
thomasqueirozb 142b3d3
Fix clippy
thomasqueirozb c4b4600
Install protoc when compiling vdev
thomasqueirozb 5f0ef54
Add generated files
thomasqueirozb ad2a14b
Format json using 4 spaces instead of 2
thomasqueirozb cc139f5
Ignore VRL generated docs from cue fmt
thomasqueirozb ad035c8
Revert "Format json using 4 spaces instead of 2"
thomasqueirozb ee95f01
Push newline at the end of generated json
thomasqueirozb 92eefbc
Bump VRL
thomasqueirozb 76cd0c9
Add preserve_order to keep doc generation consistent
thomasqueirozb 0782eab
Render input
thomasqueirozb 1fad561
Regenerate docs
thomasqueirozb d6cbadc
Use IndexMap to preserve enum ordering
thomasqueirozb b51bc76
Regenerate docs with enum ordering
thomasqueirozb 5cf0e1c
Fix cue schema
thomasqueirozb fd24c6d
Merge remote-tracking branch 'origin/master' into automatic-vrl-docum…
thomasqueirozb 3335605
Remove .log when rendering VRL examples' input
thomasqueirozb 2c5806f
Fix clippy
thomasqueirozb 2b21351
Format cue
thomasqueirozb 23cde3c
Add base64 encoded letters to spellcheck ignore
thomasqueirozb c43139e
Add all unrecognized words to expect.txt
thomasqueirozb 21fc3bb
Update input to json value
thomasqueirozb a75174c
Use branch VRL and use VRL generation code
thomasqueirozb fd207fc
Merge remote-tracking branch 'origin/master' into automatic-vrl-docum…
thomasqueirozb 809dff0
Bump branch sha
thomasqueirozb 6f78059
Add generate-vrl-docs to check-docs
thomasqueirozb 2f50f33
Add amplify.yml
thomasqueirozb 8800155
Use __doc_paths
thomasqueirozb bda75b4
Bump version
thomasqueirozb 1131838
Merge branch 'master' into automatic-vrl-documentation-website
thomasqueirozb 0d73b57
Update licenses
thomasqueirozb 93bb576
Use . appRoot
thomasqueirozb 2d6ec0d
Merge remote-tracking branch 'origin/master' into automatic-vrl-docum…
thomasqueirozb b608329
Bump VRL
thomasqueirozb 21a1d6d
Generate docs to docs/generated
thomasqueirozb d8f8a1b
Generate docs
thomasqueirozb caf1416
Rename vrl-docs to vector-vrl-docs
thomasqueirozb 51b7e3e
Generate Vector VRL and VRL docs using make generate-vrl-docs
thomasqueirozb 906dc73
Revert to prod amplify.yml
thomasqueirozb 21e510f
Add VECTOR_SHA override
thomasqueirozb 3a2cefc
Download latest vdev in amplify.yml
thomasqueirozb 0a32b72
Install vdev from source
thomasqueirozb 213fab8
All in one compilation/copy
thomasqueirozb 426e8e8
Add check_type_only: false
thomasqueirozb 2b834fc
Compile debug instead of release
thomasqueirozb 4667060
Format
thomasqueirozb 9c73c36
Fix check-docs check
thomasqueirozb 2c1fd11
Revert changes to expect.txt
thomasqueirozb 89d6bff
Update changes.yml
thomasqueirozb f1d8c15
Merge remote-tracking branch 'origin/master' into automatic-vrl-docum…
thomasqueirozb eb7f152
Add sticky comment workflow
thomasqueirozb 5298e2b
Update docs/generated/README.md
thomasqueirozb 115ac9e
Merge branch 'master' into automatic-vrl-documentation-website
thomasqueirozb 896918e
Regenerate docs
thomasqueirozb 2278d41
Make check-generated-vrl-docs always run
thomasqueirozb 7a6e863
Use needs.*.result and check for failure/cancelled
thomasqueirozb 6807bdb
Revert "Regenerate docs"
thomasqueirozb cc1d474
Use --vector-sha inside CI to ensure docs freshness
thomasqueirozb 236a5fb
Revert "Use --vector-sha inside CI to ensure docs freshness"
thomasqueirozb 88c939e
Add --vector-sha to generate-vector-vrl-docs step
thomasqueirozb 4d5946c
Revert "Add --vector-sha to generate-vector-vrl-docs step"
thomasqueirozb cd72f69
Use --vector-sha when deploying the website
thomasqueirozb 1551c8d
Merge remote-tracking branch 'origin/master' into automatic-vrl-docum…
thomasqueirozb 384f672
Fix non CI make generate-vrl-docs
thomasqueirozb 17b31a7
Move sparse_checkout_docs to vdev/src/utils/git.rs
thomasqueirozb 72fc2c2
Recompile vdev when there are changes to 'lib/vector-vrl/**'
thomasqueirozb 1d97612
chore(dev): move VRL-specific crates under lib/vector-vrl/ (#24854)
thomasqueirozb e9baf68
Update generated VRL docs
github-actions[bot] 50f2f7d
Merge remote-tracking branch 'origin/master' into automatic-vrl-docum…
thomasqueirozb 538ff1e
Format
thomasqueirozb a33f181
Remove `_*_explainer`s
thomasqueirozb be69781
Fix generated docs filters
thomasqueirozb 8b0273d
Add test doc change
thomasqueirozb 6e359f7
Update generated VRL docs
github-actions[bot] f6517da
Revert "Update generated VRL docs"
thomasqueirozb a445e03
Reapply "Update generated VRL docs"
thomasqueirozb 5b1f2e0
Delete amplify.yml
thomasqueirozb 0c5950a
Revert "Reapply "Update generated VRL docs""
thomasqueirozb 4dc4230
Update generated VRL docs
github-actions[bot] ddce726
remove Hello from source code once and for all
thomasqueirozb 534fd17
Optimize setup action
thomasqueirozb f88e6cf
Update generated VRL docs
github-actions[bot] 951650e
Fix potential head_ref injection
thomasqueirozb 3854fcd
Update generated VRL docs
github-actions[bot] d64e8f5
GHA trigger
thomasqueirozb d90e33b
Fail check when out of date
thomasqueirozb e90035f
Update generated VRL docs
github-actions[bot] 19871fa
ci-test: add foo-bar to find_enrichment_table_records example
thomasqueirozb 2320bb5
ci-test: make docs incorrect
thomasqueirozb ce1ea59
Update generated VRL docs
github-actions[bot] ef6308a
Update vdev cache keys
thomasqueirozb c313398
Update generated VRL docs
github-actions[bot] 50c436c
Revert mock changes
thomasqueirozb 2feff79
Update generated VRL docs
github-actions[bot] 28b46ff
GHA trigger
thomasqueirozb 031e565
Update warning comment
thomasqueirozb 8910b3d
Merge branch 'master' into automatic-vrl-documentation-website
thomasqueirozb 9565d14
Merge branch 'master' into automatic-vrl-documentation-website
thomasqueirozb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,135 @@ | ||
| name: Check Generated VRL Docs Freshness | ||
|
|
||
| on: | ||
| pull_request: | ||
| merge_group: | ||
| types: [checks_requested] | ||
| push: | ||
| branches: | ||
| - master | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.event.number || github.sha }} | ||
| cancel-in-progress: true | ||
|
|
||
| env: | ||
| COMMIT_MESSAGE: "Update generated VRL docs" | ||
| COMMIT_AUTHOR: "github-actions[bot]" | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| changes: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| outputs: | ||
| docs: ${{ steps.filter.outputs.docs }} | ||
| steps: | ||
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
| - uses: dorny/paths-filter@v3 | ||
| id: filter | ||
| with: | ||
| filters: | | ||
| docs: | ||
| - "lib/vector-vrl/**" | ||
| - "vdev/**" | ||
| - "Cargo.lock" | ||
| - ".github/workflows/check_generated_vrl_docs.yml" | ||
|
|
||
| run-check-generated-vrl-docs: | ||
| needs: changes | ||
| if: needs.changes.outputs.docs == 'true' | ||
| runs-on: ubuntu-24.04-8core | ||
| permissions: | ||
| contents: write | ||
| steps: | ||
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
| with: | ||
| ref: ${{ github.event.pull_request.head.sha || github.sha }} | ||
|
|
||
| - uses: ./.github/actions/setup | ||
| with: | ||
| vdev: true | ||
| mold: false | ||
| cargo-cache: false | ||
|
|
||
| - name: Regenerate VRL docs | ||
| run: make generate-vector-vrl-docs | ||
|
|
||
| - name: Check for changes | ||
| id: check | ||
| run: | | ||
| git add docs/generated/ | ||
| if git diff --cached --quiet; then | ||
| echo "changed=false" >> "$GITHUB_OUTPUT" | ||
| else | ||
| echo "changed=true" >> "$GITHUB_OUTPUT" | ||
| fi | ||
|
|
||
| - name: Check last commit | ||
| if: steps.check.outputs.changed == 'true' | ||
| id: last-commit | ||
| run: | | ||
| MSG=$(git log -1 --pretty=%s) | ||
| AUTHOR=$(git log -1 --pretty=%an) | ||
| if [ "$MSG" = "$COMMIT_MESSAGE" ] && [ "$AUTHOR" = "$COMMIT_AUTHOR" ]; then | ||
| echo "is-auto=true" >> "$GITHUB_OUTPUT" | ||
| else | ||
| echo "is-auto=false" >> "$GITHUB_OUTPUT" | ||
| fi | ||
|
|
||
| - name: Commit and push | ||
| if: > | ||
| steps.check.outputs.changed == 'true' | ||
| && steps.last-commit.outputs.is-auto != 'true' | ||
| && github.event_name == 'pull_request' | ||
| && github.event.pull_request.head.repo.full_name == github.repository | ||
| id: push | ||
| continue-on-error: true | ||
| env: | ||
| HEAD_REF: ${{ github.head_ref }} | ||
| run: | | ||
| git config user.name "github-actions[bot]" | ||
| git config user.email "github-actions[bot]@users.noreply.github.com" | ||
| git commit -m "$COMMIT_MESSAGE" | ||
| git push origin HEAD:refs/heads/$HEAD_REF | ||
|
|
||
| - name: Save PR number for comment workflow | ||
| if: > | ||
| steps.check.outputs.changed == 'true' | ||
| && steps.last-commit.outputs.is-auto != 'true' | ||
| && github.event_name == 'pull_request' | ||
| && steps.push.outcome != 'success' | ||
| run: | | ||
| mkdir -p /tmp/docs-check | ||
| echo "${{ github.event.pull_request.number }}" > /tmp/docs-check/pr-number | ||
|
|
||
| - name: Upload PR metadata | ||
| if: > | ||
| steps.check.outputs.changed == 'true' | ||
| && steps.last-commit.outputs.is-auto != 'true' | ||
| && github.event_name == 'pull_request' | ||
| && steps.push.outcome != 'success' | ||
| uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 | ||
| with: | ||
| name: vrl-docs-check-pr | ||
| path: /tmp/docs-check/pr-number | ||
|
|
||
| - name: Fail if docs are out of date | ||
| if: steps.check.outputs.changed == 'true' | ||
| run: | | ||
| echo "docs/generated/ is out of date. Regenerate with: make generate-vector-vrl-docs" | ||
| exit 1 | ||
|
|
||
| check-generated-vrl-docs: | ||
| if: always() | ||
| runs-on: ubuntu-latest | ||
| needs: run-check-generated-vrl-docs | ||
| steps: | ||
| - run: | | ||
| if [[ "${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}" == "true" ]]; then | ||
| echo "One or more jobs failed or were cancelled" | ||
| exit 1 | ||
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| name: Comment on PR (Generated VRL Docs) | ||
|
|
||
| on: | ||
| workflow_run: | ||
| workflows: ["Check Generated VRL Docs Freshness"] | ||
| types: | ||
| - completed | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| comment: | ||
| runs-on: ubuntu-latest | ||
| if: > | ||
| github.event.workflow_run.conclusion == 'failure' | ||
| && github.event.workflow_run.event == 'pull_request' | ||
| permissions: | ||
| pull-requests: write | ||
| steps: | ||
| - name: Download PR metadata | ||
| uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0 | ||
| with: | ||
| name: vrl-docs-check-pr | ||
| run-id: ${{ github.event.workflow_run.id }} | ||
| github-token: ${{ github.token }} | ||
|
|
||
| - name: Comment on PR | ||
| uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 | ||
| with: | ||
| script: | | ||
| const fs = require('fs'); | ||
| const prNumber = parseInt(fs.readFileSync('pr-number', 'utf8').trim(), 10); | ||
| if (isNaN(prNumber)) { | ||
| core.setFailed('Invalid PR number'); | ||
| return; | ||
| } | ||
|
|
||
| const marker = '<!-- generated-vrl-docs-check -->'; | ||
| const body = marker + '\nThe `docs/generated/` folder is out of date but I was unable to push the fix automatically.\n\nPlease run the following and commit the result:\n\n```\nmake generate-vector-vrl-docs\n```'; | ||
|
|
||
| const { data: comments } = await github.rest.issues.listComments({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| issue_number: prNumber, | ||
| }); | ||
| const existing = comments.find(c => c.body.startsWith(marker)); | ||
| if (existing) { | ||
| await github.rest.issues.updateComment({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| comment_id: existing.id, | ||
| body, | ||
| }); | ||
| } else { | ||
| await github.rest.issues.createComment({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| issue_number: prNumber, | ||
| body, | ||
| }); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.