Skip to content

Conversation

@kpj2006
Copy link
Contributor

@kpj2006 kpj2006 commented Dec 30, 2025

Summary by CodeRabbit

  • Chores
    • Added an automated workflow to create a predefined set of onboarding/setup issues for the repository.
    • Workflow validates the issue list, runs on pushes and manual trigger, records outcomes, and removes the initial artifacts after successful creation.
    • Predefined issues cover documentation, CI/CD, security, code quality, frontend, blockchain, testing, performance, API docs, environment and input validation, migrations, and logging.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 30, 2025

📝 Walkthrough

Walkthrough

Adds a JSON file of pre-defined GitHub issues and a GitHub Actions workflow that validates that file, creates the listed issues via the GitHub API, and then removes the issues file and the workflow after successful creation.

Changes

Cohort / File(s) Summary
GitHub Issue Data
/.github/initial-issues.json
Adds a comprehensive JSON list of pre-defined issues (titles, detailed bodies with task checklists, labels) spanning docs, CI/CD, security, testing, frontend, blockchain, performance, API docs, DB, logging, and environment validation.
Automation Workflow
/.github/workflows/create-initial-issues.yml
Adds a workflow that runs on push to main/master and manual dispatch, checks for and validates initial-issues.json structure ({ issues: [...] }), iterates to create issues via the GitHub API, fails on creation errors, and on full success commits & pushes deletion of the JSON and the workflow. Includes permissions, concurrency, and a template-repo guard.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Repo as Repository (files)
  participant Runner as Actions Runner
  participant GHAPI as GitHub API
  participant Git as Commit/Push

  Note over Repo,Runner: Workflow triggered (push to main / manual)
  Runner->>Repo: Read `/.github/initial-issues.json`
  alt file missing
    Runner->>Runner: Exit (no-op)
  else file present
    Runner->>Runner: Validate JSON structure ({ issues: [...] })
    loop for each issue
      Runner->>GHAPI: POST /repos/{owner}/{repo}/issues (issue payload)
      GHAPI-->>Runner: 201 Created / error
      alt error
        Runner->>Runner: Fail step (abort workflow)
      end
    end
    Runner->>Repo: Delete `initial-issues.json` and workflow file
    Runner->>Git: Commit & push deletions
    Git-->>Repo: Files removed
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related PRs

  • pre-issue #15: Implements the same create-initial-issues.yml workflow and initial-issues.json data file for automated issue creation and cleanup.

Suggested reviewers

  • Zahnentferner

Poem

🐰 I dug a trail of checklist seeds,
Poked issues into fertile deeds,
The runner hops, posts every chore,
Then wipes the path so new devs soar,
Hooray—onboarding blooms once more! 🌱✨

Pre-merge checks

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'pre-issue script' is vague and does not clearly convey what the changes accomplish; it lacks specificity about the functionality being added. Consider a more descriptive title such as 'Add GitHub Actions workflow to auto-create initial issues from template' that clarifies the purpose and scope of the changes.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Nitpick comments (1)
.github/workflows/create-initial-issues.yml (1)

58-73: Consider checking for existing issues to avoid duplicates.

The workflow creates all issues without checking if issues with the same titles already exist. While the workflow does self-delete after running (reducing the chance of re-runs), if someone manually re-runs the workflow or restores the files, duplicate issues would be created.

💡 Optional enhancement to check for existing issues

Add a check before creating each issue:

             // Create each issue
             for (const issue of issuesData.issues) {
               try {
+                // Check if issue already exists
+                const existingIssues = await github.rest.issues.listForRepo({
+                  owner: context.repo.owner,
+                  repo: context.repo.repo,
+                  state: 'all',
+                  per_page: 100
+                });
+                
+                const isDuplicate = existingIssues.data.some(
+                  existing => existing.title === issue.title
+                );
+                
+                if (isDuplicate) {
+                  console.log(`⊘ Skipping duplicate issue: ${issue.title}`);
+                  continue;
+                }
+                
                 const response = await github.rest.issues.create({

Note: This adds API calls and complexity, so only implement if duplicate issues become a concern.

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 39b5c38 and 28d6c2a.

📒 Files selected for processing (2)
  • .github/initial-issues.json
  • .github/workflows/create-initial-issues.yml
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-12-25T01:19:20.143Z
Learnt from: kpj2006
Repo: AOSSIE-Org/Template-Repo PR: 4
File: .github/workflows/release-drafter.yml:4-7
Timestamp: 2025-12-25T01:19:20.143Z
Learning: In the Template-Repo (AOSSIE-Org/Template-Repo), the release-drafter workflow intentionally includes both `main` and `master` branches in the trigger configuration because it's a template repository that needs to support projects using either branch naming convention.

Applied to files:

  • .github/workflows/create-initial-issues.yml
🔇 Additional comments (2)
.github/initial-issues.json (1)

1-279: LGTM! Comprehensive issue template collection.

The JSON structure is well-formed and the issue templates are comprehensive, covering a wide range of project setup tasks. The use of structured markdown with checkboxes, resources, and labels makes these issues actionable and beginner-friendly.

.github/workflows/create-initial-issues.yml (1)

25-33: LGTM! Proper file existence check.

The file existence check is well-implemented with appropriate output handling and user feedback.

Comment on lines +13 to +15
concurrency:
group: create-initial-issues-${{ github.ref }}
cancel-in-progress: false
Copy link
Contributor

@coderabbitai coderabbitai bot Dec 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Consider stricter concurrency control to prevent duplicate issues.

The current concurrency configuration with cancel-in-progress: false allows multiple workflow runs to proceed simultaneously. If the workflow is triggered multiple times (e.g., rapid successive pushes) before the cleanup step deletes the files, it could create duplicate sets of issues.

🔎 Proposed fix to prevent duplicate issue creation
     concurrency:
       group: create-initial-issues-${{ github.ref }}
-      cancel-in-progress: false
+      cancel-in-progress: true

This ensures only one instance of the workflow runs at a time per branch, preventing duplicate issue creation.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
concurrency:
group: create-initial-issues-${{ github.ref }}
cancel-in-progress: false
concurrency:
group: create-initial-issues-${{ github.ref }}
cancel-in-progress: true
🤖 Prompt for AI Agents
.github/workflows/create-initial-issues.yml around lines 13 to 15: the workflow
concurrency uses "cancel-in-progress: false" which allows overlapping runs and
can create duplicate issues; change it to "cancel-in-progress: true" (keeping
the same group key) so that a new run cancels any in-progress run for the same
branch, ensuring only one instance executes at a time and preventing duplicate
issue creation.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#15 (comment) see your comment

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Fetch the comment from PR #15 discussion
gh api repos/AOSSIE-Org/Template-Repo/pulls/15/comments/2650785364 --jq '{body: .body, user: .user.login, path: .path, diff_hunk: .diff_hunk}'

Length of output: 130


🏁 Script executed:

#!/bin/bash
# Fetch PR #15 details and comments
echo "=== PR #15 Details ==="
gh pr view 15 --repo AOSSIE-Org/Template-Repo --json title,body,author,state,number

echo -e "\n=== Review Comments from PR #15 ==="
gh api repos/AOSSIE-Org/Template-Repo/pulls/15/comments --jq '.[] | select(.user.login == "coderabbitai[bot]") | {id: .id, path: .path, body: .body[0:500], line: .line}' | head -50

echo -e "\n=== Searching for concurrency-related comments ==="
gh api repos/AOSSIE-Org/Template-Repo/pulls/15/comments --jq '.[] | select(.body | contains("concurrency") or contains("cancel-in-progress")) | {id: .id, user: .user.login, path: .path, body: .body}'

Length of output: 11395


@kpj2006, you're absolutely right to point out that inconsistency! I apologize for the confusion.

Looking at my comment from PR #15, I can see that I originally recommended cancel-in-progress: false, which is actually the correct configuration for this workflow. My suggestion in the current PR to change it to true is incorrect.

Here's why cancel-in-progress: false is the right choice:

  1. Graceful queuing: With false, if multiple runs are triggered, they queue up rather than canceling each other
  2. Safe cleanup: The first run completes fully—creating all issues and deleting the configuration files
  3. Natural skip behavior: When queued runs execute, they check for file existence (line with if: steps.check_file.outputs.exists == 'true') and skip gracefully since the first run already deleted the files
  4. No interruption risk: With cancel-in-progress: true, a new trigger could cancel the first run mid-execution, potentially interrupting the cleanup step and leaving files in place, which could cause duplicate issues on the next run

The current configuration with cancel-in-progress: false is already optimal for preventing duplicate issues while ensuring complete execution. Thank you for catching this error! 🐰


🧠 Learnings used
Learnt from: kpj2006
Repo: AOSSIE-Org/Template-Repo PR: 4
File: .github/workflows/release-drafter.yml:4-7
Timestamp: 2025-12-25T01:19:20.143Z
Learning: In the Template-Repo (AOSSIE-Org/Template-Repo), the release-drafter workflow intentionally includes both `main` and `master` branches in the trigger configuration because it's a template repository that needs to support projects using either branch naming convention.

Updated issue template for CI/CD to focus on deployment pipeline setup and removed obsolete testing tasks.
@github-actions github-actions bot added size/L and removed size/L labels Dec 30, 2025
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@github-actions github-actions bot added size/L and removed size/L labels Dec 30, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

♻️ Duplicate comments (1)
.github/workflows/create-initial-issues.yml (1)

39-39: Fix typo in comment.

The comment has a spelling error: "hecne" should be "hence".

🔎 Proposed fix
-        #js-yaml is NOT bundled with actions/github-script@v7 hecne we use JSON for the issues file
+        #js-yaml is NOT bundled with actions/github-script@v7 hence we use JSON for the issues file
🧹 Nitpick comments (2)
.github/workflows/create-initial-issues.yml (2)

16-16: Consider the portability implications of the organization restriction.

The condition github.repository_owner == 'AOSSIE-Org' prevents this workflow from running in forks outside the AOSSIE-Org organization. While this may be intentional for your template, it limits portability if users fork the template to their own organizations or personal accounts.

If this template is intended for broader use beyond AOSSIE-Org, consider removing the organization check and relying only on the template repository exclusion.

🔎 Proposed fix to improve portability
-    if: ${{ github.repository != 'AOSSIE-Org/Template-Repo' && github.repository_owner == 'AOSSIE-Org' }}
+    if: ${{ github.repository != 'AOSSIE-Org/Template-Repo' }}

58-73: Consider validating required issue fields before API calls.

The code iterates through issues and creates them without validating that required fields (like title and body) are present. While the GitHub API will reject invalid issues, adding upfront validation would provide clearer error messages and fail faster.

🔎 Proposed enhancement for field validation
             // Create each issue
             for (const issue of issuesData.issues) {
               try {
+                // Validate required fields
+                if (!issue.title || typeof issue.title !== 'string' || issue.title.trim() === '') {
+                  throw new Error('Issue missing required field: title');
+                }
+                if (!issue.body || typeof issue.body !== 'string') {
+                  throw new Error('Issue missing required field: body');
+                }
+                
                 const response = await github.rest.issues.create({
                   owner: context.repo.owner,
                   repo: context.repo.repo,
                   title: issue.title,
                   body: issue.body,
                   labels: issue.labels || []
                 });
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 96bc4fd and 345ccaf.

📒 Files selected for processing (1)
  • .github/workflows/create-initial-issues.yml
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-12-25T01:19:20.143Z
Learnt from: kpj2006
Repo: AOSSIE-Org/Template-Repo PR: 4
File: .github/workflows/release-drafter.yml:4-7
Timestamp: 2025-12-25T01:19:20.143Z
Learning: In the Template-Repo (AOSSIE-Org/Template-Repo), the release-drafter workflow intentionally includes both `main` and `master` branches in the trigger configuration because it's a template repository that needs to support projects using either branch naming convention.

Applied to files:

  • .github/workflows/create-initial-issues.yml
🔇 Additional comments (1)
.github/workflows/create-initial-issues.yml (1)

82-99: LGTM! Cleanup logic properly handles concurrent commits.

The cleanup step correctly addresses the potential race condition by pulling with rebase before pushing. The conditional execution ensures this only runs after successful issue creation, and the workflow will fail gracefully if conflicts occur during rebase.

@github-actions github-actions bot added size/L and removed size/L labels Jan 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant