Skip to content

Commit bb9ec60

Browse files
committed
[#1192] Added drevops/vortex-tooling codebase. (#2115)
1 parent 4f37415 commit bb9ec60

11 files changed

Lines changed: 843 additions & 253 deletions

.vortex/CLAUDE.md

Lines changed: 34 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,10 @@ vortex/
102102
├── .vortex/ # Test harness and development tools
103103
│ ├── docs/ # Documentation for Vortex
104104
│ ├── installer/ # Self-contained Symfony console installer
105+
│ ├── tooling/ # PHP helpers and notification scripts
106+
│ │ └── CLAUDE.md # Tooling documentation (see this for tooling work)
105107
│ ├── tests/ # Unit and functional tests
106-
│ └── CLAUDE.md # This maintenance guide
108+
│ └── CLAUDE.md # This maintenance guide
107109
└── [root files] # The actual Drupal template
108110
└── CLAUDE.md # Drupal development guide
109111
```
@@ -112,7 +114,7 @@ vortex/
112114

113115
## .vortex Directory Structure
114116

115-
The `.vortex/` directory contains **three distinct subsystems**, each with its own purpose and technology stack:
117+
The `.vortex/` directory contains **four distinct subsystems**, each with its own purpose and technology stack:
116118

117119
### 1. .vortex/docs/ - Documentation Website
118120

@@ -174,7 +176,22 @@ composer install # Install dependencies
174176
UPDATE_SNAPSHOTS=1 composer test # Update test snapshots
175177
```
176178

177-
### 3. .vortex/tests/ - Template Testing Harness
179+
### 3. .vortex/tooling/ - Notification & Helper Scripts
180+
181+
**Purpose**: Reusable PHP helper functions and notification scripts for Vortex operations
182+
183+
> **⚠️ ALL TOOLING DOCUMENTATION IS IN `.vortex/tooling/CLAUDE.md`**
184+
>
185+
> For ANY work related to:
186+
>
187+
> - PHP helper functions (request_get, request_post, output formatters, etc.)
188+
> - Notification scripts (notify-github, notify-jira, notify-slack, etc.)
189+
> - Mock system (MockTrait, Self tests)
190+
> - Tooling tests
191+
>
192+
> **→ See `.vortex/tooling/CLAUDE.md` for complete documentation**
193+
194+
### 4. .vortex/tests/ - Template Testing Harness
178195

179196
**Purpose**: Comprehensive testing of the Vortex template itself through functional workflows
180197

@@ -208,7 +225,7 @@ cd tests && ./vendor/bin/phpunit # Run PHPUnit workflow tests
208225

209226
## Testing Architecture Overview
210227

211-
Vortex uses **four independent testing systems**, each serving different parts of the codebase:
228+
Vortex uses **five independent testing systems**, each serving different parts of the codebase:
212229

213230
### 1. Documentation Tests (.vortex/docs/)
214231

@@ -248,7 +265,11 @@ Vortex uses **four independent testing systems**, each serving different parts o
248265
- **Handler tests**: Individual prompt and modification logic
249266
- **Fixture tests**: Expected vs actual template output
250267

251-
### 3. Template Tests (.vortex/tests/)
268+
### 3. Tooling Tests (.vortex/tooling/)
269+
270+
> **→ See `.vortex/tooling/CLAUDE.md`** for all tooling test documentation
271+
272+
### 4. Template Tests (.vortex/tests/)
252273

253274
**Scope**: Testing the actual Drupal template functionality
254275

@@ -266,7 +287,7 @@ Vortex uses **four independent testing systems**, each serving different parts o
266287
- **PHPUnit Functional**: End-to-end workflow testing
267288
- **BATS Unit**: Individual shell script testing with mocking
268289

269-
### 4. Manual Integration Tests (.vortex/tests/manual/)
290+
### 5. Manual Integration Tests (.vortex/tests/manual/)
270291

271292
**Scope**: Manual verification of notification integrations with real external services
272293

@@ -632,12 +653,13 @@ When script output changes, update corresponding test files:
632653

633654
1. **Documentation** (`.vortex/docs/`): Requires Node.js/Yarn
634655
2. **Installer** (`.vortex/installer/`): Requires PHP/Composer
635-
3. **Template** (`.vortex/tests/`): Requires PHP/Composer + Node.js + BATS
656+
3. **Tooling** (`.vortex/tooling/`): Requires PHP/Composer
657+
4. **Template** (`.vortex/tests/`): Requires PHP/Composer + Node.js + BATS
636658

637659
**Full Setup** (from `.vortex/`):
638660

639661
```bash
640-
ahoy install # Installs dependencies for all three systems
662+
ahoy install # Installs dependencies for all four systems
641663
```
642664

643665
## Unified Testing Commands
@@ -646,13 +668,14 @@ For convenience, you can run tests across all systems:
646668

647669
```bash
648670
# From .vortex/ root
649-
ahoy install # Install all dependencies (docs, installer, template)
671+
ahoy install # Install all dependencies (docs, installer, tooling, template)
650672
ahoy lint # Code linting across all systems
651673
ahoy test # Run all template tests
652674

653675
# Individual system commands
654676
cd docs && yarn test # Documentation tests only
655677
cd installer && composer test # Installer tests only
678+
cd tooling && ./vendor/bin/phpunit # Tooling tests only
656679
cd tests && ./vendor/bin/phpunit # Template PHPUnit tests only
657680
ahoy test-bats -- tests/bats/ # Template BATS tests only
658681
```
@@ -1669,10 +1692,10 @@ throw new \RuntimeException(sprintf(
16691692
### Cross-System Considerations
16701693
16711694
- Each system can be modified independently
1672-
- Changes to template (outside `.vortex/`) may require updates across all three systems
1695+
- Changes to template (outside `.vortex/`) may require updates across all four systems
16731696
- Always run system-specific tests after making changes
16741697
- Consider impact on user workflows when modifying any system
16751698
16761699
---
16771700
1678-
*This knowledge base should be updated whenever significant changes are made to any of the three Vortex subsystems or their maintenance procedures.*
1701+
*This knowledge base should be updated whenever significant changes are made to any of the four Vortex subsystems or their maintenance procedures.*

.vortex/tooling/CLAUDE.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,7 @@ public static function dataProviderMockShellExec(): array {
329329
This replaces 4 separate test methods with a single parameterized test.
330330

331331
**Documentation**:
332+
- Data provider method names should start with `dataProvider` prefix (e.g., `dataProviderHttpMethods`, not `providerHttpMethods`)
332333
- Block comments (PHPDoc /** ... */) are ONLY allowed on test classes, NOT on methods
333334
- Do NOT add block comments to test methods, data provider methods, or helper methods
334335
- Inline comments (// ...) are acceptable for explaining logic within method bodies
@@ -485,15 +486,15 @@ The mock API mirrors the actual request function signatures for consistency and
485486
```php
486487
// Mock request() - matches request() signature + $response parameter
487488
mockRequest(
488-
string $deploy_webhook_url,
489+
string $url,
489490
array $options = [],
490491
array $response = [],
491492
string $namespace = 'DrevOps\\VortexTooling'
492493
): void
493494

494495
// Mock request_get() - matches request_get() signature + $response parameter
495496
mockRequestGet(
496-
string $deploy_webhook_url,
497+
string $url,
497498
array $headers = [],
498499
int $timeout = 10,
499500
array $response = [],
@@ -502,7 +503,7 @@ mockRequestGet(
502503

503504
// Mock request_post() - matches request_post() signature + $response parameter
504505
mockRequestPost(
505-
string $deploy_webhook_url,
506+
string $url,
506507
$body = NULL,
507508
array $headers = [],
508509
int $timeout = 10,

.vortex/tooling/rector.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
use Rector\CodingStyle\Rector\Catch_\CatchExceptionNameMatchingTypeRector;
1919
use Rector\CodingStyle\Rector\ClassMethod\NewlineBeforeNewAssignSetRector;
2020
use Rector\CodingStyle\Rector\FuncCall\CountArrayToEmptyArrayComparisonRector;
21+
use Rector\CodingStyle\Rector\FunctionLike\FunctionLikeToFirstClassCallableRector;
2122
use Rector\CodingStyle\Rector\Stmt\NewlineAfterStatementRector;
2223
use Rector\Config\RectorConfig;
2324
use Rector\DeadCode\Rector\If_\RemoveAlwaysTrueIfConditionRector;
@@ -27,6 +28,7 @@
2728
use Rector\Naming\Rector\ClassMethod\RenameVariableToMatchNewTypeRector;
2829
use Rector\Php55\Rector\String_\StringClassNameToClassConstantRector;
2930
use Rector\Php80\Rector\Switch_\ChangeSwitchToMatchRector;
31+
use Rector\Php81\Rector\Array_\FirstClassCallableRector;
3032
use Rector\Privatization\Rector\ClassMethod\PrivatizeFinalClassMethodRector;
3133
use Rector\Privatization\Rector\MethodCall\PrivatizeLocalGetterToPropertyRector;
3234
use Rector\Privatization\Rector\Property\PrivatizeFinalClassPropertyRector;
@@ -53,6 +55,8 @@
5355
CompleteDynamicPropertiesRector::class,
5456
CountArrayToEmptyArrayComparisonRector::class,
5557
DisallowedEmptyRuleFixerRector::class,
58+
FirstClassCallableRector::class,
59+
FunctionLikeToFirstClassCallableRector::class,
5660
InlineArrayReturnAssignRector::class,
5761
NewlineAfterStatementRector::class,
5862
NewlineBeforeNewAssignSetRector::class,

0 commit comments

Comments
 (0)