Skip to content

Commit 6fcf22f

Browse files
committed
Merge branch 'reminder' of https://github.com/prajeeta15/hiero-sdk-python into reminder
2 parents 1ef0e9c + c9b7b60 commit 6fcf22f

File tree

195 files changed

+1001
-510
lines changed

Some content is hidden

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

195 files changed

+1001
-510
lines changed

.github/ISSUE_TEMPLATE/01_good_first_issue.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@ title: "[Good First Issue]: "
44
labels: ["Good First Issue"]
55
assignees: []
66
body:
7+
- type: markdown
8+
attributes:
9+
value: |
10+
---
11+
## **Thanks for contributing!** 😊
12+
13+
We truly appreciate your time and effort. If this is your first open-source contribution, welcome!
14+
This template is designed to help you create a Good First Issue (GFI) : a small, well-scoped task that helps new contributors learn the codebase and workflow.
15+
---
716
- type: textarea
817
id: intro
918
attributes:
@@ -16,6 +25,38 @@ body:
1625
validations:
1726
required: false
1827

28+
- type: markdown
29+
attributes:
30+
value: |
31+
> [!IMPORTANT]
32+
> ### 📋 Good First Issue (GFI) Guidelines
33+
>
34+
> **What we generally consider good first issues:**
35+
>
36+
> - **Narrow changes or additions to `src` functionality** that use generic Python skills which can be tested by adding to an existing test. For example:
37+
> - `__str__` functions
38+
> - `__repr__` functions
39+
> - Typing fixes, like return type hints or basic type conflicts
40+
> - **Refactors of existing examples:**
41+
> - Separating existing examples into separate functions
42+
> - Or, conversely, taking a split example into a monolithic function
43+
> - **Improvements to documentation** in examples and source code:
44+
> - Docstrings: module docstrings, function docstrings
45+
> - Inline comments
46+
> - Addition or changes to print statements to improve clarity
47+
> - **Functional improvements to examples:**
48+
> - Additional steps that would help to illustrate functionality
49+
> - **Specific additions to existing unit or integration tests**
50+
>
51+
> **What we generally do NOT consider good first issues:**
52+
>
53+
> - Creation of new examples
54+
> - Creation of new unit and integration tests
55+
> - Changes to DLT functionality, like `to_proto` and `from_proto`
56+
> - Anything requiring knowledge of multiple areas of the codebase
57+
>
58+
> 📖 *For a more detailed explanation, refer to `docs/maintainers/good_first_issues_guidelines.md`.*
59+
1960
- type: textarea
2061
id: issue
2162
attributes:
Lines changed: 281 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,281 @@
1+
name: Good First Issue Candidate Template
2+
description: Propose a potential Good First Issue (candidate)
3+
title: "[Good First Issue]:"
4+
labels: ["Good First Issue Candidate"]
5+
assignees: []
6+
body:
7+
- type: textarea
8+
id: intro-gfi-candidate
9+
attributes:
10+
label: ⚠️ Good First Issue — Candidate
11+
value: |
12+
> This issue is not yet a confirmed Good First Issue.
13+
> It is being evaluated for suitability and may require
14+
> clarification or refinement before it is ready to be picked up.
15+
>
16+
> Please wait for maintainer confirmation before starting work.
17+
>
18+
> Maintainers and reviewers can read more about Good First Issues:
19+
> docs/maintainers/good_first_issue_guidelines.md
20+
21+
validations:
22+
required: false
23+
24+
- type: textarea
25+
id: intro
26+
attributes:
27+
label: 🆕🐥 First Timers Only
28+
description: Who is this issue for?
29+
value: |
30+
This issue is reserved for people who have never contributed or have made minimal contributions to [Hiero Python SDK](https://hiero.org).
31+
We know that creating a pull request (PR) is a major barrier for new contributors.
32+
The goal of this issue and all other issues in [**find a good first issue**](https://github.com/issues?q=is%3Aopen+is%3Aissue+org%3Ahiero-ledger+archived%3Afalse+label%3A%22good+first+issue%22+) is to help you make your first contribution to the Hiero Python SDK.
33+
validations:
34+
required: false
35+
36+
- type: markdown
37+
attributes:
38+
value: |
39+
> [!IMPORTANT]
40+
> ### 📋 Good First Issue (GFI) Guidelines
41+
>
42+
> **What we generally consider good first issues:**
43+
>
44+
> - **Narrow changes or additions to `src` functionality** that use generic Python skills which can be tested by adding to an existing test. For example:
45+
> - `__str__` functions
46+
> - `__repr__` functions
47+
> - Typing fixes, like return type hints or basic type conflicts
48+
> - **Refactors of existing examples:**
49+
> - Separating existing examples into separate functions
50+
> - Or, conversely, taking a split example into a monolithic function
51+
> - **Improvements to documentation** in examples and source code:
52+
> - Docstrings: module docstrings, function docstrings
53+
> - Inline comments
54+
> - Addition or changes to print statements to improve clarity
55+
> - **Functional improvements to examples:**
56+
> - Additional steps that would help to illustrate functionality
57+
> - **Specific additions to existing unit or integration tests**
58+
>
59+
> **What we generally do NOT consider good first issues:**
60+
>
61+
> - Creation of new examples
62+
> - Creation of new unit and integration tests
63+
> - Changes to DLT functionality, like `to_proto` and `from_proto`
64+
> - Anything requiring knowledge of multiple areas of the codebase
65+
>
66+
> 📖 *For a more detailed explanation, refer to `docs/maintainers/good_first_issues_guidelines.md`.*
67+
68+
- type: textarea
69+
id: issue
70+
attributes:
71+
label: 👾 Description of the issue
72+
description: |
73+
DESCRIBE THE ISSUE IN A WAY THAT IS UNDERSTANDABLE TO NEW CONTRIBUTORS.
74+
YOU MUST NOT ASSUME THAT SUCH CONTRIBUTORS HAVE ANY KNOWLEDGE ABOUT THE CODEBASE OR HIERO.
75+
IT IS HELPFUL TO ADD LINKS TO THE RELEVANT DOCUMENTATION AND/OR CODE SECTIONS.
76+
BELOW IS AN EXAMPLE.
77+
value: |
78+
Edit here. Example provided below.
79+
80+
validations:
81+
required: true
82+
83+
- type: markdown
84+
attributes:
85+
value: |
86+
<!-- Example for problem (hidden in submission) -->
87+
## 👾 Description of the issue - Example
88+
89+
The example for Token Associate Transaction located at examples/tokens/token_associate_transaction.py can be improved. It correctly illustrates how to associate a token, however, it does so all from one function main()
90+
91+
As everything is grouped together in main(), it is difficult for a user to understand all the individual steps required to associate a token.
92+
93+
For example:
94+
```python
95+
96+
def run_demo():
97+
"""Monolithic token association demo."""
98+
print(f"🚀 Connecting to Hedera {network_name} network!")
99+
client = Client(Network(network_name))
100+
operator_id = AccountId.from_string(os.getenv("OPERATOR_ID", ""))
101+
operator_key = PrivateKey.from_string(os.getenv("OPERATOR_KEY", ""))
102+
client.set_operator(operator_id, operator_key)
103+
print(f"✅ Client ready (operator {operator_id})")
104+
105+
test_key = PrivateKey.generate_ed25519()
106+
receipt = (
107+
AccountCreateTransaction()
108+
.set_key(test_key.public_key())
109+
.set_initial_balance(Hbar(1))
110+
.set_account_memo("Test account for token association demo")
111+
.freeze_with(client)
112+
.sign(operator_key)
113+
.execute(client)
114+
)
115+
if receipt.status != ResponseCode.SUCCESS:
116+
raise Exception(receipt.status)
117+
account_id = receipt.account_id
118+
print(f"✅ Created test account {account_id}")
119+
120+
# Create tokens
121+
tokens = []
122+
for i in range(3):
123+
try:
124+
receipt = (
125+
TokenCreateTransaction()
126+
.set_token_name(f"DemoToken{i}")
127+
.set_token_symbol(f"DTK{i}")
128+
.set_decimals(2)
129+
.set_initial_supply(100_000)
130+
.set_treasury_account_id(operator_id)
131+
.freeze_with(client)
132+
.sign(operator_key)
133+
.execute(client)
134+
)
135+
if receipt.status != ResponseCode.SUCCESS:
136+
raise Exception(receipt.status)
137+
token_id = receipt.token_id
138+
tokens.append(token_id)
139+
print(f"✅ Created token {token_id}")
140+
except Exception as e:
141+
print(f"❌ Token creation failed: {e}")
142+
sys.exit(1)
143+
144+
# Associate first token
145+
try:
146+
TokenAssociateTransaction().set_account_id(account_id).add_token_id(tokens[0]).freeze_with(client).sign(test_key).execute(client)
147+
print(f"✅ Token {tokens[0]} associated with account {account_id}")
148+
except Exception as e:
149+
print(f"❌ Token association failed: {e}")
150+
sys.exit(1)
151+
```
152+
153+
- type: textarea
154+
id: solution
155+
attributes:
156+
label: 💡 Proposed Solution
157+
description: |
158+
AT THIS SECTION YOU NEED TO DESCRIBE THE STEPS NEEDED TO SOLVE THE ISSUE.
159+
PLEASE BREAK DOWN THE STEPS AS MUCH AS POSSIBLE AND MAKE SURE THAT THEY
160+
ARE EASY TO FOLLOW. IF POSSIBLE, ADD LINKS TO THE RELEVANT
161+
DOCUMENTATION AND/OR CODE SECTIONS.
162+
value: |
163+
Edit here. Example provided below.
164+
165+
validations:
166+
required: true
167+
168+
- type: markdown
169+
attributes:
170+
value: |
171+
<!-- Example for the solution (hidden in submission) -->
172+
## 💡 Solution - Example
173+
174+
For the TokenAssociateTransaction example, the solution is to split the monolithic main() function for illustrating TokenAssociateTransaction into separate smaller functions which are called from main().
175+
Such as:
176+
- Setting up the client
177+
- Creating an account
178+
- Creating a token
179+
- Associating the account to the token
180+
181+
- type: textarea
182+
id: implementation
183+
attributes:
184+
label: 👩‍💻 Implementation Steps
185+
description: |
186+
AT THIS SECTION YOU NEED TO DESCRIBE THE TECHNICAL STEPS NEEDED TO SOLVE THE ISSUE.
187+
PLEASE BREAK DOWN THE STEPS AS MUCH AS POSSIBLE AND MAKE SURE THAT THEY ARE EASY TO FOLLOW.
188+
IF POSSIBLE, ADD LINKS TO THE RELEVANT DOCUMENTATION AND/OR CODE.
189+
value: |
190+
Edit here. Example provided below.
191+
192+
validations:
193+
required: true
194+
195+
- type: markdown
196+
attributes:
197+
value: |
198+
<!-- Example implementation (hidden in submission) -->
199+
### 👩‍💻 Implementation - Example
200+
201+
To break down the monolithic main function, you need to:
202+
- [ ] Extract the Key Steps (set up a client, create a test account, create a token, associate the token)
203+
- [ ] Copy and paste the functionality for each key step into its own function
204+
- [ ] Pass to each function the variables you need to run it
205+
- [ ] Call each function in main()
206+
- [ ] Ensure you return the values you'll need to pass on to the next step in main
207+
- [ ] Ensure the example still runs and has the same output!
208+
209+
For example:
210+
```python
211+
212+
def setup_client():
213+
"""Initialize and set up the client with operator account."""
214+
215+
def create_test_account(client, operator_key):
216+
"""Create a new test account for demonstration."""
217+
218+
def create_fungible_token(client, operator_id, operator_key):
219+
"""Create a fungible token for association with test account."""
220+
221+
def associate_token_with_account(client, token_id, account_id, account_key):
222+
"""Associate the token with the test account."""
223+
224+
def main():
225+
client, operator_id, operator_key = setup_client()
226+
account_id, account_private_key = create_test_account(client, operator_key)
227+
token_id = create_fungible_token(client, operator_id, operator_key)
228+
associate_token_with_account(client, token_id, account_id, account_private_key)
229+
```
230+
231+
- type: textarea
232+
id: acceptance-criteria
233+
attributes:
234+
label: ✅ Acceptance Criteria
235+
description: |
236+
EDIT OR EXPAND THE CHECKLIST ON WHAT IS REQUIRED TO BE ABLE TO MERGE A PULL REQUEST FOR THIS ISSUE
237+
value: |
238+
To be able to merge a pull request for this issue, we need:
239+
- [ ] **Changelog Entry:** Correct changelog entry (please link to the documentation - [see guide](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/docs/sdk_developers/changelog_entry.md))
240+
- [ ] **Signed commits:** commits must be DCO and GPG key signed ([see guide](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/docs/sdk_developers/signing.md))
241+
- [ ] **All Tests Pass:** our workflow checks like unit and integration tests must pass
242+
- [ ] **Issue is Solved:** The implementation fully addresses the issue requirements as described above
243+
- [ ] **No Further Changes are Made:** Code review feedback has been addressed and no further changes are requested
244+
validations:
245+
required: true
246+
247+
- type: textarea
248+
id: contribution_steps
249+
attributes:
250+
label: 📋 Step-by-Step Contribution Guide
251+
description: Provide a contribution workflow suitable for new contributors
252+
value: |
253+
If you have never contributed to an open source project at GitHub, the following step-by-step guide will introduce you to the workflow.
254+
255+
- [ ] **Claim this issue:** Comment below that you are interested in working on the issue. Without assignment, your pull requests might be closed and the issue given to another developer.
256+
- [ ] **Wait for assignment:** A community member with the given rights will add you as an assignee of the issue
257+
- [ ] **Fork, Branch and Work on the issue:** Create a copy of the repository, create a branch for the issue and solve the problem. For instructions, please read our [Contributing guide](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/CONTRIBUTING.md) file. Further help can be found at [Set-up Training](https://github.com/hiero-ledger/hiero-sdk-python/tree/main/docs/sdk_developers/training/setup) and [Workflow Training](https://github.com/hiero-ledger/hiero-sdk-python/tree/main/docs/sdk_developers/training/workflow).
258+
- [ ] **DCO and GPG key sign each commit :** each commit must be -s and -S signed. An explanation on how to do this is at [Signing Guide](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/docs/sdk_developers/signing.md)
259+
- [ ] **Add a Changelog Entry :** your pull request will require a changelog. Read [Changelog Entry Guide](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/docs/sdk_developers/changelog_entry.md) to learn how.
260+
- [ ] **Push and Create a Pull Request :** Once your issue is resolved, and your commits are signed, and you have a changelog entry, push your changes and create a pull request. Detailed instructions can be found at [Submit PR Training](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/docs/sdk_developers/training/workflow/11_submit_pull_request.md), part of [Workflow Training](https://github.com/hiero-ledger/hiero-sdk-python/tree/main/docs/sdk_developers/training/workflow).
261+
- [ ] **You did it 🎉:** A maintainer or committer will review your pull request and provide feedback. If approved, we will merge the fix in the main branch. Thanks for being part of the Hiero community as an open-source contributor ❤️
262+
263+
***IMPORTANT*** Your pull request CANNOT BE MERGED until you add a changelog entry AND sign your commits each with `git commit -S -s -m "chore: your commit message"` with a GPG key setup.
264+
validations:
265+
required: true
266+
267+
- type: textarea
268+
id: information
269+
attributes:
270+
label: 🤔 Additional Information
271+
description: Provide any extra resources or context for contributors to solve this good first issue
272+
value: |
273+
For more help, we have extensive documentation attributes:
274+
- [SDK Developer Docs](https://github.com/hiero-ledger/hiero-sdk-python/tree/main/docs/sdk_developers)
275+
- [SDK Developer Training](https://github.com/hiero-ledger/hiero-sdk-python/tree/main/docs/sdk_developers/training)
276+
277+
Additionally, we invite you to join our community on our [Discord](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/docs/discord.md) server.
278+
279+
We also invite you to attend each Wednesday, 2pm UTC our [Python SDK Office Hour and Community Calls](https://zoom-lfx.platform.linuxfoundation.org/meetings/hiero?view=week). The Python SDK Office hour is for hands-on-help and the Community Call for general community discussion.
280+
281+
You can also ask for help in a comment below!

.github/scripts/inactivity_bot.sh

100644100755
Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@ for ISSUE in $ISSUES; do
7272
echo " [INFO] Issue created at: ${ISSUE_CREATED_AT:-(unknown)}"
7373
echo
7474

75-
# Fetch timeline once (used for assignment events + PR links).
76-
TIMELINE=$(gh api -H "Accept: application/vnd.github.mockingbird-preview+json" "repos/$REPO/issues/$ISSUE/timeline" 2>/dev/null || echo "[]")
77-
TIMELINE=${TIMELINE:-'[]'} # defensive default
75+
# Fetch full timeline with pagination and flatten array
76+
TIMELINE=$(gh api --paginate -H "Accept: application/vnd.github.mockingbird-preview+json" "repos/$REPO/issues/$ISSUE/timeline" 2>/dev/null | jq -s 'add' || echo "[]")
77+
TIMELINE=${TIMELINE:-'[]'}
7878

7979
if [[ -z "${ASSIGNEES// }" ]]; then
8080
echo " [INFO] No assignees for this issue, skipping."
@@ -93,15 +93,18 @@ for ISSUE in $ISSUES; do
9393
ASSIGNED_AT=$(echo "$ASSIGN_EVENT_JSON" | jq -r '.created_at // empty')
9494
ASSIGN_SOURCE="assignment_event"
9595
else
96-
ASSIGNED_AT="${ISSUE_CREATED_AT:-}"
97-
ASSIGN_SOURCE="issue_created_at (no explicit assignment event)"
96+
# FIX: Do not fallback to issue creation date
97+
ASSIGNED_AT=""
98+
ASSIGN_SOURCE="not_found"
9899
fi
99100

100101
if [[ -n "$ASSIGNED_AT" ]]; then
101102
ASSIGNED_TS=$(parse_ts "$ASSIGNED_AT")
102103
ASSIGNED_AGE_DAYS=$(( (NOW_TS - ASSIGNED_TS) / 86400 ))
103104
else
104-
ASSIGNED_AGE_DAYS=0
105+
# Safety valve: if assignment event is missing, skip checking to prevent false positives
106+
echo " [WARN] Could not find 'assigned' event in timeline. Skipping inactivity check for safety."
107+
continue
105108
fi
106109

107110
echo " [INFO] Assignment source: $ASSIGN_SOURCE"
@@ -125,7 +128,6 @@ for ISSUE in $ISSUES; do
125128
echo " [RESULT] Phase 1 -> stale assignment (>= $DAYS days, no PR)"
126129

127130
if (( DRY_RUN == 0 )); then
128-
# NOTE: The EOF must be at the very start of the line!
129131
MESSAGE=$(cat <<EOF
130132
Hi @$USER, this is InactivityBot 👋
131133
@@ -181,7 +183,6 @@ EOF
181183
echo " [RESULT] Phase 2 -> PR #$PR_NUM is stale (>= $DAYS days since last commit)"
182184

183185
if (( DRY_RUN == 0 )); then
184-
# NOTE: The EOF must be at the very start of the line!
185186
MESSAGE=$(cat <<EOF
186187
Hi @$USER, this is InactivityBot 👋
187188
@@ -213,4 +214,4 @@ done
213214
echo "------------------------------------------------------------"
214215
echo " Unified Inactivity Bot Complete"
215216
echo " DRY_RUN: $DRY_RUN"
216-
echo "------------------------------------------------------------"
217+
echo "------------------------------------------------------------"

0 commit comments

Comments
 (0)