Updated scripts to match their counterparts.#2312
Conversation
WalkthroughCompletes Phase 5.5: synchronizes PHP notify/deploy scripts with updated shell scripts—introduces namespaced environment variables (VORTEX_NOTIFY_, VORTEX_DEPLOY_LAGOON_, VORTEX_DEPLOY_ARTIFACT_*), adjusts deploy defaults and Lagoon tag-mode exit, and updates tests and metadata to reflect completion. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Router as Notify Router
participant Slack as notify-slack
participant GitHub as notify-github
participant Jira as notify-jira
participant NR as notify-newrelic
participant ExtGH as GitHub API
participant ExtJ as Jira API
participant ExtNR as NewRelic API
Router->>Router: read/export VORTEX_NOTIFY_BRANCH, VORTEX_NOTIFY_SHA, PR, ENV_URL
Router->>Slack: invoke with exported env
Slack->>ExtGH: (n/a) send Slack webhook
Router->>GitHub: invoke with exported env
GitHub->>ExtGH: create/query deployment using branch ref
Router->>Jira: invoke with exported env
Jira->>ExtJ: post ADF comment built by build_adf_comment()
Router->>NR: invoke with exported env
NR->>ExtNR: post deployment/payload (appid validated numeric)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Comment |
This comment has been minimized.
This comment has been minimized.
|
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## project/2.x #2312 +/- ##
===============================================
- Coverage 84.77% 78.09% -6.69%
===============================================
Files 77 117 +40
Lines 3869 6245 +2376
===============================================
+ Hits 3280 4877 +1597
- Misses 589 1368 +779 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.vortex/tooling/scripts_conversion_plan.md:
- Around line 756-837: The Phase 5.5 bullet "Added `VORTEX_NOTIFY_BRANCH`
(required) variable" and similar bullets use awkward "required Added" phrasing;
update the wording to use "Added required" (e.g., change "Added
`VORTEX_NOTIFY_BRANCH` (required) variable" to "Added required
`VORTEX_NOTIFY_BRANCH` variable") and apply the same fix across all similar
lines under "5.5.1 Notification Scripts Sync" and related bullets (look for text
containing "Added `VORTEX_*` (required)" and "Added `...` (optional)" to ensure
consistency).
In @.vortex/tooling/src/deploy-artifact:
- Around line 97-99: The CI may run PHP <8.3 but the composer global require in
task('Installing artifact builder.') installs drevops/git-artifact:~1.2 which
needs PHP >=8.3; add a pre-check (before the passthru(...) call) that verifies
the PHP runtime meets >=8.3 (e.g., run php -r or php -v and parse the version)
and fail fast with a clear message if it is too old, or alternatively adjust the
requested package constraint to a version compatible with the detected PHP
version; ensure the check is tied to the same installation block that calls
passthru('composer global require ...', $exit_code) and that it prevents running
the composer command when PHP is incompatible.
In @.vortex/tooling/src/deploy-lagoon:
- Around line 20-24: The getenv_required('VORTEX_DEPLOY_LAGOON_PROJECT') check
is executed before the tag-mode early-exit guard, causing tag deployments to
fail; move the getenv_required call (and any related retrievals of
VORTEX_DEPLOY_LAGOON_PROJECT currently around getenv_required() and its adjacent
lines) to after the tag-mode guard that checks $deploy_mode == 'tag' and exits,
so tag flows return early without requiring the project variable, while
branch/other flows still validate the required environment variable.
In @.vortex/tooling/src/notify-jira:
- Around line 78-119: build_adf_comment currently emits a fixed ADF message and
ignores the configured $jira_message / VORTEX_NOTIFY_JIRA_MESSAGE; update
build_adf_comment to accept the template string (e.g., add a $jira_message
parameter or load it inside the function), replace template tokens (like
{{project}}, {{label}}, {{timestamp}}, {{env_url}}, {{login_url}}) with their
values, then convert the resulting string into the ADF structure preserving
links and code marks for tokens (ensure env_url and login_url become 'link'
marks and label becomes a 'code' mark using the same ADF node shapes), or
alternatively remove VORTEX_NOTIFY_JIRA_MESSAGE and its documentation references
if custom templates are no longer supported.
| ## ✅ Phase 5.5: Sync PHP Scripts with Shell Updates - COMPLETE | ||
|
|
||
| After the initial conversion in Phases 1-5, the shell scripts received updates that | ||
| were not reflected in the PHP versions. This phase synchronized all differences. | ||
|
|
||
| ### 5.5.1 Notification Scripts Sync | ||
|
|
||
| **notify (router):** | ||
| - Added `VORTEX_NOTIFY_BRANCH` (required) variable | ||
| - Added `VORTEX_NOTIFY_SHA` (required) variable | ||
| - Added `VORTEX_NOTIFY_PR_NUMBER` (optional) variable | ||
| - Changed `VORTEX_NOTIFY_ENVIRONMENT_URL` from optional to required | ||
| - Added `putenv()` exports for branch, SHA, PR number, label, environment URL, login URL | ||
| - Added detailed summary output matching shell format | ||
|
|
||
| **notify-slack:** | ||
| - Fixed field order: Deployment, Time, Environment, Login (matching shell) | ||
| - Added `footer: 'Vortex Deployment'` to Slack attachment | ||
|
|
||
| **notify-github:** | ||
| - Added `VORTEX_NOTIFY_GITHUB_BRANCH` (with fallback to `VORTEX_NOTIFY_BRANCH`) as deployment ref | ||
| - Replaced `$notify_label` with `$notify_branch` for all deployment API `ref` parameters | ||
| - Fixed `VORTEX_NOTIFY_GITHUB_ENVIRONMENT_TYPE` default: falls back to `VORTEX_NOTIFY_LABEL` then `'PR'` | ||
|
|
||
| **notify-jira:** | ||
| - Added `VORTEX_NOTIFY_JIRA_BRANCH` (with fallback to `VORTEX_NOTIFY_BRANCH`) for issue extraction | ||
| - Changed issue extraction regex to match against branch (not label) | ||
| - Replaced simple text-to-ADF with rich `build_adf_comment()` featuring clickable links, code marks, and hardBreaks | ||
|
|
||
| **notify-newrelic:** | ||
| - Reordered variables: enabled check first, then required variables | ||
| - Renamed `VORTEX_NOTIFY_NEWRELIC_USER_NAME` to `VORTEX_NOTIFY_NEWRELIC_USER` (matching shell) | ||
| - Added `VORTEX_NOTIFY_NEWRELIC_SHA` (with fallback to `VORTEX_NOTIFY_SHA`) | ||
| - Added SHA-based revision fallback before auto-generated LABEL-DATE-TIME pattern | ||
| - Added required variable validation after enabled check (user API key) | ||
| - Added numeric validation for app ID regardless of source | ||
|
|
||
| ### 5.5.2 Deployment Scripts Sync | ||
|
|
||
| **deploy (router):** | ||
| - Fixed `VORTEX_DEPLOY_ACTION` default from `'deploy'` to `''` (matching shell) | ||
|
|
||
| **deploy-artifact:** | ||
| - Fixed SSH prefix from `DEPLOY` to `DEPLOY_ARTIFACT` (matching shell) | ||
| - Added `VORTEX_DEPLOY_ARTIFACT_SSH_FINGERPRINT` and `VORTEX_DEPLOY_ARTIFACT_SSH_FILE` variable names with fallback chain | ||
| - Updated git-artifact version from `~1.1` to `~1.2` (matching shell) | ||
|
|
||
| **deploy-lagoon:** | ||
| - Added tag deployment check: early exit for tag mode (`'Lagoon does not support tag deployments. Skipping.'`) | ||
| - Added `VORTEX_DEPLOY_MODE` variable | ||
| - Added `VORTEX_DEPLOY_LAGOON_*` prefixed variable support with fallbacks: | ||
| - `VORTEX_DEPLOY_LAGOON_ACTION` (fallback: `VORTEX_DEPLOY_ACTION`, default: `'create'`) | ||
| - `VORTEX_DEPLOY_LAGOON_PROJECT` (fallback: `LAGOON_PROJECT`) | ||
| - `VORTEX_DEPLOY_LAGOON_BRANCH` (fallback: `VORTEX_DEPLOY_BRANCH`) | ||
| - `VORTEX_DEPLOY_LAGOON_PR` (fallback: `VORTEX_DEPLOY_PR`) | ||
| - `VORTEX_DEPLOY_LAGOON_PR_HEAD` (fallback: `VORTEX_DEPLOY_PR_HEAD`) | ||
| - `VORTEX_DEPLOY_LAGOON_PR_BASE_BRANCH` (fallback: `VORTEX_DEPLOY_PR_BASE_BRANCH`) | ||
| - `VORTEX_DEPLOY_LAGOON_SSH_FINGERPRINT` (fallback chain) | ||
| - `VORTEX_DEPLOY_LAGOON_SSH_FILE` (fallback chain) | ||
| - `VORTEX_DEPLOY_LAGOON_LAGOONCLI_PATH` (fallback: `VORTEX_LAGOONCLI_PATH`) | ||
| - `VORTEX_DEPLOY_LAGOON_LAGOONCLI_FORCE_INSTALL` (fallback: `VORTEX_LAGOONCLI_FORCE_INSTALL`) | ||
| - `VORTEX_DEPLOY_LAGOON_LAGOONCLI_VERSION` (fallback: `VORTEX_LAGOONCLI_VERSION`) | ||
| - Fixed SSH prefix from `DEPLOY` to `DEPLOY_LAGOON` (matching shell) | ||
|
|
||
| **login-container-registry:** | ||
| - Added `VORTEX_LOGIN_CONTAINER_REGISTRY` (fallback: `VORTEX_CONTAINER_REGISTRY`) | ||
| - Added `VORTEX_LOGIN_CONTAINER_REGISTRY_USER` (fallback: `VORTEX_CONTAINER_REGISTRY_USER`) | ||
| - Added `VORTEX_LOGIN_CONTAINER_REGISTRY_PASS` (fallback: `VORTEX_CONTAINER_REGISTRY_PASS`) | ||
| - Added `VORTEX_LOGIN_CONTAINER_REGISTRY_DOCKER_CONFIG` (fallback: `DOCKER_CONFIG`) | ||
|
|
||
| ### 5.5.3 Test Updates | ||
|
|
||
| All test files updated to match script changes: | ||
| - `NotifyGithubTest.php` - Updated for branch variable, assertions, and data providers | ||
| - `NotifyJiraTest.php` - Updated for branch-based issue extraction | ||
| - `NotifyNewrelicTest.php` - Updated for optional variables, custom error messages | ||
| - `NotifyRouterTest.php` - Added required branch and SHA variables | ||
| - `DeployArtifactTest.php` - Updated git-artifact version in mocks | ||
| - `DeployLagoonTest.php` - Updated error message for new variable names | ||
|
|
||
| **All 429 tests passing with 1,861 assertions** ✅ | ||
|
|
There was a problem hiding this comment.
Fix the “required Added” wording in the Phase 5.5 bullet.
The bullet reads awkwardly; splitting it removes the double-modal.
✍️ Suggested wording fix
-- Changed `VORTEX_NOTIFY_ENVIRONMENT_URL` from optional to required - Added `putenv()` exports for branch, SHA, PR number, label, environment URL, login URL
+- Changed `VORTEX_NOTIFY_ENVIRONMENT_URL` from optional to required.
+- Added `putenv()` exports for branch, SHA, PR number, label, environment URL, login URL🧰 Tools
🪛 LanguageTool
[style] ~768-~768: The double modal “required Added” is nonstandard (only accepted in certain dialects). Consider “to be Added”.
Context: ...ONMENT_URLfrom optional to required - Addedputenv()` exports for branch, SHA, PR ...
(NEEDS_FIXED)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In @.vortex/tooling/scripts_conversion_plan.md around lines 756 - 837, The Phase
5.5 bullet "Added `VORTEX_NOTIFY_BRANCH` (required) variable" and similar
bullets use awkward "required Added" phrasing; update the wording to use "Added
required" (e.g., change "Added `VORTEX_NOTIFY_BRANCH` (required) variable" to
"Added required `VORTEX_NOTIFY_BRANCH` variable") and apply the same fix across
all similar lines under "5.5.1 Notification Scripts Sync" and related bullets
(look for text containing "Added `VORTEX_*` (required)" and "Added `...`
(optional)" to ensure consistency).
| task('Installing artifact builder.'); | ||
| passthru('composer global require --dev -n --ansi --prefer-source --ignore-platform-reqs drevops/git-artifact:~1.1', $exit_code); | ||
| passthru('composer global require --dev -n --ansi --prefer-source --ignore-platform-reqs drevops/git-artifact:~1.2', $exit_code); | ||
| if ($exit_code !== 0) { |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Check git-artifact versions and requirements on Packagist.
echo "=== Checking available 1.2.x versions ==="
curl -s https://packagist.org/packages/drevops/git-artifact.json | jq -r '.package.versions | keys[]' | grep -E '^1\.2' || echo "No versions found"
echo -e "\n=== Checking PHP requirements for 1.2.0 ==="
curl -s https://packagist.org/packages/drevops/git-artifact.json | jq -r '.package.versions["1.2.0"] // empty' | head -20Repository: drevops/vortex
Length of output: 707
🏁 Script executed:
#!/bin/bash
# Get full PHP requirements for version 1.2.0
curl -s https://packagist.org/packages/drevops/git-artifact.json | jq -r '.package.versions["1.2.0"].require' 2>/dev/null || echo "Failed to retrieve requirements"Repository: drevops/vortex
Length of output: 302
Verify PHP 8.3+ availability in CI environment.
Version 1.2.0 exists on Packagist, but it requires PHP >=8.3. Ensure the CI runtime meets this requirement before deployment.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In @.vortex/tooling/src/deploy-artifact around lines 97 - 99, The CI may run PHP
<8.3 but the composer global require in task('Installing artifact builder.')
installs drevops/git-artifact:~1.2 which needs PHP >=8.3; add a pre-check
(before the passthru(...) call) that verifies the PHP runtime meets >=8.3 (e.g.,
run php -r or php -v and parse the version) and fail fast with a clear message
if it is too old, or alternatively adjust the requested package constraint to a
version compatible with the detected PHP version; ensure the check is tied to
the same installation block that calls passthru('composer global require ...',
$exit_code) and that it prevents running the composer command when PHP is
incompatible.
8be7307 to
694be27
Compare
There was a problem hiding this comment.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Duplicate comments:
In @.vortex/tooling/scripts_conversion_plan.md:
- Around line 763-769: The bullet list in the notify (router) section is
awkwardly phrased where two "Added" items are combined with a double modal;
split the combined line that mentions VORTEX_NOTIFY_BRANCH and VORTEX_NOTIFY_SHA
into two separate bullets so each required variable gets its own "Added
`VORTEX_NOTIFY_BRANCH` (required)" and "Added `VORTEX_NOTIFY_SHA` (required)"
entry, and ensure the other entries (VORTEX_NOTIFY_PR_NUMBER,
VORTEX_NOTIFY_ENVIRONMENT_URL, and the putenv() exports) remain as their own
bullets for clarity.
In @.vortex/tooling/src/deploy-artifact:
- Around line 97-99: Before running the composer global require for
drevops/git-artifact:~1.2 (the passthru call that sets $exit_code), add a guard
that checks the runtime PHP version and fails or chooses an appropriate
constraint if the PHP version is below the package's requirement; specifically,
detect PHP_VERSION or php -v, compare against the git-artifact 1.2 requirement
and if too old either log an error and exit before calling passthru or switch to
a compatible package constraint, ensuring the check surrounds the block that
contains task('Installing artifact builder.') and the passthru(...) invocation
so you never install with --ignore-platform-reqs on an incompatible PHP.
In @.vortex/tooling/src/deploy-lagoon:
- Around line 33-35: The getenv_required call that initializes $lagoon_project
(getenv_required('VORTEX_DEPLOY_LAGOON_PROJECT', 'LAGOON_PROJECT')) is executed
before the tag-mode early-exit, causing tag deployments to fail; move this
getenv_required invocation (and the similar getenv_required usages mentioned
around lines 86–91) to after the tag-mode guard/early-exit check so the script
returns early for tag-mode without attempting to validate or read LAGOON-related
env vars.
|
|
|
|
Summary by CodeRabbit
New Features
Improvements
Bug Fixes
Tests