From 70d7b9795e2719aff1f3e6ebd0debc95f80f21d9 Mon Sep 17 00:00:00 2001 From: valb-mig Date: Wed, 4 Mar 2026 12:02:00 -0300 Subject: [PATCH 1/2] (feat): add GitHub issue templates and ALSTR configuration + Auto issues --- .github/alstr.json | 23 +++++++++ .github/issues.json | 7 +++ .../workflows/ISSUE_TEMPLATE/bug_report.yml | 33 +++++++++++++ .../workflows/ISSUE_TEMPLATE/chore_report.yml | 43 ++++++++++++++++ .../workflows/ISSUE_TEMPLATE/docs_report.yml | 47 ++++++++++++++++++ .../ISSUE_TEMPLATE/feature_request.yml | 46 +++++++++++++++++ .../ISSUE_TEMPLATE/refactor_request.yml | 46 +++++++++++++++++ .../workflows/ISSUE_TEMPLATE/test_report.yml | 49 +++++++++++++++++++ .github/workflows/auto-code-todo-to-issue.yml | 10 ++++ .github/workflows/auto-issue.yml | 26 ++++++++++ 10 files changed, 330 insertions(+) create mode 100644 .github/alstr.json create mode 100644 .github/issues.json create mode 100644 .github/workflows/ISSUE_TEMPLATE/bug_report.yml create mode 100644 .github/workflows/ISSUE_TEMPLATE/chore_report.yml create mode 100644 .github/workflows/ISSUE_TEMPLATE/docs_report.yml create mode 100644 .github/workflows/ISSUE_TEMPLATE/feature_request.yml create mode 100644 .github/workflows/ISSUE_TEMPLATE/refactor_request.yml create mode 100644 .github/workflows/ISSUE_TEMPLATE/test_report.yml create mode 100644 .github/workflows/auto-code-todo-to-issue.yml create mode 100644 .github/workflows/auto-issue.yml diff --git a/.github/alstr.json b/.github/alstr.json new file mode 100644 index 0000000..b3f5fbe --- /dev/null +++ b/.github/alstr.json @@ -0,0 +1,23 @@ +{ + "languages": [ + { + "language": "PHP", + "markers": [ + { + "type": "line", + "pattern": "//" + } + ] + } + ], + "identifiers": [ + { + "name": "TODO", + "labels": ["todo"] + }, + { + "name": "WIP", + "labels": ["wip"] + } + ] +} \ No newline at end of file diff --git a/.github/issues.json b/.github/issues.json new file mode 100644 index 0000000..9bc53e3 --- /dev/null +++ b/.github/issues.json @@ -0,0 +1,7 @@ +[ + { + "title": "Test", + "body": "Testing auto issue creation", + "labels": ["documentation"] + } +] \ No newline at end of file diff --git a/.github/workflows/ISSUE_TEMPLATE/bug_report.yml b/.github/workflows/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 0000000..baaf2bb --- /dev/null +++ b/.github/workflows/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,33 @@ +name: "(bug): Bug Report" +description: Report a bug in the project +labels: ["bug"] +assignees: ["valb-mig"] + +body: + - type: input + id: description + attributes: + label: What's the bug? + placeholder: "Describe the bug in detail..." + validations: + required: true + + - type: textarea + id: reproducao + attributes: + label: How to reproduce? + description: Step-by-step instructions to reach the bug + value: | + 1. Go to... + 2. Click on... + 3. See the error + + - type: dropdown + id: severidade + attributes: + label: Severity + options: + - Critical + - High + - Medium + - Low \ No newline at end of file diff --git a/.github/workflows/ISSUE_TEMPLATE/chore_report.yml b/.github/workflows/ISSUE_TEMPLATE/chore_report.yml new file mode 100644 index 0000000..259e7a6 --- /dev/null +++ b/.github/workflows/ISSUE_TEMPLATE/chore_report.yml @@ -0,0 +1,43 @@ +name: "(chore): Chore / Maintenance" +description: Dependency updates, config changes, tooling, CI +labels: ["chore"] +assignees: [] + +body: + - type: input + id: title + attributes: + label: What needs to be done? + placeholder: "Ex: update PHPUnit to v11" + validations: + required: true + + - type: textarea + id: reason + attributes: + label: Why is this needed? + placeholder: Security patch, deprecation, outdated tooling... + validations: + required: true + + - type: dropdown + id: type + attributes: + label: Type of chore + options: + - Dependency update + - CI/CD change + - Config / tooling + - Documentation + - Other + validations: + required: true + + - type: checkboxes + id: checklist + attributes: + label: Checklist + options: + - label: No production behavior is changed + required: true + - label: CI passes after the change \ No newline at end of file diff --git a/.github/workflows/ISSUE_TEMPLATE/docs_report.yml b/.github/workflows/ISSUE_TEMPLATE/docs_report.yml new file mode 100644 index 0000000..616956f --- /dev/null +++ b/.github/workflows/ISSUE_TEMPLATE/docs_report.yml @@ -0,0 +1,47 @@ +name: "(docs): Documentation" +description: Missing, incorrect or outdated documentation +labels: ["documentation"] +assignees: [] + +body: + - type: input + id: location + attributes: + label: Where is the documentation issue? + placeholder: "Ex: README, wiki, inline PHPDoc on src/Player.php" + validations: + required: true + + - type: dropdown + id: type + attributes: + label: Type of issue + options: + - Missing documentation + - Incorrect documentation + - Outdated documentation + - Needs better examples + validations: + required: true + + - type: textarea + id: description + attributes: + label: Describe the problem + placeholder: What is wrong or missing? + validations: + required: true + + - type: textarea + id: suggestion + attributes: + label: Suggested correction + placeholder: What should it say instead? + + - type: checkboxes + id: checklist + attributes: + label: Checklist + options: + - label: I checked the existing docs before opening this + required: true \ No newline at end of file diff --git a/.github/workflows/ISSUE_TEMPLATE/feature_request.yml b/.github/workflows/ISSUE_TEMPLATE/feature_request.yml new file mode 100644 index 0000000..a65cbb1 --- /dev/null +++ b/.github/workflows/ISSUE_TEMPLATE/feature_request.yml @@ -0,0 +1,46 @@ +name: "(feat): Feature Request" +description: Suggest a new feature or improvement +labels: ["enhancement"] +assignees: [] + +body: + - type: textarea + id: problem + attributes: + label: Problem this feature solves + placeholder: "Ex: there is no way to filter items by rarity in the inventory" + validations: + required: true + + - type: textarea + id: solution + attributes: + label: Proposed solution + placeholder: Describe what you want to happen + validations: + required: true + + - type: textarea + id: alternatives + attributes: + label: Alternatives considered + placeholder: Any workarounds or other approaches you have thought of? + + - type: dropdown + id: priority + attributes: + label: Priority + options: + - High + - Medium + - Low + + - type: checkboxes + id: checklist + attributes: + label: Checklist + options: + - label: I searched for similar feature requests before opening this one + required: true + - label: This feature aligns with the project scope + required: true \ No newline at end of file diff --git a/.github/workflows/ISSUE_TEMPLATE/refactor_request.yml b/.github/workflows/ISSUE_TEMPLATE/refactor_request.yml new file mode 100644 index 0000000..1dd9bb7 --- /dev/null +++ b/.github/workflows/ISSUE_TEMPLATE/refactor_request.yml @@ -0,0 +1,46 @@ +name: "(refactor): Refactor" +description: Propose a code refactor without changing behavior +labels: ["refactor"] +assignees: [] + +body: + - type: input + id: location + attributes: + label: What needs to be refactored? + placeholder: "Ex: src/Combat/CombatController.php" + validations: + required: true + + - type: textarea + id: reason + attributes: + label: Why does this need refactoring? + placeholder: Describe the current problem (coupling, complexity, duplication...) + validations: + required: true + + - type: textarea + id: proposal + attributes: + label: Proposed approach + placeholder: How should it be restructured? + validations: + required: true + + - type: textarea + id: risks + attributes: + label: Risks and side effects + placeholder: What could break? What needs extra testing? + + - type: checkboxes + id: checklist + attributes: + label: Checklist + options: + - label: Existing tests still pass after this change + required: true + - label: No behavior change is introduced + required: true + - label: New tests are added if needed \ No newline at end of file diff --git a/.github/workflows/ISSUE_TEMPLATE/test_report.yml b/.github/workflows/ISSUE_TEMPLATE/test_report.yml new file mode 100644 index 0000000..9794caf --- /dev/null +++ b/.github/workflows/ISSUE_TEMPLATE/test_report.yml @@ -0,0 +1,49 @@ +name: "(test): Missing or Failing Tests" +description: Report missing test coverage or broken tests +labels: ["test"] +assignees: [] + +body: + - type: input + id: location + attributes: + label: What is not tested or failing? + placeholder: "Ex: src/Inventory/InventoryService.php has no unit tests" + validations: + required: true + + - type: dropdown + id: type + attributes: + label: Type + options: + - Missing test coverage + - Failing test + - Flaky test + - Needs integration test + validations: + required: true + + - type: textarea + id: description + attributes: + label: Describe the gap or failure + placeholder: What scenario is not covered? What is the failing output? + validations: + required: true + + - type: textarea + id: suggestion + attributes: + label: Suggested test cases + placeholder: | + - should return null when inventory is empty + - should throw exception when item does not exist + + - type: checkboxes + id: checklist + attributes: + label: Checklist + options: + - label: I checked the current test suite before opening this + required: true \ No newline at end of file diff --git a/.github/workflows/auto-code-todo-to-issue.yml b/.github/workflows/auto-code-todo-to-issue.yml new file mode 100644 index 0000000..e9093b0 --- /dev/null +++ b/.github/workflows/auto-code-todo-to-issue.yml @@ -0,0 +1,10 @@ +name: TODO to Issue +on: [push] +jobs: + todo: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: alstr/todo-to-issue-action@v5 + with: + TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/auto-issue.yml b/.github/workflows/auto-issue.yml new file mode 100644 index 0000000..9f3c157 --- /dev/null +++ b/.github/workflows/auto-issue.yml @@ -0,0 +1,26 @@ +name: Auto Issue Creator +on: + schedule: + - cron: '0 9 * * 1' + workflow_dispatch: + +jobs: + create-issues: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Create Weekly TODO Issues + uses: actions/github-script@v7 + with: + script: | + const todos = require('.github/issues.json'); + for (const todo of todos) { + await github.rest.issues.create({ + owner: context.repo.owner, + repo: context.repo.repo, + title: todo.title, + body: todo.body, + labels: todo.labels + }); + } \ No newline at end of file From c9fa89c04c359165c0a654b041601058a41e9244 Mon Sep 17 00:00:00 2001 From: valb-mig Date: Wed, 4 Mar 2026 12:06:09 -0300 Subject: [PATCH 2/2] (test): Add GitHub workflow for running tests --- src/Application/UseCase/Dice/RollDice/RollDiceUseCase.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Application/UseCase/Dice/RollDice/RollDiceUseCase.php b/src/Application/UseCase/Dice/RollDice/RollDiceUseCase.php index d7cbc53..c764789 100644 --- a/src/Application/UseCase/Dice/RollDice/RollDiceUseCase.php +++ b/src/Application/UseCase/Dice/RollDice/RollDiceUseCase.php @@ -22,7 +22,10 @@ public function run(RollDiceUseCaseInput $input): Result $rollValue = 0; - // WIP: Enhance performance for large multipliers by processing rolls in chunks and using async tasks + // WIP: Async and enhance performace + // Enhance performance for large multipliers by processing rolls in chunks and using async tasks + // Labels: refactor + // Assignees: valb-mig $awaitables = []; foreach ($this->generateChunks($multiplier, 250_000) as $chunkSize) { $awaitables[] = Async\run(function () use ($chunkSize, $dice): int {