Skip to content

A4A Amplify: gate section behind per-agency flag#112274

Merged
tiagonoronha merged 3 commits into
trunkfrom
update/a4a-amplify-agency-flag-gating
Jul 14, 2026
Merged

A4A Amplify: gate section behind per-agency flag#112274
tiagonoronha merged 3 commits into
trunkfrom
update/a4a-amplify-agency-flag-gating

Conversation

@tiagonoronha

@tiagonoronha tiagonoronha commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Proposed Changes

Gate the A4A Amplify section behind a per-agency amplify.allowed flag instead of the global a8c-for-agencies-amplify section flag.

  • Add an optional amplify?: { allowed: boolean } field to the Agency type, mirroring the existing mcp flag.
  • Show the Amplify sidebar menu item only when agency.amplify.allowed is set.
  • Add a requireAmplifyAccessContext route guard that redirects to the A4A overview when the active agency lacks access, and wire it into both the Amplify overview and reports routes.
  • Flip the a8c-for-agencies-amplify section flag to true in production so the Amplify routes register there and the per-agency amplify.allowed flag becomes the sole access control, matching the learn/MCP rollout pattern.

Companion PR: 226450-ghe-Automattic/wpcom (adds the amplify.allowed flag to the agency payload).

Why are these changes being made?

Amplify access should be controlled per agency rather than being all-or-nothing via a global section flag, so the backend can grant it selectively.

Testing Instructions

  • Ensure the companion PR 226450-ghe-Automattic/wpcom is applied to your sandbox (it must be merged or applied to the sandbox for the flag to be returned).
  • As an agency with amplify.allowed: confirm the Amplify item appears in the sidebar and that both the Amplify overview and reports pages load.
  • As an agency without amplify.allowed: confirm the Amplify sidebar item is hidden and that visiting the Amplify overview/reports URLs directly redirects to the A4A overview.

Pre-merge Checklist

  • Has the general commit checklist been followed? (PCYsg-hS-p2)
  • Have you written new tests for your changes?
  • Have you tested the feature in Simple (P9HQHe-k8-p2), Atomic (P9HQHe-jW-p2), and self-hosted Jetpack sites (PCYsg-g6b-p2)?
  • Have you checked for TypeScript, React or other console errors?
  • For UI changes, have you tested the affected components in dark mode?
  • Have you tested accessibility for your changes? Ensure the feature remains usable with various user agents (e.g., browsers), interfaces (e.g., keyboard navigation), and assistive technologies (e.g., screen readers) (PCYsg-S3g-p2).
  • Have you used memoizing on expensive computations? More info in Memoizing with create-selector and Using memoizing selectors and Our Approach to Data
  • Have we added the "[Status] String Freeze" label as soon as any new strings were ready for translation (p4TIVU-5Jq-p2)?
    • For UI changes, have we tested the change in various languages (for example, ES, PT, FR, or DE)? The length of text and words vary significantly between languages.
  • For changes affecting Jetpack: Have we added the "[Status] Needs Privacy Updates" label if this pull request changes what data or activity we track or use (p4TIVU-aUh-p2)?

@tiagonoronha
tiagonoronha marked this pull request as ready for review July 3, 2026 14:47
@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown

Looks like one of the E2E tests has failed.

You can fix them following these steps:

  1. Check out this branch locally:
    gh pr checkout 112274
  2. Start Claude Code in the repo:
    claude
  3. Run the /fix-e2e-tests skill, passing this PR number:
    /fix-e2e-tests 112274
    

Register the Amplify routes in production so the per-agency amplify.allowed
flag and route guard become the sole access control, matching the learn/MCP
rollout pattern.

Claude-Session: https://claude.ai/code/session_015tcJJ9oJLARb3K3XQnf28s

@vitozev vitozev left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM!

@tiagonoronha
tiagonoronha merged commit 8d56250 into trunk Jul 14, 2026
15 checks passed
@tiagonoronha
tiagonoronha deleted the update/a4a-amplify-agency-flag-gating branch July 14, 2026 08:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants