Skip to content

Commit 2ffeae5

Browse files
authored
fix: good first issue template issue rendering (#984)
Signed-off-by: exploreriii <133720349+exploreriii@users.noreply.github.com>
1 parent a88c06a commit 2ffeae5

File tree

4 files changed

+229
-179
lines changed

4 files changed

+229
-179
lines changed
Lines changed: 216 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,216 @@
1+
name: Good First Issue Template
2+
description: Create a Good First Issue for new contributors
3+
title: "[Good First Issue]: "
4+
labels: ["Good First Issue"]
5+
assignees: []
6+
body:
7+
- type: textarea
8+
id: intro
9+
attributes:
10+
label: 🆕🐥 First Timers Only
11+
description: Who is this issue for?
12+
value: |
13+
This issue is reserved for people who have never contributed or have made minimal contributions to [Hiero Python SDK](https://hiero.org).
14+
We know that creating a pull request (PR) is a major barrier for new contributors.
15+
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.
16+
validations:
17+
required: false
18+
19+
- type: textarea
20+
id: issue
21+
attributes:
22+
label: 👾 Description of the issue
23+
description: |
24+
DESCRIBE THE ISSUE IN A WAY THAT IS UNDERSTANDABLE TO NEW CONTRIBUTORS.
25+
YOU MUST NOT ASSUME THAT SUCH CONTRIBUTORS HAVE ANY KNOWLEDGE ABOUT THE CODEBASE OR HIERO.
26+
IT IS HELPFUL TO ADD LINKS TO THE RELEVANT DOCUMENTATION AND/OR CODE SECTIONS.
27+
BELOW IS AN EXAMPLE.
28+
value: |
29+
Edit here. Example provided below.
30+
31+
validations:
32+
required: true
33+
34+
- type: markdown
35+
attributes:
36+
value: |
37+
<!-- Example for problem (hidden in submission) -->
38+
## 👾 Description of the issue - Example
39+
40+
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()
41+
42+
As everything is grouped together in main(), it is difficult for a user to understand all the individual steps required to associate a token.
43+
44+
For example:
45+
```python
46+
47+
def run_demo():
48+
"""Monolithic token association demo."""
49+
print(f"🚀 Connecting to Hedera {network_name} network!")
50+
client = Client(Network(network_name))
51+
operator_id = AccountId.from_string(os.getenv("OPERATOR_ID", ""))
52+
operator_key = PrivateKey.from_string(os.getenv("OPERATOR_KEY", ""))
53+
client.set_operator(operator_id, operator_key)
54+
print(f"✅ Client ready (operator {operator_id})")
55+
56+
test_key = PrivateKey.generate_ed25519()
57+
receipt = (
58+
AccountCreateTransaction()
59+
.set_key(test_key.public_key())
60+
.set_initial_balance(Hbar(1))
61+
.set_account_memo("Test account for token association demo")
62+
.freeze_with(client)
63+
.sign(operator_key)
64+
.execute(client)
65+
)
66+
if receipt.status != ResponseCode.SUCCESS:
67+
raise Exception(receipt.status)
68+
account_id = receipt.account_id
69+
print(f"✅ Created test account {account_id}")
70+
71+
# Create tokens
72+
tokens = []
73+
for i in range(3):
74+
try:
75+
receipt = (
76+
TokenCreateTransaction()
77+
.set_token_name(f"DemoToken{i}")
78+
.set_token_symbol(f"DTK{i}")
79+
.set_decimals(2)
80+
.set_initial_supply(100_000)
81+
.set_treasury_account_id(operator_id)
82+
.freeze_with(client)
83+
.sign(operator_key)
84+
.execute(client)
85+
)
86+
if receipt.status != ResponseCode.SUCCESS:
87+
raise Exception(receipt.status)
88+
token_id = receipt.token_id
89+
tokens.append(token_id)
90+
print(f"✅ Created token {token_id}")
91+
except Exception as e:
92+
print(f"❌ Token creation failed: {e}")
93+
sys.exit(1)
94+
95+
# Associate first token
96+
try:
97+
TokenAssociateTransaction().set_account_id(account_id).add_token_id(tokens[0]).freeze_with(client).sign(test_key).execute(client)
98+
print(f"✅ Token {tokens[0]} associated with account {account_id}")
99+
except Exception as e:
100+
print(f"❌ Token association failed: {e}")
101+
sys.exit(1)
102+
```
103+
104+
- type: textarea
105+
id: solution
106+
attributes:
107+
label: 💡 Proposed Solution
108+
description: |
109+
AT THIS SECTION YOU NEED TO DESCRIBE THE STEPS NEEDED TO SOLVE THE ISSUE.
110+
PLEASE BREAK DOWN THE STEPS AS MUCH AS POSSIBLE AND MAKE SURE THAT THEY
111+
ARE EASY TO FOLLOW. IF POSSIBLE, ADD LINKS TO THE RELEVANT
112+
DOCUMENTATION AND/OR CODE SECTIONS.
113+
value: |
114+
Edit here. Example provided below.
115+
116+
validations:
117+
required: true
118+
119+
- type: markdown
120+
attributes:
121+
value: |
122+
<!-- Example for the solution (hidden in submission) -->
123+
## 💡 Solution - Example
124+
125+
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().
126+
Such as:
127+
- Setting up the client
128+
- Creating an account
129+
- Creating a token
130+
- Associating the account to the token
131+
132+
- type: textarea
133+
id: implementation
134+
attributes:
135+
label: 👩‍💻 Implementation Steps
136+
description: |
137+
AT THIS SECTION YOU NEED TO DESCRIBE THE TECHNICAL STEPS NEEDED TO SOLVE THE ISSUE.
138+
PLEASE BREAK DOWN THE STEPS AS MUCH AS POSSIBLE AND MAKE SURE THAT THEY ARE EASY TO FOLLOW.
139+
IF POSSIBLE, ADD LINKS TO THE RELEVANT DOCUMENTATION AND/OR CODE.
140+
value: |
141+
Edit here. Example provided below.
142+
143+
validations:
144+
required: true
145+
146+
- type: markdown
147+
attributes:
148+
value: |
149+
<!-- Example implementation (hidden in submission) -->
150+
### 👩‍💻 Implementation - Example
151+
152+
To break down the monolithic main function, you need to:
153+
- [ ] Extract the Key Steps (set up a client, create a test account, create a token, associate the token)
154+
- [ ] Copy and paste the functionality for each key step into its own function
155+
- [ ] Pass to each function the variables you need to run it
156+
- [ ] Call each function in main()
157+
- [ ] Ensure you return the values you'll need to pass on to the next step in main
158+
- [ ] Ensure the example still runs and has the same output!
159+
160+
For example:
161+
```python
162+
163+
def setup_client():
164+
"""Initialize and set up the client with operator account."""
165+
166+
def create_test_account(client, operator_key):
167+
"""Create a new test account for demonstration."""
168+
169+
def create_fungible_token(client, operator_id, operator_key):
170+
"""Create a fungible token for association with test account."""
171+
172+
def associate_token_with_account(client, token_id, account_id, account_key):
173+
"""Associate the token with the test account."""
174+
175+
def main():
176+
client, operator_id, operator_key = setup_client()
177+
account_id, account_private_key = create_test_account(client, operator_key)
178+
token_id = create_fungible_token(client, operator_id, operator_key)
179+
associate_token_with_account(client, token_id, account_id, account_private_key)
180+
```
181+
182+
- type: textarea
183+
id: contribution_steps
184+
attributes:
185+
label: 📋 Step-by-Step Contribution Guide
186+
description: Provide a contribution workflow suitable for new contributors
187+
value: |
188+
If you have never contributed to an open source project at GitHub, the following step-by-step guide will introduce you to the workflow.
189+
190+
- [ ] **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.
191+
- [ ] **Wait for assignment:** A community member with the given rights will add you as an assignee of the issue
192+
- [ ] **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).
193+
- [ ] **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)
194+
- [ ] **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.
195+
- [ ] **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).
196+
- [ ] **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 ❤️
197+
198+
***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.
199+
validations:
200+
required: true
201+
202+
- type: textarea
203+
id: information
204+
attributes:
205+
label: 🤔 Additional Information
206+
description: Provide any extra resources or context for contributors to solve this good first issue
207+
value: |
208+
For more help, we have extensive documentation attributes:
209+
- [SDK Developer Docs](https://github.com/hiero-ledger/hiero-sdk-python/tree/main/docs/sdk_developers)
210+
- [SDK Developer Training](https://github.com/hiero-ledger/hiero-sdk-python/tree/main/docs/sdk_developers/training)
211+
212+
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.
213+
214+
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.
215+
216+
You can also ask for help in a comment below!

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
blank_issues_enabled: true
2+
3+
# Only show specific issue templates
4+
# issue_templates:
5+
# - name: Good First Issue
6+
# filename: 01-good_first_issue.yml
7+
8+
# Test contact links
9+
contact_links:
10+
- name: Hiero Discord
11+
url: https://github.com/hiero-ledger/hiero-sdk-python/blob/main/docs/discord.md
12+
about: Please ask and answer questions here.

0 commit comments

Comments
 (0)