-
Notifications
You must be signed in to change notification settings - Fork 44
feat(sdk): wasm docs and fixes #2700
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
Merged
Changes from 38 commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
fd546be
dpns usernames in rust sdk
ddca52a
dpns improvements
72d8197
more dpns improvements
QuantumExplorer 84fb154
more dpns improvements
QuantumExplorer 0964da3
more dpns improvements
QuantumExplorer bcacb00
more dpns improvements
QuantumExplorer 9b0adf5
dpns improvements
ef11969
more work
647da0c
more work
69ac84a
more work
057b618
more work
5d71bd1
more fixes
26e4d25
fix
QuantumExplorer 37a3ca4
fix
QuantumExplorer 30215df
more fixes
ff8ff6d
Merge branch 'feat/dpnsImprovements' of github.com:dashpay/platform i…
a53b9cf
another fix
QuantumExplorer 6aac9cf
Potential fix for code scanning alert no. 24: DOM text reinterpreted …
QuantumExplorer 0f6be17
fixes
5ef0fdd
more work
4a1cf37
more work
a0867a9
improvement
QuantumExplorer 09313ff
Merge branch 'feat/dpnsImprovements' of github.com:dashpay/platform i…
QuantumExplorer ba65988
improvement
QuantumExplorer 36c3a4f
fix
QuantumExplorer b2c07f5
fix
QuantumExplorer 1b55f53
fix
47403bc
Merge branch 'feat/dpnsImprovements' of github.com:dashpay/platform i…
8a3c931
more work
QuantumExplorer 61e4d9c
fix
da06af1
fix
QuantumExplorer 4778678
Merge branch 'feat/dpnsImprovements' of github.com:dashpay/platform i…
QuantumExplorer a64b739
fixes
5b08754
Merge branch 'feat/dpnsImprovements' of github.com:dashpay/platform i…
d47bfd8
fixes
2b80447
fixes
83a3cf1
wasm docs
dd4234c
Merge branch 'v2.1-dev' into feat/wasm-docs
QuantumExplorer 16fedb5
more work
f97f190
Merge branch 'feat/wasm-docs' of github.com:dashpay/platform into fea…
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,137 @@ | ||
| name: Check WASM SDK Documentation | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| pull_request: | ||
| paths: | ||
| - 'packages/wasm-sdk/index.html' | ||
| - 'packages/wasm-sdk/docs.html' | ||
| - 'packages/wasm-sdk/AI_REFERENCE.md' | ||
| - 'packages/wasm-sdk/docs_manifest.json' | ||
| - 'packages/wasm-sdk/generate_docs.py' | ||
| - 'packages/wasm-sdk/check_documentation.py' | ||
| - '.github/workflows/wasm-sdk-documentation-check.yml' | ||
| push: | ||
| branches: | ||
| - master | ||
| - 'v*-dev' | ||
| paths: | ||
| - 'packages/wasm-sdk/index.html' | ||
| - 'packages/wasm-sdk/docs.html' | ||
| - 'packages/wasm-sdk/AI_REFERENCE.md' | ||
| - 'packages/wasm-sdk/docs_manifest.json' | ||
| - 'packages/wasm-sdk/generate_docs.py' | ||
| - 'packages/wasm-sdk/check_documentation.py' | ||
| - '.github/workflows/wasm-sdk-documentation-check.yml' | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| check-wasm-sdk-documentation: | ||
| name: Check WASM SDK Documentation | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: write | ||
| pull-requests: write | ||
| steps: | ||
| - name: Check out repo | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| token: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - name: Setup Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: '3.x' | ||
|
|
||
| - name: Check documentation completeness | ||
| id: doc-check | ||
| working-directory: packages/wasm-sdk | ||
| run: | | ||
| # Run the documentation check | ||
| if python3 check_documentation.py; then | ||
| echo "status=success" >> $GITHUB_OUTPUT | ||
| else | ||
| echo "status=failure" >> $GITHUB_OUTPUT | ||
| fi | ||
|
|
||
| # Check if documentation needs to be regenerated | ||
| if git diff --quiet docs.html docs_manifest.json AI_REFERENCE.md; then | ||
| echo "docs_modified=false" >> $GITHUB_OUTPUT | ||
| else | ||
| echo "docs_modified=true" >> $GITHUB_OUTPUT | ||
| fi | ||
|
|
||
| - name: Upload documentation check report | ||
| if: always() | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: documentation-check-report | ||
| path: packages/wasm-sdk/documentation-check-report.txt | ||
|
|
||
| - name: Comment PR | ||
| if: github.event_name == 'pull_request' && steps.doc-check.outputs.status == 'failure' | ||
| uses: actions/github-script@v7 | ||
| with: | ||
| script: | | ||
| const fs = require('fs'); | ||
| const reportPath = 'packages/wasm-sdk/documentation-check-report.txt'; | ||
|
|
||
| if (fs.existsSync(reportPath)) { | ||
| const report = fs.readFileSync(reportPath, 'utf8'); | ||
| const status = '${{ steps.doc-check.outputs.status }}' === 'success' ? '✅' : '❌'; | ||
|
|
||
| // Find existing comment | ||
| const { data: comments } = await github.rest.issues.listComments({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| issue_number: context.issue.number, | ||
| }); | ||
|
|
||
| const botComment = comments.find(comment => | ||
| comment.user.type === 'Bot' && | ||
| comment.body.includes('WASM SDK Documentation Check') | ||
| ); | ||
|
|
||
| const body = `### ${status} WASM SDK Documentation Check\n\n\`\`\`\n${report}\n\`\`\`\n\n**To fix documentation issues:**\n\`\`\`bash\ncd packages/wasm-sdk\npython3 generate_docs.py\n\`\`\``; | ||
|
|
||
| if (botComment) { | ||
| await github.rest.issues.updateComment({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| comment_id: botComment.id, | ||
| body: body | ||
| }); | ||
| } else { | ||
| await github.rest.issues.createComment({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| issue_number: context.issue.number, | ||
| body: body | ||
| }); | ||
| } | ||
| } | ||
|
|
||
| - name: Auto-update documentation | ||
| if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/v')) && steps.doc-check.outputs.status == 'failure' | ||
| working-directory: packages/wasm-sdk | ||
| run: | | ||
| # Generate updated documentation | ||
| python3 generate_docs.py | ||
|
|
||
| # Check if there are changes | ||
| if ! git diff --quiet docs.html docs_manifest.json AI_REFERENCE.md; then | ||
| git config --local user.email "github-actions[bot]@users.noreply.github.com" | ||
| git config --local user.name "github-actions[bot]" | ||
| git add docs.html docs_manifest.json AI_REFERENCE.md | ||
| git commit -m "chore: update WASM SDK documentation [skip ci]" | ||
| git push | ||
| fi | ||
coderabbitai[bot] marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| - name: Fail if documentation is out of date | ||
| if: steps.doc-check.outputs.status == 'failure' && github.event_name == 'pull_request' | ||
| run: | | ||
| echo "Documentation is out of date. Please run 'python3 generate_docs.py' in packages/wasm-sdk/" | ||
| exit 1 | ||
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 was deleted.
Oops, something went wrong.
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.