Skip to content

IDE-4857: Add PathRewriteConnector for environment based API path rewriting to make commands work with MEO.#1977

Open
vishalkhode1 wants to merge 3 commits intomainfrom
IDE-4857
Open

IDE-4857: Add PathRewriteConnector for environment based API path rewriting to make commands work with MEO.#1977
vishalkhode1 wants to merge 3 commits intomainfrom
IDE-4857

Conversation

@vishalkhode1
Copy link
Copy Markdown
Contributor

@vishalkhode1 vishalkhode1 commented Apr 1, 2026

TBD

Copilot AI review requested due to automatic review settings April 1, 2026 19:06
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 1, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.37%. Comparing base (37e99ec) to head (d9897dc).

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #1977      +/-   ##
============================================
+ Coverage     92.34%   92.37%   +0.03%     
- Complexity     1940     1953      +13     
============================================
  Files           122      123       +1     
  Lines          7051     7082      +31     
============================================
+ Hits           6511     6542      +31     
  Misses          540      540              

☔ View full report in Codecov by Sentry.
📢 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.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 1, 2026

Try the dev build for this PR: https://acquia-cli.s3.amazonaws.com/build/pr/1977/acli.phar

curl -OL https://acquia-cli.s3.amazonaws.com/build/pr/1977/acli.phar
chmod +x acli.phar

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a connector decorator to transparently rewrite specific Acquia Cloud API request paths when running in an MEO context (detected via AH_CODEBASE_UUID), and updates connector factory typing accordingly.

Changes:

  • Added PathRewriteConnector to rewrite /applications/{uuid}/environments and /applications/{uuid}/permissions requests to codebase-based /translation/codebases/{codebaseUuid}/... endpoints.
  • Updated ConnectorFactoryInterface (and implementations) to return ConnectorInterface.
  • Added PHPUnit coverage for the new connector and the factory behavior when AH_CODEBASE_UUID is set/unset.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
tests/phpunit/src/CloudApi/PathRewriteConnectorTest.php Adds unit tests validating rewrite behavior, passthrough behavior, and missing-env behavior.
tests/phpunit/src/CloudApi/ConnectorFactoryTest.php Adds tests ensuring the factory wraps the connector when AH_CODEBASE_UUID is set.
src/ConnectorFactoryInterface.php Simplifies the factory contract to return ConnectorInterface.
src/CloudApi/PathRewriteConnector.php Introduces the connector decorator that performs regex-based path rewrites.
src/CloudApi/ConnectorFactory.php Wraps the created connector with PathRewriteConnector when AH_CODEBASE_UUID is present; refactors connector construction into buildConnector().
src/AcsfApi/AcsfConnectorFactory.php Aligns the ACSF connector factory return type with the updated interface (ConnectorInterface).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@vishalkhode1 vishalkhode1 changed the title Fixed the error for some commands that doesn't work in MEO. IDE-4857: Fixed the error for some commands that doesn't work in MEO. Apr 2, 2026
@vishalkhode1 vishalkhode1 changed the title IDE-4857: Fixed the error for some commands that doesn't work in MEO. IDE-4857: IDE-4857: Add PathRewriteConnector for environment based API path rewriting to make commands work with MEO. Apr 2, 2026
@vishalkhode1 vishalkhode1 changed the title IDE-4857: IDE-4857: Add PathRewriteConnector for environment based API path rewriting to make commands work with MEO. IDE-4857: Add PathRewriteConnector for environment based API path rewriting to make commands work with MEO. Apr 2, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants