Skip to content

Commit b37de4b

Browse files
authored
Merge branch 'main' into hbar-s-clean
Signed-off-by: prajeeta <96904203+prajeeta15@users.noreply.github.com>
2 parents f59c2c3 + 11f22f5 commit b37de4b

29 files changed

+2419
-81
lines changed
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: Bug report
2+
description: Create a report to help us improve
3+
labels: [ bug ]
4+
type: Bug
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: |
9+
## Thanks for submitting a bug report!
10+
11+
Before submitting:
12+
1. Try searching the existing issues and discussions to see if your issue has already been reported
13+
2. Try asking on [Discord's hiero-general channel](discord.hiero.org)
14+
3. If you're reporting a security vulnerability, please disclose responsibly via our [bug bounty program](https://hedera.com/bounty)
15+
- type: textarea
16+
id: description
17+
attributes:
18+
label: Description
19+
description: What happened and what you did you expect to happen?
20+
validations:
21+
required: true
22+
- type: textarea
23+
id: steps
24+
attributes:
25+
label: Steps to reproduce
26+
description: Steps to reproduce the behavior
27+
placeholder: |
28+
1. Run the program
29+
2. Click on '...'
30+
3. Scroll down to '...'
31+
validations:
32+
required: true
33+
- type: textarea
34+
id: context
35+
attributes:
36+
label: Additional context
37+
description: Attach any logs or screenshots relevent to the problem.
38+
placeholder: |
39+
![Screenshot](bug.png)
40+
41+
```bash
42+
2021-06-29T13:50:45.008-0600 INFO thread-1 Some logs
43+
```
44+
- type: dropdown
45+
id: network
46+
attributes:
47+
description: Which network(s) did the issue occur on?
48+
label: Hedera network
49+
multiple: true
50+
options:
51+
- mainnet
52+
- testnet
53+
- previewnet
54+
- other
55+
- type: input
56+
id: version
57+
attributes:
58+
description: What version of the software are you using?
59+
label: Version
60+
placeholder: v0.1.0
61+
validations:
62+
required: true
63+
- type: dropdown
64+
id: os
65+
attributes:
66+
description: Which OS did the issue occur on?
67+
label: Operating system
68+
options:
69+
- Linux
70+
- macOS
71+
- Windows
72+
- Other
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Feature
2+
description: Suggest an idea for this project
3+
labels: [ enhancement ]
4+
type: Feature
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: |
9+
## Thanks for submitting a feature request!
10+
11+
Before submitting:
12+
* Try searching the existing issues and discussions to see if something similar has been discussed previously
13+
* Try opening a GitHub discussion first to gather feedback and reach consensus
14+
* If this is a major enhancement, please open a [Hiero Improvement Proposal](https://github.com/hiero-ledger/hiero-improvement-proposals)
15+
- type: textarea
16+
id: problem
17+
attributes:
18+
label: Problem
19+
description: What is the problem you are trying to solve?
20+
placeholder: I'm always frustrated when ...
21+
validations:
22+
required: true
23+
- type: textarea
24+
id: solution
25+
attributes:
26+
label: Solution
27+
description: What solution do you propose to solve the problem?
28+
placeholder: |
29+
- Add a config property
30+
- Change the schema
31+
- ...
32+
validations:
33+
required: true
34+
- type: textarea
35+
id: alternatives
36+
attributes:
37+
label: Alternatives
38+
description: What alternative solutions have you considered?

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ blank_issues_enabled: true
44
# issue_templates:
55
# - name: Good First Issue
66
# filename: 01-good_first_issue.yml
7+
#- name: Bug Report
8+
# filename: 02_bug_report.yml
9+
10+
# - name: Feature Request
11+
# filename: 03_feature_request.yml
712

813
# Test contact links
914
contact_links:
Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
# DRY-RUN: Phase 2 Inactivity Unassign Bot
5+
# - Does NOT change anything
6+
# - Logs which PRs/issues WOULD be affected
7+
8+
REPO="${REPO:-}"
9+
DAYS="${DAYS:-21}"
10+
11+
if [ -z "$REPO" ]; then
12+
echo "ERROR: REPO environment variable not set."
13+
echo "Example: export REPO=owner/repo"
14+
exit 1
15+
fi
16+
17+
echo "------------------------------------------------------------"
18+
echo " DRY RUN: Phase 2 Inactivity Unassign (PR inactivity)"
19+
echo " Repo: $REPO"
20+
echo " Threshold: $DAYS days (no commit activity on PR)"
21+
echo "------------------------------------------------------------"
22+
23+
NOW_TS=$(date +%s)
24+
25+
parse_ts() {
26+
local ts="$1"
27+
if date --version >/dev/null 2>&1; then
28+
date -d "$ts" +%s
29+
else
30+
date -j -f "%Y-%m-%dT%H:%M:%SZ" "$ts" +"%s"
31+
fi
32+
}
33+
34+
declare -a SUMMARY=()
35+
36+
ISSUES=$(gh api "repos/$REPO/issues" \
37+
--paginate \
38+
--jq '.[] | select(.state=="open" and (.assignees | length > 0) and (.pull_request | not)) | .number')
39+
40+
if [ -z "$ISSUES" ]; then
41+
echo "No open issues with assignees found."
42+
exit 0
43+
fi
44+
45+
echo "[INFO] Found issues: $ISSUES"
46+
echo
47+
48+
for ISSUE in $ISSUES; do
49+
echo "============================================================"
50+
echo " ISSUE #$ISSUE"
51+
echo "============================================================"
52+
53+
ISSUE_JSON=$(gh api "repos/$REPO/issues/$ISSUE")
54+
ASSIGNEES=$(echo "$ISSUE_JSON" | jq -r '.assignees[].login')
55+
56+
if [ -z "$ASSIGNEES" ]; then
57+
echo "[INFO] No assignees? Skipping."
58+
echo
59+
continue
60+
fi
61+
62+
echo "[INFO] Assignees: $ASSIGNEES"
63+
echo
64+
65+
for USER in $ASSIGNEES; do
66+
echo " → Checking assignee: $USER"
67+
68+
PR_NUMBERS=$(gh api \
69+
-H "Accept: application/vnd.github.mockingbird-preview+json" \
70+
"repos/$REPO/issues/$ISSUE/timeline" \
71+
--jq ".[]
72+
| select(.event == \"cross-referenced\")
73+
| select(.source.issue.pull_request != null)
74+
| select(.source.issue.user.login == \"$USER\")
75+
| .source.issue.number")
76+
77+
if [ -z "$PR_NUMBERS" ]; then
78+
echo " [INFO] No linked PRs by $USER for this issue."
79+
echo
80+
continue
81+
fi
82+
83+
echo " [INFO] Linked PRs by $USER: $PR_NUMBERS"
84+
85+
STALE_PR=""
86+
STALE_AGE_DAYS=0
87+
88+
for PR_NUM in $PR_NUMBERS; do
89+
PR_STATE=$(gh pr view "$PR_NUM" --repo "$REPO" --json state --jq '.state')
90+
91+
if [ "$PR_STATE" != "OPEN" ]; then
92+
echo " [SKIP] PR #$PR_NUM is not open ($PR_STATE)."
93+
continue
94+
fi
95+
96+
# Use the same "last commit" logic as the real bot (with pagination)
97+
COMMITS_JSON=$(gh api "repos/$REPO/pulls/$PR_NUM/commits" --paginate 2>/dev/null || echo "")
98+
99+
LAST_COMMIT_DATE=$(echo "$COMMITS_JSON" \
100+
| jq -r 'last | (.commit.committer.date // .commit.author.date)' 2>/dev/null || echo "")
101+
102+
if [ -z "$LAST_COMMIT_DATE" ] || [ "$LAST_COMMIT_DATE" = "null" ]; then
103+
echo " [WARN] Could not determine last commit date for PR #$PR_NUM, skipping."
104+
continue
105+
fi
106+
107+
LAST_COMMIT_TS=$(parse_ts "$LAST_COMMIT_DATE")
108+
AGE_DAYS=$(( (NOW_TS - LAST_COMMIT_TS) / 86400 ))
109+
110+
echo " [INFO] PR #$PR_NUM last commit: $LAST_COMMIT_DATE (~${AGE_DAYS} days ago)"
111+
112+
if [ "$AGE_DAYS" -ge "$DAYS" ]; then
113+
STALE_PR="$PR_NUM"
114+
STALE_AGE_DAYS="$AGE_DAYS"
115+
break
116+
fi
117+
done
118+
119+
if [ -z "$STALE_PR" ]; then
120+
echo " [KEEP] No OPEN PR for $USER is stale (>= $DAYS days)."
121+
echo
122+
continue
123+
fi
124+
125+
echo " [DRY RUN] Would CLOSE PR #$STALE_PR (no commits for $STALE_AGE_DAYS days)"
126+
echo " [DRY RUN] Would UNASSIGN @$USER from issue #$ISSUE"
127+
echo
128+
129+
SUMMARY+=("Issue #$ISSUE → user @$USER → stale PR #$STALE_PR (no commits for $STALE_AGE_DAYS days)")
130+
done
131+
132+
echo
133+
done
134+
135+
if [ ${#SUMMARY[@]} -gt 0 ]; then
136+
echo "============================================================"
137+
echo " SUMMARY: Actions that WOULD be taken (no changes made)"
138+
echo "============================================================"
139+
for ITEM in "${SUMMARY[@]}"; do
140+
echo " - $ITEM"
141+
done
142+
else
143+
echo "No stale PRs / unassignments detected in this dry-run."
144+
fi
145+
146+
echo "------------------------------------------------------------"
147+
echo " DRY RUN COMPLETE — No changes were made."
148+
echo "------------------------------------------------------------"

0 commit comments

Comments
 (0)