Skip to content

feat(sdk): add put_from_addresses convenience method for identity creation #733

feat(sdk): add put_from_addresses convenience method for identity creation

feat(sdk): add put_from_addresses convenience method for identity creation #733

name: Check rs-sdk gRPC coverage
on:
workflow_dispatch:
pull_request:
paths:
- 'packages/rs-sdk/**'
- 'packages/dapi-grpc/protos/platform/v0/platform.proto'
- '.github/workflows/tests-rs-sdk-grpc-coverage.yml'
- '.github/scripts/check-grpc-coverage.py'
- '.github/grpc-queries-cache.json'
push:
branches:
- master
- 'v*-dev'
paths:
- 'packages/rs-sdk/**'
- 'packages/dapi-grpc/protos/platform/v0/platform.proto'
- '.github/workflows/tests-rs-sdk-grpc-coverage.yml'
- '.github/scripts/check-grpc-coverage.py'
- '.github/grpc-queries-cache.json'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
check-grpc-coverage:
name: Check gRPC query coverage
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 gRPC coverage
id: coverage
run: |
# Run the coverage check
if python .github/scripts/check-grpc-coverage.py; then
echo "status=success" >> $GITHUB_OUTPUT
else
echo "status=failure" >> $GITHUB_OUTPUT
fi
# Check if cache was modified
if git diff --quiet .github/grpc-queries-cache.json; then
echo "cache_modified=false" >> $GITHUB_OUTPUT
else
echo "cache_modified=true" >> $GITHUB_OUTPUT
fi
- name: Commit cache updates
if: steps.coverage.outputs.cache_modified == 'true' && github.event_name == 'push' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/v'))
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add .github/grpc-queries-cache.json
git commit -m "chore: update gRPC queries cache [skip ci]"
git push
- name: Upload coverage report
if: always()
uses: actions/upload-artifact@v4
with:
name: grpc-coverage-report
path: grpc-coverage-report.txt
- name: Comment PR
if: github.event_name == 'pull_request' && (steps.coverage.outputs.cache_modified == 'true' || steps.coverage.outputs.status == 'failure')
uses: actions/github-script@v7
with:
script: |
const fs = require('fs');
const reportPath = 'grpc-coverage-report.txt';
if (fs.existsSync(reportPath)) {
const report = fs.readFileSync(reportPath, 'utf8');
const status = '${{ steps.coverage.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('gRPC Query Coverage Report')
);
const body = `### ${status} gRPC Query Coverage Report\n\n\`\`\`\n${report}\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: Fail if new queries are missing
if: steps.coverage.outputs.status == 'failure'
run: exit 1