Skip to content

chore: port test-infra fixes, tighten .gitignore, document PHP 8.3+#607

Open
nielsdrost7 wants to merge 1 commit into
InvoicePlane:developfrom
underdogg-forks:chore/test-infra-and-gitignore
Open

chore: port test-infra fixes, tighten .gitignore, document PHP 8.3+#607
nielsdrost7 wants to merge 1 commit into
InvoicePlane:developfrom
underdogg-forks:chore/test-infra-and-gitignore

Conversation

@nielsdrost7

@nielsdrost7 nielsdrost7 commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

Ports the standing fixes that so far lived only on the underdogg-forks develop branch, so feature PRs can be cut from this repo directly without dragging fork-only history along.

What's in here

  1. Test infrastructure — the panel test base classes now seed Spatie roles/permissions in setUp() (without this, every company-panel Livewire test 403s), and AbstractCompanyPanelTestCase::testLivewire() is fixed: it imported Filament\Schemas\Components\Livewire (a schema component) instead of the Livewire test facade and chained withSession() onto the wrong object — it could never have executed. Plus the matching RolesSeeder company-CRUD permissions and Invoices/Quotes test adjustments.
  2. .gitignore — excludes the local tooling that kept leaking into PRs: /automation/, /.claude/fable5/, pint_output.log, audit-report.json. Also drops the Modules/**/Http/Controllers ignores that hid real source files.
  3. README — the resolved dependency tree requires PHP ≥ 8.3 (composer's platform check rejects 8.2), so the badge and Requirements section now say 8.3+.

Known follow-up (deliberately not in this PR)

composer.json still declares "php": "^8.2". Bumping it requires re-resolving the lock, which currently fails: roave/security-advisories (dev-latest) conflicts with the locked guzzlehttp/guzzle < 7.12.1 — the same guzzle version carrying three open advisories (CVE-2026-55767, CVE-2026-55568, CVE-2026-55766 in guzzle/psr7). A follow-up composer update -W guzzlehttp/guzzle fixes the constraint and the advisories together, but that's a dependency bump that deserves its own review.

Verified

Full PHPUnit suite through the Docker CLI image from #601 (sqlite in-memory): green on this branch. These are the exact fixes that took the fork's suite from mass-403s to green.

This PR is the base for the Report Builder (#130), tabular reports (#145), and email-variables (#363) PRs — they are rebased on top of it and their diffs include this commit until it merges.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes

    • Customer administrators now receive permissions for delete actions by default.
    • Invoice and quote workflows now use the correct document numbering types.
  • Documentation

    • Updated the stated minimum PHP requirement to PHP 8.3.
  • Tests

    • Improved authorization and role setup in admin and company panel tests.
    • Updated Livewire test authentication and session handling.

Ports the standing fixes that so far only lived on the fork's develop
branch, so every future PR can be cut from this repo directly:

- Panel test base classes seed Spatie roles/permissions in setUp —
  without this every company-panel Livewire test 403s. Also fixes
  testLivewire(), which imported the Filament schema component instead
  of the Livewire test facade and chained withSession onto the wrong
  object (it could never have run).
- RolesSeeder: restore company CRUD permissions for client_admin.
- Invoices/Quotes feature test adjustments that go with the seeding.

.gitignore now excludes local tooling that kept leaking into pull
requests (/automation/, /.claude/fable5/, pint_output.log,
audit-report.json) and drops the Modules controller ignores that hid
real source files.

README: the resolved dependency tree requires PHP >= 8.3 (composer's
platform check rejects 8.2), so the badge and requirements now say
8.3+. composer.json still declares ^8.2 — bumping it needs a lock
re-resolve that currently fails because roave/security-advisories
conflicts with the locked guzzlehttp/guzzle < 7.12.1; a follow-up
`composer update -W guzzlehttp/guzzle` would fix the constraint and
the three open guzzle advisories together.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The changes expand seeded customer administrator permissions, authorize panel test users, make invoice and quote fixtures use explicit numbering types, update ignored artifacts, and raise the documented PHP requirement to 8.3.

Changes

Authorization test harness

Layer / File(s) Summary
Customer administrator permission generation
Modules/Core/Database/Seeders/RolesSeeder.php
CUSTOMER_ADMIN permissions now include delete-* actions.
Panel test authorization setup
Modules/Core/Tests/AbstractAdminPanelTestCase.php, Modules/Core/Tests/AbstractCompanyPanelTestCase.php
Panel test bases seed roles and permissions, assign the appropriate test role, and update Livewire authentication setup.

Document numbering fixtures

Layer / File(s) Summary
Explicit invoice and quote numbering
Modules/Invoices/Tests/Feature/InvoicesTest.php, Modules/Quotes/Tests/Feature/QuotesTest.php
Invoice document groups use NumberingType::INVOICE, and quote document groups use NumberingType::QUOTE.

Repository metadata and requirements

Layer / File(s) Summary
Ignore rules and PHP requirement
.gitignore, README.md
Ignore rules are updated for additional artifacts, and the documented PHP minimum changes to 8.3.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested reviewers: khawarmehfooz

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main changes: test-infra fixes, .gitignore updates, and the PHP 8.3 documentation bump.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@README.md`:
- Line 47: Align the PHP version requirement in README.md with the Composer
constraint at composer.json:20: either change the Composer requirement to ^8.3
if supported, or revert the README requirement to PHP 8.2 until that dependency
change is made.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 34be9d6b-e3c1-43b9-a23e-79d4f6970be3

📥 Commits

Reviewing files that changed from the base of the PR and between d086ad1 and f98fe62.

📒 Files selected for processing (7)
  • .gitignore
  • Modules/Core/Database/Seeders/RolesSeeder.php
  • Modules/Core/Tests/AbstractAdminPanelTestCase.php
  • Modules/Core/Tests/AbstractCompanyPanelTestCase.php
  • Modules/Invoices/Tests/Feature/InvoicesTest.php
  • Modules/Quotes/Tests/Feature/QuotesTest.php
  • README.md

Comment thread README.md
## 📦 Requirements

- **PHP** 8.2 or higher
- **PHP** 8.3 or higher

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Keep the documented and Composer PHP requirements consistent.

README.md now requires PHP 8.3+, while composer.json:20 still allows PHP 8.2 via "^8.2". Either update the Composer constraint to ^8.3 when supported, or keep the README at 8.2 until the dependency change lands.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@README.md` at line 47, Align the PHP version requirement in README.md with
the Composer constraint at composer.json:20: either change the Composer
requirement to ^8.3 if supported, or revert the README requirement to PHP 8.2
until that dependency change is made.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant