Skip to content

Commit

Permalink
Merge branch 'main' into 2503-add-server-timeout
Browse files Browse the repository at this point in the history
Signed-off-by: ebadiere <ebadiere@gmail.com>
  • Loading branch information
ebadiere committed May 25, 2024
2 parents 7fb85ec + 0b02b4d commit ddbd07c
Show file tree
Hide file tree
Showing 26 changed files with 524 additions and 239 deletions.
66 changes: 66 additions & 0 deletions .github/scripts/check-pr.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
const axios = require('axios');

const githubToken = process.env.GITHUB_TOKEN;
const { GITHUB_REPOSITORY, GITHUB_PR_NUMBER } = process.env;

const [owner, repo] = GITHUB_REPOSITORY.split('/');

async function getPRDetails() {
const url = `https://api.github.com/repos/${owner}/${repo}/pulls/${GITHUB_PR_NUMBER}`;
const response = await axios.get(url, {
headers: {
Authorization: `token ${githubToken}`
}
});
return response.data;
}

async function getIssueDetails(issueNumber) {
const url = `https://api.github.com/repos/${owner}/${repo}/issues/${issueNumber}`;
const response = await axios.get(url, {
headers: {
Authorization: `token ${githubToken}`
}
});
return response.data;
}

async function run() {
try {
const pr = await getPRDetails();
const { labels: prLabels, milestone: prMilestone, body: prBody } = pr;

if (prLabels.length === 0) {
throw new Error('The PR has no labels.');
}
if (!prMilestone) {
throw new Error('The PR has no milestone.');
}

const issueNumberMatches = prBody.match(/#(\d+)/g);

if (!issueNumberMatches) {
console.log('No associated issues found in PR description.');
} else {
for (const match of issueNumberMatches) {
const issueNumber = match.replace('#', '');
const issue = await getIssueDetails(issueNumber);
const { labels: issueLabels, milestone: issueMilestone } = issue;

if (issueLabels.length === 0) {
throw new Error(`Associated issue #${issueNumber} has no labels.`);
}
if (!issueMilestone) {
throw new Error(`Associated issue #${issueNumber} has no milestone.`);
}
}
}

console.log('PR and all associated issues have labels and milestones.');
} catch (error) {
console.error(error.message);
process.exit(1);
}
}

run();
27 changes: 27 additions & 0 deletions .github/workflows/pr-label-milestone-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: PR Label and Milestone Check

on:
pull_request:
types: [opened, edited, labeled, unlabeled, synchronize]

jobs:
check_pr:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18'

- name: Install dependencies
run: npm install axios

- name: Check PR labels and milestones
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_PR_NUMBER: ${{ github.event.number }}
run: node .github/scripts/check-pr.js
4 changes: 2 additions & 2 deletions charts/hedera-json-rpc-relay-websocket/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: v2
appVersion: "0.48.0-SNAPSHOT"
appVersion: "0.49.0-SNAPSHOT"
description: Helm chart deployment of the hashgraph/hedera-json-rpc-relay web socket server
home: https://github.com/hashgraph/hedera-json-rpc-relay
icon: https://camo.githubusercontent.com/cca6b767847bb8ca5c7059481ba13a5fc81c5938/68747470733a2f2f7777772e6865646572612e636f6d2f6c6f676f2d6361706974616c2d686261722d776f72646d61726b2e6a7067
Expand All @@ -22,4 +22,4 @@ name: hedera-json-rpc-relay-websocket
sources:
- https://github.com/hashgraph/hedera-json-rpc-relay
type: application
version: 0.48.0-SNAPSHOT
version: 0.49.0-SNAPSHOT
4 changes: 2 additions & 2 deletions charts/hedera-json-rpc-relay/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: v2
appVersion: "0.48.0-SNAPSHOT"
appVersion: "0.49.0-SNAPSHOT"
description: Helm chart deployment of the hashgraph/hedera-json-rpc-relay
home: https://github.com/hashgraph/hedera-json-rpc-relay
icon: https://camo.githubusercontent.com/cca6b767847bb8ca5c7059481ba13a5fc81c5938/68747470733a2f2f7777772e6865646572612e636f6d2f6c6f676f2d6361706974616c2d686261722d776f72646d61726b2e6a7067
Expand All @@ -21,4 +21,4 @@ name: hedera-json-rpc-relay
sources:
- https://github.com/hashgraph/hedera-json-rpc-relay
type: application
version: 0.48.0-SNAPSHOT
version: 0.49.0-SNAPSHOT
76 changes: 38 additions & 38 deletions dapp-example/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions dapp-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
"@emotion/react": "^11.11.4",
"@emotion/styled": "^11.11.5",
"@hashgraph/sdk": "^2.44.0",
"@mui/material": "^5.15.15",
"@mui/material": "^5.15.16",
"ethers": "^5.6.8",
"react": "^18.1.0",
"react-dom": "^18.1.0",
"react": "^18.3.0",
"react-dom": "^18.3.0",
"react-scripts": "5.0.1"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion docs/openrpc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"info": {
"title": "Hedera JSON-RPC Specification",
"description": "A specification of the implemented Ethereum JSON RPC APIs interface for Hedera clients and adheres to the Ethereum execution APIs schema.",
"version": "0.48.0-SNAPSHOT"
"version": "0.49.0-SNAPSHOT"
},
"servers": [
{
Expand Down
Loading

0 comments on commit ddbd07c

Please sign in to comment.