-
Notifications
You must be signed in to change notification settings - Fork 10
Development environment setup #20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
b3623e1
Add AGENTS.md and testbench.yaml for development environment setup
cursoragent 9fdb503
Add orchestra/testbench dev dependency for running tests
cursoragent e8426a3
Fix 4 critical bugs in WardenAuditCommand and AuditCacheService
cursoragent 2c09a16
Fix UX issues in audit output and schedule command
cursoragent 09f0281
Code quality: extract CustomAuditWrapper, remove dead code, clean config
cursoragent 67b3c09
Fix tests, add phpunit.xml, CI workflow, and DI improvements
cursoragent 59855e4
Rename ParallelAuditExecutor to AuditExecutor, extract severity trait
cursoragent 59d1172
Update AGENTS.md with current project state
cursoragent ad0be2c
Keep --silent backward compatible alongside --no-notify
cursoragent 9f5b4c0
Replace spinner with per-audit progress reporting
cursoragent bdd9793
Fix PHPStan analysis issues
cursoragent 7400f62
Merge branch 'cursor/development-environment-setup-8bf3' into cursor/…
dgtlss 8eeea1f
Merge pull request #21 from dgtlss/cursor/phpstan-analysis-issues-f0b8
dgtlss 17d353e
fix: resolve PHPStan analysis issues
cursoragent b479bb7
Merge pull request #22 from dgtlss/cursor/phpstan-analysis-issues-6efe
dgtlss 3ef29cc
Update tests.yml
dgtlss 8dd0680
docs(AGENTS): hyphenate Cloud-specific, add comma, document Laravel 1…
cursoragent 7d755ac
style: add blank line after trait use (NewlineBetweenClassLikeStmtsRe…
cursoragent 78d60c0
fix: populate AuditExecutor results, add AuditServiceInterface, fix C…
cursoragent f5d25cb
refactor(AuditCacheService): move AUDIT_NAMES to class top with sync …
cursoragent 2bd3746
fix(WardenAuditCommand): handleAbandonedPackages only on human output…
cursoragent dc1bb6c
fix(WardenServiceProvider): use --no-notify, remove unused binding param
cursoragent 496e314
ci: add Composer cache step to speed dependency install
cursoragent e7e5d69
style: apply Rector (SimplifyIfReturnBool, NewlineAfterStatement, Ren…
cursoragent 7befb1c
Merge pull request #23 from dgtlss/cursor/warden-code-refinements-b113
dgtlss 268251b
docs(readme): update structure, add command reference, document --no-…
cursoragent 0065fd8
Merge pull request #24 from dgtlss/cursor/readme-documentation-struct…
dgtlss a9d7042
Add Snyk rules and improve audit command
nlangerdevtbg fa625c3
Do not suppress notifications on old Console
nlangerdevtbg 4c24d3c
PHPStan issue resolutions
nlangerdevtbg 23852e8
bump version to 1.5.0
nlangerdevtbg File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| --- | ||
| alwaysApply: true | ||
| always_on: true | ||
| trigger: always_on | ||
| applyTo: "**" | ||
| description: Snyk Security At Inception | ||
| --- | ||
|
|
||
| # Project security best practices | ||
|
|
||
| - Always run snyk_code_scan tool for new first party code that is generated in a Snyk-supported language. | ||
| - If any security issues are found based on newly introduced or modified code or dependencies, attempt to fix the issues using the results context from Snyk. | ||
| - Rescan the code after fixing the issues to ensure that the issues were fixed and that there are no newly introduced issues. | ||
| - Repeat this process until no new issues are found. |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| name: Tests | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ main, master ] | ||
| pull_request: | ||
| branches: [ main, master ] | ||
|
|
||
| jobs: | ||
| tests: | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| php: ['8.4'] | ||
|
|
||
| name: PHP ${{ matrix.php }} | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up PHP | ||
| uses: shivammathur/setup-php@v2 | ||
| with: | ||
| php-version: ${{ matrix.php }} | ||
| tools: composer | ||
| coverage: none | ||
|
|
||
| - name: Cache Composer dependencies | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: ~/.composer/cache | ||
| key: composer-${{ matrix.php }}-${{ hashFiles('composer.lock') }} | ||
| restore-keys: composer-${{ matrix.php }}- | ||
|
|
||
| - name: Install dependencies | ||
| run: composer install --no-interaction --no-progress | ||
|
|
||
| - name: Run PHPStan | ||
| run: vendor/bin/phpstan analyse --memory-limit=2G | ||
|
|
||
| - name: Run tests | ||
| run: vendor/bin/phpunit tests/ | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,6 @@ | ||
| .phpunit.cache | ||
| /vendor | ||
| .idea | ||
| .idea | ||
| # Snyk Security Extension - AI Rules (auto-generated) | ||
| .windsurf/rules/snyk_rules.md | ||
| /coverage-html |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| { | ||
| "snyk.advanced.autoSelectOrganization": true | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| # AGENTS.md | ||
|
|
||
| ## Cursor Cloud-specific instructions | ||
|
|
||
| ### Project overview | ||
|
|
||
| Warden is a Laravel security audit **package** (library), not a standalone application. It is tested using Orchestra Testbench, which bootstraps a minimal Laravel environment in-memory. | ||
|
|
||
| ### Prerequisites (installed in VM snapshot) | ||
|
|
||
| - PHP 8.4 (from `ppa:ondrej/php`; extensions: cli, mbstring, xml, curl, zip, sqlite3) | ||
| - Composer 2.x (installed to `/usr/local/bin/composer`) | ||
|
|
||
| ### Key commands | ||
|
|
||
| | Task | Command | | ||
| |---|---| | ||
| | Install dependencies | `composer install --no-interaction` | | ||
| | Static analysis (lint) | `composer phpstan` or `vendor/bin/phpstan analyse --memory-limit=2G` | | ||
| | Run tests | `vendor/bin/phpunit tests/` | | ||
| | Code quality (dry-run) | `vendor/bin/rector process --dry-run` | | ||
| | Run package commands | `vendor/bin/testbench warden:audit` / `vendor/bin/testbench warden:syntax` | | ||
|
|
||
| ### Gotchas | ||
|
|
||
| - **Tests target Laravel 12+**: The package supports Laravel 7–12, but `orchestra/testbench ^10.9` pins the test suite to Laravel 12+; CI runs against the latest supported Laravel. | ||
| - **PHPStan with full framework**: When `orchestra/testbench` is installed (which brings in `laravel/framework`), PHPStan may report additional errors due to full type information replacing stubs. The CI workflow installs testbench, so check PHPStan passes with `composer phpstan`. | ||
| - **testbench.yaml**: Registers `WardenServiceProvider` so `vendor/bin/testbench` can run the package's artisan commands (e.g., `warden:audit`). | ||
| - **Test app**: To test the package inside a real Laravel app, create one in `/tmp`: `cd /tmp && composer create-project laravel/laravel warden-test-app` then `cd warden-test-app && composer config repositories.warden path /workspace && composer require dgtlss/warden:* --dev`. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.