Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
102 changes: 102 additions & 0 deletions .github/scripts/bot-pr-gfi-review-triage.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
/**
* This script automatically requests triage reviews on PRs labeled as "Good First Issue" or "Beginner".
* It runs on when a pr added with label "Good First Issue" or "Beginner" and posts a comment mentioing triage reviewers.
*
* safty measures:
* - Only runs on PRs (not issues).
* - Only run for once per pr.
* - it does not run on new commit push but can run on pr label update
*/


const fs = require("fs");
const https = require("https");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

here you are making manual e.g. https calls

the current script mainly does three things: parse the event, extract the PR number, and post a comment via the API.

All of that is already available through https://github.com/actions/github-script, i think

e.g
context.payload.pull_request.number
https://docs.github.com/en/actions/reference/workflows-and-actions/contexts


function fail(message) {
console.error(`${message}`);
process.exit(1);
}

function info(message) {
console.log(`${message}`);
}


const eventPath = process.env.GITHUB_EVENT_PATH;
const repository = process.env.GITHUB_REPOSITORY;
const token = process.env.GITHUB_TOKEN;

if (!eventPath) fail("GITHUB_EVENT_PATH is not set.");
if (!repository) fail("GITHUB_REPOSITORY is not set.");
if (!token) fail("GITHUB_TOKEN is not set.");


let event;

try {
const payload = fs.readFileSync(eventPath, "utf8");
event = JSON.parse(payload);
} catch (err) {
fail(`Failed to read GitHub event payload: ${err.message}`);
}

const prNumber = event?.pull_request?.number;

if (!prNumber) {
info("No pull request found in event payload. Exiting.");
process.exit(0);
}


const [owner, repo] = repository.split("/");

if (!owner || !repo) {
fail("Invalid GITHUB_REPOSITORY format. Expected owner/repo.");
}


const commentBody =
"Requesting triage review from: @hiero-ledger/hiero-sdk-python-triage";

info(`Preparing to comment on PR #${prNumber} in ${owner}/${repo}`);


const data = JSON.stringify({ body: commentBody });

const options = {
hostname: "api.github.com",
path: `/repos/${owner}/${repo}/issues/${prNumber}/comments`,
method: "POST",
headers: {
"User-Agent": "triage-review-bot",
"Authorization": `Bearer ${token}`,
"Accept": "application/vnd.github+json",
"Content-Type": "application/json",
"Content-Length": Buffer.byteLength(data),
},
};

const req = https.request(options, (res) => {
let body = "";

res.on("data", (chunk) => {
body += chunk;
});

res.on("end", () => {
if (res.statusCode >= 200 && res.statusCode < 300) {
info("Comment posted successfully.");
} else {
console.error(`Error: GitHub API error (${res.statusCode})`);
console.error(body);
process.exit(1);
}
});
});

req.on("error", (err) => {
fail(`Request failed: ${err.message}`);
});

req.write(data);
req.end();
24 changes: 24 additions & 0 deletions .github/workflows/request-triage-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Request triage review on beginner PRs

on:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

you can convert this to a cron trigger every 1 hour to request triage review, if needed

pull_request:
types: [labeled]

permissions:
contents: read
pull-requests: write
Comment on lines +7 to +9
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

contents: read is unused; the correct implementation will also need issues: write.

  • contents: read is unnecessary in the current implementation (no checkout). Once corrected to read .github/triage-members.txt it will be needed, but should be justified by a checkout step.
  • Posting a comment via issues.createComment requires issues: write, which is absent. The pull-requests: write covers reviewer requests but not PR comments.
🔒 Proposed correction (for the intended behavior)
 permissions:
   contents: read
+  issues: write
-  pull-requests: write

As per coding guidelines: "Requested permissions MUST exactly match behavior" and "Explicitly validate common cases: issues: write → comments."

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
permissions:
contents: read
pull-requests: write
permissions:
contents: read
pull-requests: write
issues: write


jobs:
request-triage:
if: ${{ github.event.label.name == 'Good First Issue' || github.event.label.name == 'Beginner'}}
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1

- name: Request triage by comment
run: node .github/scripts/bot-pr-gfi-review-triage.js
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Comment on lines +22 to +23
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

# First, let's find and view the workflow file
find . -name "request-triage-review.yml" -type f

Repository: hiero-ledger/hiero-sdk-python

Length of output: 118


🏁 Script executed:

# Get the full context of the workflow file to understand the github-script usage
cat -n ".github/workflows/request-triage-review.yml" 2>/dev/null || echo "File not found"

Repository: hiero-ledger/hiero-sdk-python

Length of output: 1184


🏁 Script executed:

# Search for all github-script usages in workflows to see how other workflows handle authentication
rg -n "uses: actions/github-script" --type yaml -A5

Repository: hiero-ledger/hiero-sdk-python

Length of output: 55


🏁 Script executed:

# Check if the script section references GITHUB_TOKEN env var
rg -n "GITHUB_TOKEN" --type yaml .github/workflows/

Repository: hiero-ledger/hiero-sdk-python

Length of output: 2684


Remove redundant env: GITHUB_TOKENactions/github-script authenticates via the github-token input parameter, not via environment variables.

actions/github-script@v7 uses its github-token input to authenticate the github client object (defaulting to ${{ github.token }}). The env: GITHUB_TOKEN block sets an environment variable that the action does not read for authentication. The script uses github.rest.pulls.requestReviewers() with the pre-authenticated client, making this environment variable a no-op and source of confusion.

Proposed fix
         await github.rest.pulls.requestReviewers({
           owner,
           repo,
           pull_number: prNumber,
           team_reviewers,
         });
-      env:
-        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}


43 changes: 29 additions & 14 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ This changelog is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.
- chore: update GitHub Actions runners from ubuntu-latest to hl-sdk-py-lin-md (#2021)
- Refactored the Advanced Issue Template to V2 with stricter prerequisites and a focus on architectural design (#2016).
- Refactored the Advanced Issue Template to ensure PR-level quality checklists do not block maintainers during issue creation (#2036)
- Added `request-triage-review.yml` and `bot-pr-gfi-review-triage.js` put comment on GFI and Beginner PR to request review.(#1721)

## [0.2.3] - 2026-03-26

Expand All @@ -31,6 +32,7 @@ This changelog is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.

### Src
- Updated `AccountUpdateTransaction.set_key()` to accept generic `Key` objects (including `KeyList` and threshold keys), rather than strictly requiring a `PublicKey`.

- Fix the TransactionGetReceiptQuery to raise ReceiptStatusError for the non-retryable and non success receipt status
- Refactor `AccountInfo` to use the existing `StakingInfo` wrapper class instead of flattened staking fields. Access is now via `info.staking_info.staked_account_id`, `info.staking_info.staked_node_id`, and `info.staking_info.decline_reward`. The old flat accessors (`info.staked_account_id`, `info.staked_node_id`, `info.decline_staking_reward`) are still available as deprecated properties and will emit a `DeprecationWarning`. (#1366)
- Added abstract `Key` supper class to handle various proto Keys.
Expand Down Expand Up @@ -60,32 +62,36 @@ This changelog is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.
## [0.2.2] - 2026-03-17

### Added

- Added CodeRabbit review instructions in `.coderabbit.yaml` for account module `src/hiero_sdk_python/account/`.
- Add support for `include_children` to TransactionRecordQuery ([#1512](https://github.com/hiero-ledger/hiero-sdk-python/issues/1512))

### Changed

- Changed pytest version to "pytest>=8.3.4,<10" (#1917)
- Update protobuf schema version to v0.72.0-rc.2 in `.coderabbit.yaml`

### Src

- Updated `generated_proto.py` file to work with new proto version
- fix: Ensure UTF-8 encoding when reading and writing proto files in `generate_proto.py` to prevent encoding issues on Windows (`#1963`)

### Examples

- Updated the `examples/consensus/topic_create_transaction_revenue_generating.py` example to use `Client.from_env()` for simpler client setup. (#1964)

- Refactored `examples/consensus/topic_delete_transaction.py` to use Client.from_env() for simplified client initialization, removed manual setup code, and cleaned up unused imports (`os`, `AccountId`, `PrivateKey`). (`#1971`)

### Tests

### Docs

- Replaced relative documentation links in `README.md` with absolute GitHub URLs to fix broken PyPI rendering.
- docs: Clarified AI usage in Good First Issues templates. (#1923)
- docs: Moved the Windows setup guide to docs/sdk_developers/ and added missing setup sections. (`#1953`)



### .github

- chore: ensure uv run uses lowest-direct resolution in deps-check workflow (#1919)
- Added PR draft explainer workflow to comment when PRs are converted to draft after changes are requested. (#1723)
- changed `pr-check-test` to run unit matrix first, run integration matrix only after unit success, skip docs/examples/.github-only changes, and parallelize integration tests with xdist (`#1878`)
Expand All @@ -101,6 +107,7 @@ This changelog is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.
- chore: update bot-community-calls workflow to use self hosted runner (#1942)
- chore(ci): update bot-inactivity-unassign workflow to use hl-sdk-py-lin-md runner
- chore: update bot-gfi-candidate-notification workflow to use hl-sdk-py-lin-md runner (`#1966`)

## [0.2.1] - 2026-03-05

### Added
Expand All @@ -119,13 +126,15 @@ This changelog is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.
- Fixed duplication in GitHub bot next issue recommendations by parsing actual issue descriptions instead of blind truncation (#1658)

### Src

- Add `staking_info` field to `ContractInfo` class to expose staking metadata using the `StakingInfo` wrapper. (#1365)
- Fix `TopicInfo.__str__()` to format `expiration_time` in UTC so unit tests pass in non-UTC environments. (#1800)
- Resolve CodeQL `reflected-XSS` warning in TCK JSON-RPC endpoint
- Improve `keccak256` docstring formatting for better readability and consistency (#1624)
- Added `wait_for_receipt` parameter for `Transaction.execute()` to support optional receipt waiting, and `get_receipt_query`, `get_record_query` and `get_record` to `TransactionResponse`.

### Examples

- Refactor `examples/file/file_create_transaction.py` to remove `os`,`dotenv`,`AccountId`,`PrivateKey`,`Network` imports that are no longer needed and updated setup-client() (#1610)

- Refactored contract_delete_transaction example to use Client.from_env. (#1823)
Expand All @@ -144,10 +153,12 @@ This changelog is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.
- doc: Fix testnet link in README.md. (#1879)

### Tests

- Format `tests/unit/endpoint_test.py` using black. (`#1792`)
- Implement TCK JSON-RPC server with request handling and error management

### .github

- Added triage members max assignment is protected from being a mentor in `.github/scripts/bot-assignment-check.sh`. (#1718)
- Added automated bot to comment on PRs with invalid conventional commit titles, providing guidance on fixing the title format (#1705)
- Revert PythonBot workflow to restore previous stable behavior. (#1825)
Expand All @@ -169,6 +180,7 @@ This changelog is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.
## [0.2.0] - 2026-11-02

### Tests

- Format `tests/unit/crypto_utils_test.py` with black for code style consistency (#1524)
- Standardize formatting of `tests/unit/entity_id_helper_test.py` using Black for consistent code style across the test suite (#1527)

Expand All @@ -195,6 +207,7 @@ This changelog is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.
- Format `tests/unit/custom_fee_test.py` with black for code style consistency. (#1525)

### Added

- Implement custom `__repr__` method for `FileId` class that returns constructor-style representation for improved debugging experience (#1628)
- Added foundational guide for GitHub Workflows (#1741)
- Contract-specific CodeRabbit review instructions in `.coderabbit.yaml` for improved automated PR feedback on ABI, gas, ContractId, and protobuf safety. (#1695)
Expand Down Expand Up @@ -268,20 +281,20 @@ This changelog is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.
- feat: AccountCreateTransaction now supports both PrivateKey and PublicKey [#939](https://github.com/hiero-ledger/hiero-sdk-python/issues/939)
- Added Acceptance Criteria section to Good First Issue template for better contributor guidance (#997)
- Added `__str__()` to CustomRoyaltyFee and updated examples and tests accordingly (#986)
- Restore bug and feature request issue templates (#996)(https://github.com/hiero-ledger/hiero-sdk-python/issues/996)
- Restore bug and feature request issue templates (#996)(<https://github.com/hiero-ledger/hiero-sdk-python/issues/996>)
- Support selecting specific node account ID(s) for queries and transactions and added `Network._get_node()` with updated execution flow (#362)
- Add TLS support with two-stage control (`set_transport_security()` and `set_verify_certificates()`) for encrypted connections to Hedera networks. TLS is enabled by default for hosted networks (mainnet, testnet, previewnet) and disabled for local networks (solo, localhost) (#855)
- Add PR inactivity reminder bot for stale pull requests `.github/workflows/pr-inactivity-reminder-bot.yml`
- Add comprehensive training documentation for \_Executable class `docs/sdk_developers/training/executable.md`
- Added empty `docs/maintainers/good_first_issues.md` file for maintainers to write Good First Issue guidelines (#1034)
- Added new `.github/ISSUE_TEMPLATE/04_good_first_issue_candidate.yml` file (1068)(https://github.com/hiero-ledger/hiero-sdk-python/issues/1068)
- Added new `.github/ISSUE_TEMPLATE/04_good_first_issue_candidate.yml` file (1068)(<https://github.com/hiero-ledger/hiero-sdk-python/issues/1068>)
- Enhanced `.github/ISSUE_TEMPLATE/01_good_first_issue.yml` with welcoming message and acceptance criteria sections to guide contributors in creating quality GFIs (#1052)
- Add workflow to notify team about P0 issues `bot-p0-issues-notify-team.yml`
- Added Issue Reminder (no-PR) bot, .github/scripts/issue_reminder_no_pr.sh and .github/workflows/bot-issue-reminder-no-pr.yml to automatically detect assigned issues with no linked pull requests for 7+ days and post a gentle ReminderBot comment.(#951)
- Add support for include_children in TransactionGetReceiptQuery (#1100)(https://github.com/hiero-ledger/hiero-sdk-python/issues/1100)
- Add new `.github/ISSUE_TEMPLATE/05_intermediate_issue.yml` file (1072)(https://github.com/hiero-ledger/hiero-sdk-python/issues/1072)
- Add support for include_children in TransactionGetReceiptQuery (#1100)(<https://github.com/hiero-ledger/hiero-sdk-python/issues/1100>)
- Add new `.github/ISSUE_TEMPLATE/05_intermediate_issue.yml` file (1072)(<https://github.com/hiero-ledger/hiero-sdk-python/issues/1072>)
- Add a workflow to notify the team when issues are labeled as “good first issues” or identified as candidates for that label: `bot-gfi-notify-team.yml`(#1115)
- Added **str** and **repr** to AccountBalance
- Added __str__ and __repr__ to AccountBalance
- Added GitHub workflow that makes sure newly added test files follow pytest test files naming conventions (#1054)
- Added advanced issue template
- Added advanced issue template for contributors `.github/ISSUE_TEMPLATE/06_advanced_issue.yml`.
Expand Down Expand Up @@ -318,12 +331,14 @@ This changelog is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.
- Added `__eq__` and `__hash__` functions for Key

### Documentation

- Added `docs/workflows/02-architecture.md`: explains the orchestration (YAML) vs. business logic (JS) separation pattern for GitHub workflows (#1742)
- Fix relative links in `testing.md`, clean up `CONTRIBUTING.md` TOC, and normalize test file naming and paths (`#1706`)
- Added comprehensive docstring to `compress_with_cryptography` function (#1626)
- Replaced the docstring in `entity_id_helper.py` with one that is correct. (#1623)

### Changed

- Reduced linting errors in `examples/` directory by 80% (952 → 185) by fixing docstring formatting, import ordering, and applying auto-fixes (#1768)
- Improved bot message formatting in LinkBot to display issue linking format as a code block for better clarity (#1762)
- Refactored `setup_client()` in all `examples/query/` files to use `Client.from_env()` for simplified client initialization (#1449)
Expand Down Expand Up @@ -391,7 +406,7 @@ This changelog is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.
`examples.yml` → `pr-check-examples.yml`,
`test.yml` → `pr-check-test.yml` (#1043)
- Cleaned up `token_airdrop_claim_auto` example for pylint compliance (no functional changes). (#1079)
- Formatted `examples/query` using black (#1082)(https://github.com/hiero-ledger/hiero-sdk-python/issues/1082)
- Formatted `examples/query` using black (#1082)(<https://github.com/hiero-ledger/hiero-sdk-python/issues/1082>)
- Update team notification script and workflow for P0 issues 'p0_issues_notify_team.js'
- Rename test files across the repository to ensure they consistently end with \_test.py (#1055)
- Cleaned up `token_airdrop_claim_signature_required` example for pylint compliance (no functional changes). (#1080)
Expand Down Expand Up @@ -428,8 +443,8 @@ This changelog is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.
- chore: clarify wording in the bot-assignment-check.sh (#1748)
- Refactored SDK dependencies to use version ranges, moved build-only deps out of runtime, removed unused core deps and added optional extras.


### Fixed

- Added a fork guard condition to prevent Codecov upload failures on fork PRs due to missing token. (`#1485`)
- Corrected broken documentation links in SDK developer training files.(#1707)
- Updated Good First Issue recommendations to supported Hiero repositories. (#1689)
Expand Down Expand Up @@ -582,7 +597,7 @@ This changelog is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.
- Update `docs/sdk_users/running_examples.md` to include `TokenFeeScheduleUpdateTransaction`.
- added FreezeTransaction class
- added FreezeType class
- Added `docs/sdk_developers/pylance.md`, a new guide explaining how to set up and use **Pylance** in VS Code for validating imports, file references, and methods before review. (#713)
- Added `docs/sdk_developers/pylance.md`, a new guide explaining how to set up and use __Pylance__ in VS Code for validating imports, file references, and methods before review. (#713)
- feat: TokenAirdropClaim Transaction, examples (with signing required and not), unit and integration tests (#201)
- docs: Add Google-style docstrings to `TokenId` class and its methods in `token_id.py`.
- added Google-style docstrings to the `TransactionRecord` class including all dataclass fields, `__repr__`, `_from_proto()` & `_to_proto()` methods.
Expand All @@ -599,6 +614,7 @@ This changelog is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.
- docs: Add `docs/sdk_developers/project_structure.md` to explain repository layout and import paths.

### Changed

- chore: renamed examples to match src where possible
- Moved examples/ to be inside subfiles to match src structure
- changed example script workflow to run on new subdirectory structure
Expand Down Expand Up @@ -844,11 +860,11 @@ contract_call_local_pb2.ContractLoginfo -> contract_types_pb2.ContractLoginfo

- Removed init.py content in /tokens

**Changed imports**
__Changed imports__

- src/hiero_sdk_python/consensus/topic_message.py: from hiero_sdk_python import Timestamp → from hiero_sdk_python.timestamp import Timestamp
- src/hiero_sdk_python/query/topic_message_query.py: from hiero_sdk_python import Client → from hiero_sdk_python.client.client import Client
- src/hiero_sdk_python/tokens/**init**.py: content removed.
- src/hiero_sdk_python/tokens/__init__.py: content removed.
- src/hiero_sdk_python/tokens/token_info.py: from hiero_sdk_python.hapi.services.token_get_info_pb2 import TokenInfo as proto_TokenInfo → from hiero_sdk_python.hapi.services import token_get_info_pb2
- src/hiero_sdk_python/tokens/token_key_validation.py: from hiero_sdk_python.hapi.services → import basic_types_pb2
- src/hiero_sdk_python/tokens/token_kyc_status.py: from hiero_sdk_python.hapi.services.basic_types_pb2 import TokenKycStatus as proto_TokenKycStatus → from hiero_sdk_python.hapi.services import basic_types_pb2
Expand Down Expand Up @@ -889,7 +905,7 @@ contract_call_local_pb2.ContractLoginfo -> contract_types_pb2.ContractLoginfo

### Breaking API changes

**We have several camelCase uses that will be deprecated → snake_case** Original aliases will continue to function, with a warning, until the following release.
__We have several camelCase uses that will be deprecated → snake_case__ Original aliases will continue to function, with a warning, until the following release.

#### In `token_info.py`

Expand Down Expand Up @@ -1042,5 +1058,4 @@ contract_call_local_pb2.ContractLoginfo -> contract_types_pb2.ContractLoginfo

- N/A


# [0.1.0] - 2025-02-19
Loading