Skip to content

Commit 94152d4

Browse files
committed
build: update issue template
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: passed - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- type: pre_push_report description: Results of running various checks prior to pushing changes. report: - task: run_javascript_examples status: na - task: run_c_examples status: na - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: na - task: run_c_benchmarks status: na - task: run_cpp_benchmarks status: na - task: run_fortran_benchmarks status: na - task: run_javascript_benchmarks status: na - task: run_julia_benchmarks status: na - task: run_python_benchmarks status: na - task: run_r_benchmarks status: na - task: run_javascript_tests status: na ---
1 parent f9561f9 commit 94152d4

File tree

1 file changed

+57
-21
lines changed

1 file changed

+57
-21
lines changed

.github/workflows/scripts/create_address_commit_comments_issues

Lines changed: 57 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -235,24 +235,29 @@ is_core_contributor() {
235235
# Updates two indexed arrays (commit_keys and commit_counts) to simulate a map.
236236
#
237237
# $1 - Commit SHA (the key)
238+
# $2 - Comment URL (the link)
238239
update_commit_map() {
239-
local key="$1"
240-
local found=0
241-
local i=0
242-
243-
for existing in "${commit_keys[@]}"; do
244-
if [ "$existing" = "$key" ]; then
245-
commit_counts[i]=$(( commit_counts[i] + 1 ))
246-
found=1
247-
break
248-
fi
249-
i=$(( i + 1 ))
250-
done
251-
252-
if [ "$found" -eq 0 ]; then
253-
commit_keys+=("$key")
254-
commit_counts+=("1")
255-
fi
240+
local key="$1"
241+
local link="$2"
242+
local found=0
243+
local i=0
244+
245+
for existing in "${commit_keys[@]}"; do
246+
if [ "$existing" = "$key" ]; then
247+
commit_counts[i]=$(( commit_counts[i] + 1 ))
248+
# Append the comment URL (on a new bullet) to the existing list:
249+
commit_links[i]="${commit_links[i]}"$'\n'"- ${link}"
250+
found=1
251+
break
252+
fi
253+
i=$(( i + 1 ))
254+
done
255+
256+
if [ "$found" -eq 0 ]; then
257+
commit_keys+=("$key")
258+
commit_counts+=("1")
259+
commit_links+=("- ${link}")
260+
fi
256261
}
257262

258263
# Main execution sequence.
@@ -333,9 +338,9 @@ main() {
333338
# Process comments to create one GitHub issue per commit tagging @stdlib-bot:
334339
echo "Processing commit comments for tasks tagging @stdlib-bot..." >&2
335340

336-
# Instead of an associative array, use two indexed arrays:
337341
commit_keys=()
338342
commit_counts=()
343+
commit_links=()
339344

340345
for comment in "${all_comments[@]}"; do
341346
# Extract the comment body:
@@ -353,7 +358,10 @@ main() {
353358
local commit_sha
354359
commit_sha=$(echo "$comment" | jq -r '.commit_id')
355360
if [ -n "$commit_sha" ]; then
356-
update_commit_map "$commit_sha"
361+
# Extract the comment URL:
362+
local comment_url
363+
comment_url=$(echo "$comment" | jq -r '.html_url')
364+
update_commit_map "$commit_sha" "$comment_url"
357365
fi
358366
else
359367
echo "Skipping comment by non-core contributor: ${comment_author}" >&2
@@ -366,16 +374,44 @@ main() {
366374
for idx in $(seq 0 $(( ${#commit_keys[@]} - 1 ))); do
367375
local commit_sha="${commit_keys[$idx]}"
368376
local count="${commit_counts[$idx]}"
377+
local links="${commit_links[$idx]}"
369378

370379
# Generate a short SHA (first 7 characters):
371380
local short_sha=${commit_sha:0:7}
372381
local issue_title="Address commit comments (commit ${short_sha})"
373382
local commit_link="https://github.com/${owner}/${repo}/commit/${commit_sha}"
374-
local issue_body="This issue was created automatically to address commit comments tagging @stdlib-bot.
383+
local issue_body="This commit has **${count}** comment(s) from core contributors that require attention.
375384
376385
**Commit:** [${commit_sha}](${commit_link})
377386
378-
This commit has **${count}** comment(s) from core contributors that require attention."
387+
**Comments:**
388+
${links}
389+
390+
Interested in helping improve the project? If you are, the comment linked to above has **${count}** comment(s) from core contributors that could use your attention.
391+
392+
What do you need to do?
393+
394+
1. Open the link to the commit above.
395+
2. Find all the comments which mention @stdlib-bot. These comments should describe follow-up tasks or desired changes, such as formatting improvements, small refactorings, or clean-up.
396+
3. If you are a first-time contributor, follow the [contributing](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md) and [development](https://github.com/stdlib-js/stdlib/blob/develop/docs/development.md) guides to setup your local environment for contributing to stdlib. If you are already a seasoned stdlib contributor, create a new branch on your local fork for making the changes.
397+
4. Make all the desired changes and commit those changes to a local branch.
398+
5. Push the changes to GitHub and open a new pull request against the \`develop\` branch of the main stdlib development [repository](https://github.com/stdlib-js/stdlib).
399+
400+
Once you've opened a pull request, a stdlib maintainer will review your work and suggest any follow-up changes.
401+
402+
And that's it!
403+
404+
Thank you for your help in reducing the project backlog and in improving the quality of stdlib. 🙌
405+
406+
* * *
407+
408+
## Notes
409+
410+
- For older commits, there is a chance that comments will have been already been addressed due to other refactorings. If you find that to be true, don't worry! Just move on to addressing the next comment, and, when opening your pull request and describing your proposed changes, be sure to link to the comment and mention that it has been addressed. This will help reviewers when reviewing your code!
411+
412+
* * *
413+
414+
This issue was created automatically to address commit comments tagging @stdlib-bot."
379415

380416
# Check if an issue for this commit already exists:
381417
if issue_exists_for_commit "$commit_sha"; then

0 commit comments

Comments
 (0)