Skip to content

[#3108] Closed every 'task' output helper with a matching 'pass' or 'fail'. - #3121

Merged
AlexSkrypnyk merged 6 commits into
mainfrom
feature/3108-close-task-pass-fail
Sep 9, 2026
Merged

AlexSkrypnyk merged 6 commits into
mainfrom
feature/3108-close-task-pass-fail

Conversation

@AlexSkrypnyk

Copy link
Copy Markdown
Member

Closes #3108

Summary

vortex-deploy-lagoon, vortex-deploy-artifact, vortex-export-db-image, vortex-push-container-registry, vortex-setup-ssh, vortex-task-copy-db-acquia, vortex-task-copy-files-acquia, vortex-task-purge-cache-acquia, and vortex-fetch-db-acquia now close every task they open with exactly one pass or fail on every code path, matching the rule stated in .vortex/CLAUDE.md and .vortex/docs/content/contributing/maintenance/template.mdx.
An audit of .vortex/tooling/src/ found ten sites that left a task unclosed, closed it conditionally, or reopened it inside a loop iteration - the four vortex-deploy-lagoon deploy sites guarded their closing pass behind [ "${exit_code}" = "0" ] and fell back to a script-final fail "Lagoon deployment completed with errors." that named no step, while vortex-fetch-db-acquia could emit pass "Backup completed successfully." inside the wait loop and then still fail "Backup creation timed out ..." for the same task when a backup finished on the poll that exhausted elapsed -ge max_wait.
A failed Lagoon deploy or redeploy now fails through the new close_deploy() helper with a message naming the specific request (e.g. Failed to request redeployment of environment: project: X, branch: Y.) instead of the generic end-of-script line, and vortex-provision's double close of task "Running database updates." on the config-verification path is deliberately left alone because it is a double close rather than a missing one and its output is captured in the published build and provision demo videos.

Before / After

┌─ BEFORE ─────────────────────────────────────────────────────────────────────┐
│ [TASK] Redeploying environment: project: X, branch: Y.                       │
│ [TASK] Waiting for deployment to be queued.                                  │
│ [ OK ] Waited for deployment to be queued.                                   │
│ [TASK] Restoring a database import override flag.                            │
│ [ OK ] Restored a database import override flag.                             │
│ [FAIL] Lagoon deployment completed with errors.                              │
└──────────────────────────────────────────────────────────────────────────────┘
"Redeploying" never closes, and the failure names no step.

┌─ AFTER ──────────────────────────────────────────────────────────────────────┐
│ [TASK] Redeploying environment: project: X, branch: Y.                       │
│        Waiting for deployment to be queued.                                  │
│        Restored a database import override flag.                             │
│ [FAIL] Failed to request redeployment of environment: project: X, branch: Y. │
└──────────────────────────────────────────────────────────────────────────────┘
"Redeploying" closes exactly once, naming the step that failed.

Changes

  • vortex-deploy-lagoon - added close_deploy() to close each deploy task with pass "Requested <what>" on success, or deploy_error plus fail "Failed to request <what>" on failure; moved the VORTEX_PROVISION_OVERRIDE_DB restore ahead of that check in both redeploy branches and switched it to note; removed the now-unreachable script-final failure block.
  • vortex-deploy-artifact - added pass "Ran artifact builder." to close task "Running artifact builder.", which was previously closed only by the later pass "Finished artifact deployment." banner.
  • vortex-export-db-image - promoted the note reporting task "Exporting database image archive to file ..."'s outcome to pass, keeping the message text unchanged since .vortex/tests/phpunit/Traits/Subtests/SubtestAhoyTrait.php asserts it verbatim.
  • vortex-push-container-registry - changed the per-service task "Processing service ..." wrapper and its closing line to note, leaving the commit and push task/pass pairs as siblings instead of nesting under it.
  • vortex-setup-ssh - collected the fingerprint match into matched_file so task "Searching for MD5 hash ..." closes once after the loop on both the match and no-match paths; changed task "SSH agent does not have a required key loaded. Trying to load." to note and added task "Loading key ${file} into the SSH agent." immediately before ssh-add.
  • vortex-task-copy-db-acquia, vortex-task-copy-files-acquia, vortex-task-purge-cache-acquia - changed the token-refresh task "Retrieving authentication token." inside each retry loop to note "Refreshed authentication token."; changed the hand-rolled echo -n " > Checking task status: " prefix to the note indent via printf.
  • vortex-fetch-db-acquia - added a backup_completed flag so task "Waiting for backup to complete." closes exactly once; moved pass "Backup completed successfully." after the backup_completed guard, replacing the elapsed -ge max_wait check that could still fire after a backup completed on the poll that exhausted the wait budget.
  • .vortex/CLAUDE.md, .vortex/docs/content/contributing/maintenance/template.mdx - documented the task closure rule as exactly one pass or fail per task on every path, that a task must not open while another is open (loop iterations use note), that the rule is one-directional so a check or a skip may report pass or fail on its own, and corrected the rationale for sourcing another Vortex script instead of sub-processing it.
  • Tests - updated deploy-lagoon.bats failure expectations to the per-step message and renamed the "deploy error survives" test; added the new Ran artifact builder. line to deploy-artifact.bats and DeploymentTest.php; added a fetch-db-acquia.bats case for a backup completing on the last allowed poll; added a setup-ssh.bats case for a SHA256 fingerprint with no matching key file.

@coderabbitai

coderabbitai Bot commented Sep 8, 2026

Copy link
Copy Markdown

Warning

Review limit reached

  • Run on-demand review

On-demand reviews are free for the next 12 days. After that, they cost $0.25 per reviewed file.

Or wait 2 minutes for your next included review.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Team

Run ID: 7c2969e7-43a7-4b48-9787-d4f11249fae1

📥 Commits

Reviewing files that changed from the base of the PR and between d131ccb and adef13b.

📒 Files selected for processing (16)
  • .vortex/CLAUDE.md
  • .vortex/docs/content/contributing/maintenance/template.mdx
  • .vortex/tests/phpunit/Functional/DeploymentTest.php
  • .vortex/tooling/src/vortex-deploy-artifact
  • .vortex/tooling/src/vortex-deploy-lagoon
  • .vortex/tooling/src/vortex-export-db-image
  • .vortex/tooling/src/vortex-fetch-db-acquia
  • .vortex/tooling/src/vortex-push-container-registry
  • .vortex/tooling/src/vortex-setup-ssh
  • .vortex/tooling/src/vortex-task-copy-db-acquia
  • .vortex/tooling/src/vortex-task-copy-files-acquia
  • .vortex/tooling/src/vortex-task-purge-cache-acquia
  • .vortex/tooling/tests/unit/deploy-artifact.bats
  • .vortex/tooling/tests/unit/deploy-lagoon.bats
  • .vortex/tooling/tests/unit/fetch-db-acquia.bats
  • .vortex/tooling/tests/unit/setup-ssh.bats

Comment @coderabbitai help to get the list of available commands.

@AlexSkrypnyk AlexSkrypnyk added the A4 Board worker 4 label Sep 8, 2026
@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown

Code coverage (threshold: 90%)

  Classes: 100.00% (1/1)
  Methods: 100.00% (2/2)
  Lines:   98.68% (224/227)
Per-class coverage
Drupal\ys_demo\Plugin\Block\CounterBlock
  Methods: 100.00% ( 2/ 2)   Lines: 100.00% ( 10/ 10)

@AlexSkrypnyk

This comment has been minimized.

2 similar comments
@AlexSkrypnyk

This comment has been minimized.

@AlexSkrypnyk

Copy link
Copy Markdown
Member Author

Code coverage (threshold: 90%)

  Classes: 100.00% (1/1)
  Methods: 100.00% (2/2)
  Lines:   98.68% (224/227)
Per-class coverage
Drupal\ys_demo\Plugin\Block\CounterBlock
  Methods: 100.00% ( 2/ 2)   Lines: 100.00% ( 10/ 10)

@codecov

codecov Bot commented Sep 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.77%. Comparing base (d131ccb) to head (adef13b).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3121      +/-   ##
==========================================
- Coverage   87.13%   86.77%   -0.36%     
==========================================
  Files         108      101       -7     
  Lines        5169     5006     -163     
  Branches       49        3      -46     
==========================================
- Hits         4504     4344     -160     
+ Misses        665      662       -3     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown

📖 Documentation preview for this pull request has been deployed to Netlify:

https://6aa09a9413cf8f28286f33b8--vortex-docs.netlify.app

This preview is rebuilt on every commit and is not the production documentation site.

@AlexSkrypnyk AlexSkrypnyk modified the milestones: 1.41.0, 1.42.0 Sep 8, 2026
@AlexSkrypnyk AlexSkrypnyk added the Needs review Pull request needs a review from assigned developers label Sep 8, 2026
@AlexSkrypnyk
AlexSkrypnyk merged commit 6a8c624 into main Sep 9, 2026
35 checks passed
@AlexSkrypnyk
AlexSkrypnyk deleted the feature/3108-close-task-pass-fail branch September 9, 2026 00:05
@github-project-automation github-project-automation Bot moved this from BACKLOG to Release queue in Vortex 1.x Sep 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A4 Board worker 4 Needs review Pull request needs a review from assigned developers

Projects

Status: Release queue

Development

Successfully merging this pull request may close these issues.

Close every task with a pass or a fail in the shipped tooling scripts

1 participant