Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/alstr.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"languages": [
{
"language": "PHP",
"markers": [
{
"type": "line",
"pattern": "//"
}
]
}
],
"identifiers": [
{
"name": "TODO",
"labels": ["todo"]
},
{
"name": "WIP",
"labels": ["wip"]
}
]
}
7 changes: 7 additions & 0 deletions .github/issues.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[
{
"title": "Test",
"body": "Testing auto issue creation",
"labels": ["documentation"]
}
]
33 changes: 33 additions & 0 deletions .github/workflows/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -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
43 changes: 43 additions & 0 deletions .github/workflows/ISSUE_TEMPLATE/chore_report.yml
Original file line number Diff line number Diff line change
@@ -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
47 changes: 47 additions & 0 deletions .github/workflows/ISSUE_TEMPLATE/docs_report.yml
Original file line number Diff line number Diff line change
@@ -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
46 changes: 46 additions & 0 deletions .github/workflows/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -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
46 changes: 46 additions & 0 deletions .github/workflows/ISSUE_TEMPLATE/refactor_request.yml
Original file line number Diff line number Diff line change
@@ -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
49 changes: 49 additions & 0 deletions .github/workflows/ISSUE_TEMPLATE/test_report.yml
Original file line number Diff line number Diff line change
@@ -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
10 changes: 10 additions & 0 deletions .github/workflows/auto-code-todo-to-issue.yml
Original file line number Diff line number Diff line change
@@ -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 }}
26 changes: 26 additions & 0 deletions .github/workflows/auto-issue.yml
Original file line number Diff line number Diff line change
@@ -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
});
}
5 changes: 4 additions & 1 deletion src/Application/UseCase/Dice/RollDice/RollDiceUseCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Loading