Skip to content

[#3105] Matched the prod domain placeholder case in the Acquia purge-cache task. - #3118

Merged
AlexSkrypnyk merged 1 commit into
mainfrom
feature/3105-prod-domain-case
Sep 8, 2026
Merged

AlexSkrypnyk merged 1 commit into
mainfrom
feature/3105-prod-domain-case

Conversation

@AlexSkrypnyk

Copy link
Copy Markdown
Member

Closes #3105

Summary

.vortex/tooling/src/vortex-task-purge-cache-acquia now strips the $TARGET_ENV_REMAP. and $TARGET_ENV. placeholder tokens from the domain it compiles for the prod environment using case-matched patterns, so the domain purged for production is your-site-domain.example instead of prod.your-site-domain.example.

The two ${domain//pattern/} strip patterns in the prod branch were lowercase (\$target_env_remap., \$target_env.) while hooks/library/domains.txt ships the uppercase token $TARGET_ENV_REMAP.your-site-domain.example, and Bash pattern substitution is case-sensitive, so when target_env is prod neither pattern matched and the placeholder reached domain="$(eval echo "${domain}")", which expands $TARGET_ENV_REMAP by name against the shell variable set to prod a few lines earlier.

The Acquia purge for prod now targets the real production domain instead of prod.your-site-domain.example, a host that typically does not exist and that the task reported as a skipped missing domain while still exiting successfully; the dev, test, and test2 branches, which intentionally keep their environment prefix, are untouched, and .vortex/tooling/tests/unit/task-purge-cache-acquia.bats adds the script's first BATS coverage so a future token-case change fails the suite instead of passing against a stale fixture.

Before / After

BEFORE: lowercase strip patterns miss the shipped token
┌─────────────────────────────────────────────────────────────────┐
│ domains.txt   $TARGET_ENV_REMAP.your-site-domain.example        │
│ strip          ${domain//\$target_env_remap./}  (no match)      │
│ eval           expands $TARGET_ENV_REMAP -> prod                │
│ purged         prod.your-site-domain.example (missing, skipped) │
└─────────────────────────────────────────────────────────────────┘

AFTER: uppercase strip patterns match the shipped token
┌─────────────────────────────────────────────────────────────────┐
│ domains.txt   $TARGET_ENV_REMAP.your-site-domain.example        │
│ strip          ${domain//\$TARGET_ENV_REMAP./}  (stripped)      │
│ eval           nothing left to expand                           │
│ purged         your-site-domain.example (real host, purged)     │
└─────────────────────────────────────────────────────────────────┘

Changes

  • Uppercased both strip patterns in the prod branch of .vortex/tooling/src/vortex-task-purge-cache-acquia to $TARGET_ENV_REMAP. and $TARGET_ENV., matching the case of the token hooks/library/domains.txt ships and the legacy pre-2022 token some consumer copies may still carry.
  • Kept TARGET_ENV_REMAP/TARGET_ENV uppercase rather than renaming the shell variables to lowercase: the later eval echo "${domain}" resolves the placeholder by name against those variables, so lowercasing them would expand to an empty segment on every environment, not just prod.
  • Added .vortex/tooling/tests/unit/task-purge-cache-acquia.bats with 8 tests driven by the real shipped hooks/library/domains.txt: prod strips the shipped placeholder, prod strips the legacy $TARGET_ENV. token, dev / test (remapped to stage) / test2 keep their prefixes, an unknown environment compiles no domains, a full prod purge completes through the notification-status poll, and the missing-key guard stops before any request.
  • Every curl call in the new suite is mocked through the STEPS/steps_run idiom used by fetch-db-acquia.bats, so the tests run without network access.

Screenshots

N/A

@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 52 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: 705f8ba6-9161-4941-874f-22bef92d42a9

📥 Commits

Reviewing files that changed from the base of the PR and between efa94ff and 9c21b0b.

📒 Files selected for processing (2)
  • .vortex/tooling/src/vortex-task-purge-cache-acquia
  • .vortex/tooling/tests/unit/task-purge-cache-acquia.bats

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

@AlexSkrypnyk AlexSkrypnyk added the A1 Board worker 1 label Sep 8, 2026
@AlexSkrypnyk AlexSkrypnyk moved this from BACKLOG to To do for current release in Vortex 1.x Sep 8, 2026
@AlexSkrypnyk AlexSkrypnyk moved this from To do for current release to In progress in Vortex 1.x Sep 8, 2026
@AlexSkrypnyk

This comment has been minimized.

@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.

1 similar comment
@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 (efa94ff) to head (9c21b0b).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3118      +/-   ##
==========================================
- 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://6aa08ec9bee5567894364f5c--vortex-docs.netlify.app

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

@AlexSkrypnyk AlexSkrypnyk added the Needs review Pull request needs a review from assigned developers label Sep 8, 2026
@AlexSkrypnyk
AlexSkrypnyk merged commit 68a6a1b into main Sep 8, 2026
35 checks passed
@AlexSkrypnyk
AlexSkrypnyk deleted the feature/3105-prod-domain-case branch September 8, 2026 22:45
@github-project-automation github-project-automation Bot moved this from In progress to Release queue in Vortex 1.x Sep 8, 2026
@AlexSkrypnyk AlexSkrypnyk added this to the 1.42.0 milestone Sep 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A1 Board worker 1 Needs review Pull request needs a review from assigned developers

Projects

Status: Release queue

Development

Successfully merging this pull request may close these issues.

Match the prod domain placeholder case in the Acquia purge-cache task

1 participant