Skip to content

Commit d52548d

Browse files
authored
Merge branch 'main' into feat/sync-issue-labels
Signed-off-by: cheese-cakee <farzanaman99@gmail.com>
2 parents 324c8f1 + 390f5e0 commit d52548d

57 files changed

Lines changed: 1434 additions & 900 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.coderabbit.yaml

Lines changed: 99 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1249,12 +1249,12 @@ reviews:
12491249
2. Extract the module name before `_pb2`
12501250
(e.g. `transaction_record` from `transaction_record_pb2`)
12511251
3. Build the canonical URL:
1252-
`https://github.com/hashgraph/hedera-protobufs/blob/v0.66.0/<path>/<module>.proto`
1252+
`https://github.com/hashgraph/hedera-protobufs/blob/v0.72.0-rc.2/<path>/<module>.proto`
12531253

12541254
**Example:**
12551255
```
12561256
Import: from hiero_sdk_python.hapi.services import transaction_record_pb2
1257-
Schema: https://github.com/hashgraph/hedera-protobufs/blob/v0.66.0/services/transaction_record.proto
1257+
Schema: https://github.com/hashgraph/hedera-protobufs/blob/v0.72.0-rc.2/services/transaction_record.proto
12581258
```
12591259

12601260
### Step 3 — Compare the SDK class against the proto schema
@@ -1816,7 +1816,7 @@ reviews:
18161816
- Flag the **missing override** in `TopicMessageSubmitTransaction` as **MAJOR**
18171817
if the base-class default is not appropriate for message submission, or add a
18181818
comment confirming the base-class value is intentional.
1819-
- Flag any value that deviates from the table above without a comment as **MAJOR**.
1819+
- Flag any value that deviates from sibling-class defaults as **MAJOR**.
18201820
18211821
#### 5c) General fee/limit logic
18221822
- Confirm any fee/max payment logic is consistent and does not allow unintended
@@ -1850,6 +1850,102 @@ reviews:
18501850
- path: "src/hiero_sdk_python/crypto/**/*.py"
18511851
instructions: *crypto_review_instructions
18521852

1853+
- path: "src/hiero_sdk_python/account/**/*.py"
1854+
instructions: |
1855+
You are reviewing Python files in the `src/hiero_sdk_python/account/` directory.
1856+
These files implement account-related transactions, queries, and data types for the Hiero SDK.
1857+
1858+
> Note: Protobuf schema alignment (field names, types, oneof, bytes normalization,
1859+
> repeated defaults, and canonical `.proto` URL derivation) is already enforced by
1860+
> the global `src/hiero_sdk_python/**/*.py` instruction. Do NOT re-run those checks
1861+
> here — focus exclusively on the account-domain concerns below.
1862+
1863+
---
1864+
1865+
## Review priorities (highest → lowest)
1866+
1867+
### 1) Protobuf correctness (must-not-break)
1868+
- Validate field names, field types, and field numbers +
1869+
repeated/optional semantics against the canonical `.proto` schema.
1870+
- Ensure `_to_proto` / `_from_proto` set the correct oneof branches
1871+
and do not drop fields.
1872+
- Treat silent coercions, defaulting, or ignored exceptions as
1873+
**BLOCKER** if they could change what is signed or sent.
1874+
1875+
### 2) AccountId — alias / EVM address handling
1876+
`AccountId` has three identity modes: numeric `num`, `alias_key`,
1877+
and `evm_address`. Verify `_from_proto`/`_to_proto` symmetry across
1878+
all three. `__hash__` only covers `(shard, realm, num)` — alias-only
1879+
IDs with `num=0` can collide in dicts/sets. **MAJOR** if broken.
1880+
1881+
### 3) Allowance mutation paths
1882+
When modifying existing `TokenNftAllowance` entries, mutation path and
1883+
append path must set `approved_for_all` to the same intended value.
1884+
`None` passed to typed arguments like `amount` must raise, not silently
1885+
produce zero. **MAJOR**.
1886+
1887+
### 4) Errors & API ergonomics
1888+
- Errors should be actionable and consistent; avoid swallowing or
1889+
printing RPC/precheck errors.
1890+
- Ambiguous exceptions or inconsistent return types are **MINOR** /
1891+
**MAJOR** depending on impact.
1892+
1893+
---
1894+
1895+
## ARCHITECTURAL INVARIANTS (stable)
1896+
These describe what must always be true, regardless of code changes.
1897+
They are ordered by severity.
1898+
1899+
1. **Falsy-guard trap on optional integers** — Fields like
1900+
`staked_node_id` where `0` is a valid value must never use
1901+
`if field:` guards. Use `if field is not None:`. **BLOCKER**
1902+
if it silently drops valid data.
1903+
1904+
2. **Mutable default arguments** — Flag any mutable object
1905+
(`list`, `dict`, `set`, or non-frozen class instance) used as
1906+
a default parameter in `__init__`. Default to `None` and assign
1907+
in the body. **MAJOR**.
1908+
1909+
Exception: frozen/immutable types are safe as defaults and must
1910+
NOT be flagged. This includes `@dataclass(frozen=True)` classes
1911+
(e.g., `Duration`), tuples, frozensets, and primitives (int, str,
1912+
bool, None).
1913+
1914+
3. **Library-safe error handling** — No bare `except Exception`
1915+
with `print`/`traceback` in library code. Callers cannot
1916+
suppress stdout side effects. **MAJOR**.
1917+
1918+
---
1919+
1920+
## KNOWN INSTANCES (transient — remove when fixed)
1921+
1922+
_Check if these still exist before flagging._
1923+
1924+
- `AccountRecordsQuery._make_request`: bare except + print
1925+
→ violates invariant #3
1926+
- `AccountId.from_string`: verify `from e` chaining not removed
1927+
→ exception context silently lost if removed
1928+
- `AccountInfo._to_proto`: falsy guard on `staked_node_id`
1929+
→ violates invariant #1
1930+
1931+
---
1932+
1933+
## Test expectations
1934+
PRs modifying account code should have tests covering:
1935+
- AccountId round-trip across all three identity modes
1936+
- `__hash__` behavior for alias-only IDs with `num=0`
1937+
- Invalid/None arguments raising errors, not silently defaulting
1938+
- `_from_proto(_to_proto(x))` field round-trip equality
1939+
1940+
---
1941+
1942+
## Severity labels
1943+
Use exactly these labels in all findings:
1944+
- **BLOCKER** — must be fixed before merge; wire-format, signing, or data-loss risk
1945+
- **MAJOR** — should be fixed; correctness or significant usability issue
1946+
- **MINOR** — should be fixed; low-risk correctness or ergonomics issue
1947+
- **NIT** — optional; style, naming, or documentation only
1948+
18531949
chat:
18541950
art: false # Don't draw ASCII art (false)
18551951
auto_reply: false # Don't allow bot to converse (spammy)

.github/ISSUE_TEMPLATE/01_good_first_issue_candidate.yml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ body:
3636
label: 🆕🐥 Newcomer Friendly
3737
description: Who is this issue for?
3838
value: |
39-
This **[Good First Issue](https://github.com/hiero-ledger/hiero-sdk-python/issues?q=is%3Aissue%20state%3Aopen%20label%3A%22Good%20First%20Issue%22%20no%3Aassignee)** is a guided, well-scoped task intended for new contributors to the Hiero Python SDK.
39+
This **[Good First Issue](https://github.com/hiero-ledger/hiero-sdk-python/issues?q=is%3Aissue%20state%3Aopen%20label%3A%22Good%20First%20Issue%22%20no%3Aassignee)** is a guided, well-scoped task intended for new human contributors to the Hiero Python SDK.
4040
4141
#### What you’ll do
4242
- ✅ understand how the repository is structured
@@ -269,7 +269,7 @@ body:
269269
270270
- [ ] **Connect** origin with upstream: [Guide](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/docs/sdk_developers/training/workflow/03_staying_in_sync.md)
271271
272-
- [ ] **Install Packages** and protobufs: [Guide](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/docs/sdk_developers/training/setup/02_installing_hiero_python_sdk.md) (or [Windows Setup Guide](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/docs/sdk_developers/training/setup/setup_windows.md) for Windows users)
272+
- [ ] **Install Packages** and protobufs: [Guide](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/docs/sdk_developers/training/setup/02_installing_hiero_python_sdk.md) (or [Windows Setup Guide](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/docs/sdk_developers/setup_windows.md) for Windows users)
273273
274274
- [ ] **Sync Main** pull any recent upstream changes: [Guide](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/docs/sdk_developers/rebasing.md)
275275
@@ -394,12 +394,7 @@ body:
394394
label: 🤖 AI usage guidelines
395395
description: Guidance on using AI tools responsibly for this issue.
396396
value: |
397-
You’re welcome to use AI tools while working on this issue.
398-
399-
Many contributors do — especially for:
400-
- understanding unfamiliar code
401-
- drafting small refactors
402-
- sanity-checking approaches
397+
Humans are welcome to use AI tools while working on this issue but we do not accept AI bot-authored PRs.
403398
404399
**Use AI responsibly:**
405400
- review suggestions carefully

.github/ISSUE_TEMPLATE/02_good_first_issue.yml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ body:
2020
label: 🆕🐥 Newcomer Friendly
2121
description: Who is this issue for?
2222
value: |
23-
This **[Good First Issue](https://github.com/hiero-ledger/hiero-sdk-python/issues?q=is%3Aissue%20state%3Aopen%20label%3A%22Good%20First%20Issue%22%20no%3Aassignee)** is a guided, well-scoped task intended for new contributors to the Hiero Python SDK.
23+
This **[Good First Issue](https://github.com/hiero-ledger/hiero-sdk-python/issues?q=is%3Aissue%20state%3Aopen%20label%3A%22Good%20First%20Issue%22%20no%3Aassignee)** is a guided, well-scoped task intended for new human contributors to the Hiero Python SDK.
2424
2525
#### What you’ll do
2626
- ✅ understand how the repository is structured
@@ -253,7 +253,7 @@ body:
253253
254254
- [ ] **Connect** origin with upstream: [Guide](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/docs/sdk_developers/training/workflow/03_staying_in_sync.md)
255255
256-
- [ ] **Install Packages** and protobufs: [Guide](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/docs/sdk_developers/training/setup/02_installing_hiero_python_sdk.md) (or [Windows Setup Guide](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/docs/sdk_developers/training/setup/setup_windows.md) for Windows users)
256+
- [ ] **Install Packages** and protobufs: [Guide](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/docs/sdk_developers/training/setup/02_installing_hiero_python_sdk.md) (or [Windows Setup Guide](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/docs/sdk_developers/setup_windows.md) for Windows users)
257257
258258
- [ ] **Sync Main** pull any recent upstream changes: [Guide](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/docs/sdk_developers/rebasing.md)
259259
@@ -378,12 +378,7 @@ body:
378378
label: 🤖 AI usage guidelines
379379
description: Guidance on using AI tools responsibly for this issue.
380380
value: |
381-
You’re welcome to use AI tools while working on this issue.
382-
383-
Many contributors do — especially for:
384-
- understanding unfamiliar code
385-
- drafting small refactors
386-
- sanity-checking approaches
381+
Humans are welcome to use AI tools while working on this issue but we do not accept AI bot-authored PRs.
387382
388383
**Use AI responsibly:**
389384
- review suggestions carefully

.github/scripts/bot-intermediate-assignment.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const EXEMPT_PERMISSION_LEVELS = (process.env.INTERMEDIATE_EXEMPT_PERMISSIONS ||
66
.map((entry) => entry.trim().toLowerCase())
77
.filter(Boolean);
88
const DRY_RUN = /^true$/i.test(process.env.DRY_RUN || '');
9-
const REQUIRED_BEGINNER_ISSUE_COUNT = 0 ;
9+
const REQUIRED_BEGINNER_ISSUE_COUNT = 1 ;
1010

1111
function isSafeSearchToken(value) {
1212
return typeof value === 'string' && /^[a-zA-Z0-9._/-]+$/.test(value);

0 commit comments

Comments
 (0)