Skip to content

EPMRPP-114309 || Fix incorrect redirect for release documentation URLs#1110

Closed
maria-hambardzumian wants to merge 2 commits into
developfrom
fix/EPMRPP-114309-incorrect-redirect-v3
Closed

EPMRPP-114309 || Fix incorrect redirect for release documentation URLs#1110
maria-hambardzumian wants to merge 2 commits into
developfrom
fix/EPMRPP-114309-incorrect-redirect-v3

Conversation

@maria-hambardzumian
Copy link
Copy Markdown
Contributor

@maria-hambardzumian maria-hambardzumian commented May 6, 2026

Summary by CodeRabbit

  • Chores
    • Enhanced deployment workflow to improve redeploy behavior and ensure build artifacts are synced consistently.
    • Added a step to upload and synchronize custom redirect rules to optimize site routing, including legacy URLs, documentation paths, and catch-all 404 handling.
    • Introduced a build specification to standardize pre-build and build steps and clarify artifact output for deployments.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 6, 2026

Walkthrough

Copies a new Amplify build spec and uploads custom redirect rules during the GitHub Actions deploy-dev workflow; adds amplify.yml and amplify-custom-rules.json to the repo to control Amplify build behavior and redirects.

Changes

Amplify Deployment Configuration

Layer / File(s) Summary
Build spec file
amplify.yml
Adds Amplify build spec (version: 1) with frontend phases (preBuild, build), artifacts (baseDirectory: '.', include all), and empty cache paths.
Routing rules
amplify-custom-rules.json
Adds JSON array of custom redirect rules (multiple 301 rules and catch-all 404 mappings) to be applied to the Amplify app.
Workflow wiring
.github/workflows/deploy-dev.yml
During "Trigger Amplify redeploy", copies amplify.yml into /tmp/full-site/ and adds a step calling aws amplify update-app --custom-rules file://amplify-custom-rules.json to sync redirects.
sequenceDiagram
    autonumber
    actor Developer
    participant GitHub as GitHub Actions Runner
    participant S3 as S3 Bucket
    participant Amplify as AWS Amplify Service

    Developer->>GitHub: push to branch triggers deploy-dev workflow
    GitHub->>S3: aws s3 sync (build) -> /tmp/full-site
    GitHub->>S3: cp amplify.yml into /tmp/full-site
    GitHub->>Amplify: aws amplify update-app --custom-rules file://amplify-custom-rules.json
    GitHub->>Amplify: trigger redeploy using /tmp/full-site contents
    Amplify->>S3: fetch site artifacts (including amplify.yml)
    Amplify->>Amplify: apply custom rules and (skip build due to amplify.yml)
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 I hopped into CI with a careful twirl,
Dropped an amplify.yml and rules in a whirl,
The workflow now copies and tells Amplify true,
Redirects in place — a streamlined debut! 🥕

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly addresses the main change: fixing incorrect redirect rules for release documentation URLs, which aligns with the addition of redirect mappings in amplify-custom-rules.json.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/EPMRPP-114309-incorrect-redirect-v3

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@amplify-custom-rules.json`:
- Line 18: The redirect rule using the regex backreference in the object with
"source": "</^([^.]+[^/])$/>" and "target": "/$1/" must be replaced because
Amplify does not support $1 backreferences; update the rule to use Amplify's
named-segment/wildcard syntax (e.g., replace with a rule that uses "<slug>" in
both "source" and "target" and keeps "status": "301") or remove this rule if
existing rules already handle trailing slashes (ensure you edit the object
containing the regex source and target values accordingly).
- Around line 14-16: The redirect rules in amplify-custom-rules.json use
colon-style named parameters in the "source" fields (e.g.,
"/docs/releases/archived-releases/:version", "/docs/releases/:version",
"/docs/installation-steps-advanced/:page") which Amplify Hosting treats as
literal text; update those "source" patterns to use angle-bracket capture syntax
by replacing ":version" with "<version>" and ":page" with "<page>" so the files
become "/docs/releases/archived-releases/<version>", "/docs/releases/<version>",
and "/docs/installation-steps-advanced/<page>" while keeping the same "status"
and "target" values.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 73a41179-2378-4419-a8b6-f17ab267207f

📥 Commits

Reviewing files that changed from the base of the PR and between 55b0249 and a3ea741.

📒 Files selected for processing (3)
  • .github/workflows/deploy-dev.yml
  • amplify-custom-rules.json
  • amplify.yml

Comment thread amplify-custom-rules.json Outdated
Comment on lines +14 to +16
{ "source": "/docs/releases/archived-releases/:version", "status": "301", "target": "/docs/releases/archived-releases/:version/" },
{ "source": "/docs/releases/:version", "status": "301", "target": "/docs/releases/:version/" },
{ "source": "/docs/installation-steps-advanced/:page", "status": "301", "target": "/docs/installation-steps-advanced/:page/" },
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🌐 Web query:

AWS Amplify custom redirect rules named path parameter syntax colon ":param" vs angle bracket "<param>" official documentation

💡 Result:

In AWS Amplify Hosting redirect/rewrite rules, the “path parameter” syntax uses angle brackets like (and wildcard <>)—there is no documented support for a colon-based syntax like:param. Evidence from official AWS docs: - Amplify’s redirect examples use angle brackets for path segment capture, e.g. source "/blog//" and target "/posts//" [1]. - The official “Redirects and rewrites example reference” documents path parameter examples using angle brackets, including "/docs/<" and "/documents/<" for wildcard matching [2]. So, for your question “:param vs ”: - Use (angle brackets). Example: "/blog//" -> "/posts//" [1]. - Do not use:param; that syntax is not mentioned in the Amplify redirect/rewrite rule documentation for captured path segments [1][2]. Note: Amplify also supports a wildcard capture syntax <>, but it’s distinct from named captures like [2].

Citations:


🏁 Script executed:

# Search for the file amplify-custom-rules.json
find . -name "amplify-custom-rules.json" -type f

Repository: reportportal/docs

Length of output: 89


🏁 Script executed:

cat -n ./amplify-custom-rules.json | sed -n '10,20p'

Repository: reportportal/docs

Length of output: 966


Use angle-bracket syntax <version> and <page> instead of colon syntax

Lines 14-16 use incorrect named-parameter syntax (:version, :page). AWS Amplify Hosting requires angle brackets for path segment capture: <version> and <page>. The current syntax will cause Amplify to treat :version and :page as literal strings, silently breaking the core redirect fix for EPMRPP-114309.

🔧 Suggested correction to angle-bracket syntax
-  { "source": "/docs/releases/archived-releases/:version",   "status": "301", "target": "/docs/releases/archived-releases/:version/" },
-  { "source": "/docs/releases/:version",                     "status": "301", "target": "/docs/releases/:version/" },
-  { "source": "/docs/installation-steps-advanced/:page",     "status": "301", "target": "/docs/installation-steps-advanced/:page/" },
+  { "source": "/docs/releases/archived-releases/<version>",  "status": "301", "target": "/docs/releases/archived-releases/<version>/" },
+  { "source": "/docs/releases/<version>",                    "status": "301", "target": "/docs/releases/<version>/" },
+  { "source": "/docs/installation-steps-advanced/<page>",    "status": "301", "target": "/docs/installation-steps-advanced/<page>/" },
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@amplify-custom-rules.json` around lines 14 - 16, The redirect rules in
amplify-custom-rules.json use colon-style named parameters in the "source"
fields (e.g., "/docs/releases/archived-releases/:version",
"/docs/releases/:version", "/docs/installation-steps-advanced/:page") which
Amplify Hosting treats as literal text; update those "source" patterns to use
angle-bracket capture syntax by replacing ":version" with "<version>" and
":page" with "<page>" so the files become
"/docs/releases/archived-releases/<version>", "/docs/releases/<version>", and
"/docs/installation-steps-advanced/<page>" while keeping the same "status" and
"target" values.

Comment thread amplify-custom-rules.json Outdated
…to 200 and adjust targets to include index.html
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

♻️ Duplicate comments (1)
amplify-custom-rules.json (1)

14-16: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Use Amplify path-capture syntax (<param>) instead of colon params.

Line 14, Line 15, and Line 16 still use :version / :page, which Amplify treats as literal text rather than captured segments. That prevents these rewrites from matching real version/page URLs.

Proposed minimal fix
-  { "source": "/docs/releases/archived-releases/:version",   "status": "200", "target": "/docs/releases/archived-releases/:version/index.html" },
-  { "source": "/docs/releases/:version",                     "status": "200", "target": "/docs/releases/:version/index.html" },
-  { "source": "/docs/installation-steps-advanced/:page",     "status": "200", "target": "/docs/installation-steps-advanced/:page/index.html" },
+  { "source": "/docs/releases/archived-releases/<version>",  "status": "200", "target": "/docs/releases/archived-releases/<version>/index.html" },
+  { "source": "/docs/releases/<version>",                    "status": "200", "target": "/docs/releases/<version>/index.html" },
+  { "source": "/docs/installation-steps-advanced/<page>",    "status": "200", "target": "/docs/installation-steps-advanced/<page>/index.html" },
AWS Amplify Hosting custom redirect/rewrite rule syntax: are named path captures required to use angle brackets like <version> (and not :version)?
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@amplify-custom-rules.json` around lines 14 - 16, The redirect rules use
colon-style params which Amplify treats as literal; update the three rule
"source" patterns to use Amplify path-capture syntax by replacing ":version" and
":page" with angle-bracket captures (e.g., change
"/docs/releases/archived-releases/:version" ->
"/docs/releases/archived-releases/<version>", "/docs/releases/:version" ->
"/docs/releases/<version>", and "/docs/installation-steps-advanced/:page" ->
"/docs/installation-steps-advanced/<page>") so the rewrites for those sources
correctly match and capture path segments.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Duplicate comments:
In `@amplify-custom-rules.json`:
- Around line 14-16: The redirect rules use colon-style params which Amplify
treats as literal; update the three rule "source" patterns to use Amplify
path-capture syntax by replacing ":version" and ":page" with angle-bracket
captures (e.g., change "/docs/releases/archived-releases/:version" ->
"/docs/releases/archived-releases/<version>", "/docs/releases/:version" ->
"/docs/releases/<version>", and "/docs/installation-steps-advanced/:page" ->
"/docs/installation-steps-advanced/<page>") so the rewrites for those sources
correctly match and capture path segments.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b13356fc-9e84-4f86-be55-5c9ea57c1b30

📥 Commits

Reviewing files that changed from the base of the PR and between a3ea741 and d179324.

📒 Files selected for processing (1)
  • amplify-custom-rules.json

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.

1 participant