Skip to content

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

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

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

Conversation

@maria-hambardzumian
Copy link
Copy Markdown
Contributor

@maria-hambardzumian maria-hambardzumian commented Apr 29, 2026

Summary by CodeRabbit

  • New Features
    • Added automatic dot-path redirect pages so URLs containing dots now redirect correctly to the intended documentation paths.
  • Bug Fixes
    • Improved and normalized redirect handling (consistent trailing slashes and hash-fragment placement) for more reliable navigation across versioned and nested routes.
  • Chores
    • Consolidated redirect rules to reduce duplicate/mismatched redirect variants.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 29, 2026

Warning

Rate limit exceeded

@maria-hambardzumian has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 13 minutes and 29 seconds before requesting another review.

To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 7e6ada82-b7c7-4fde-9430-c46e4490929a

📥 Commits

Reviewing files that changed from the base of the PR and between 38de82f and 0cef34b.

📒 Files selected for processing (60)
  • .github/workflows/ci.yml
  • docs/installation-steps-advanced/UpgradingPostgreSQLForReportPortalV24-2AndLater.md
  • docs/releases/Version24-1.md
  • docs/releases/Version24-2-0.md
  • docs/releases/Version24-2-2.md
  • docs/releases/Version24-2-3.md
  • docs/releases/Version25-0-2.md
  • docs/releases/Version25-0-3.md
  • docs/releases/Version25-0-4.md
  • docs/releases/Version25-0-5.md
  • docs/releases/Version25-0-6.md
  • docs/releases/Version25-1-1.md
  • docs/releases/Version25-1-10.md
  • docs/releases/Version25-1-11.md
  • docs/releases/Version25-1-12.md
  • docs/releases/Version25-1-2.md
  • docs/releases/Version25-1-3.md
  • docs/releases/Version25-1-4.md
  • docs/releases/Version25-1-5.md
  • docs/releases/Version25-1-6.md
  • docs/releases/Version25-1-7.md
  • docs/releases/Version25-1-8.md
  • docs/releases/Version25-1-9.md
  • docs/releases/Version25-1.md
  • docs/releases/Version25-2.md
  • docs/releases/Version26-0-1.md
  • docs/releases/Version26-0-2.md
  • docs/releases/archived-releases/Version23-1.md
  • docs/releases/archived-releases/Version23-2.md
  • docs/releases/archived-releases/Version3-3-2-1.md
  • docs/releases/archived-releases/Version3-3-2.md
  • docs/releases/archived-releases/Version4-0-0.md
  • docs/releases/archived-releases/Version4-1-0.md
  • docs/releases/archived-releases/Version4-2-0.md
  • docs/releases/archived-releases/Version4-3.md
  • docs/releases/archived-releases/Version5-0-0.md
  • docs/releases/archived-releases/Version5-0RC.md
  • docs/releases/archived-releases/Version5-1-0.md
  • docs/releases/archived-releases/Version5-2-0.md
  • docs/releases/archived-releases/Version5-2-1.md
  • docs/releases/archived-releases/Version5-2-2.md
  • docs/releases/archived-releases/Version5-2-3.md
  • docs/releases/archived-releases/Version5-3-0.md
  • docs/releases/archived-releases/Version5-3-1.md
  • docs/releases/archived-releases/Version5-3-2.md
  • docs/releases/archived-releases/Version5-3-3.md
  • docs/releases/archived-releases/Version5-3-5.md
  • docs/releases/archived-releases/Version5-4-0.md
  • docs/releases/archived-releases/Version5-5-0.md
  • docs/releases/archived-releases/Version5-6-0.md
  • docs/releases/archived-releases/Version5-6-1.md
  • docs/releases/archived-releases/Version5-6-2.md
  • docs/releases/archived-releases/Version5-6-3.md
  • docs/releases/archived-releases/Version5-7-0.md
  • docs/releases/archived-releases/Version5-7-1.md
  • docs/releases/archived-releases/Version5-7-2.md
  • docs/releases/archived-releases/Version5-7-3.md
  • docs/releases/archived-releases/Version5-7-4.md
  • docusaurus.config.js
  • scripts/expand-redirect-from-variants.js

Walkthrough

Docusaurus redirect configuration and redirect-generation were normalized: redirect entries now expand source variants and consistently use trailing slashes (including correct placement before hash fragments). CI deploy workflow now uploads per-dot-named redirect HTML pages to the S3 docs prefix.

Changes

Cohort / File(s) Summary
Redirect configuration
docusaurus.config.js
Switch to building plugin redirects by passing entries through expandRedirectFromVariants(...); normalized from/to paths to include trailing slashes and adjusted hash-fragment placement across many redirect entries.
Redirect expansion utility
scripts/expand-redirect-from-variants.js
New exported function expandRedirectFromVariants(redirects) that expands each redirect's from into de-duplicated pathname variants, handling trailing slashes, hash fragments, root and dot-containing final segments.
CI deploy step
.github/workflows/deploy-dev.yml
Added step after aws s3 sync to enumerate build subdirectories with dots in their basename and upload HTML redirect files to the docs/ S3 prefix that perform client-side redirects preserving search/hash.

Sequence Diagram(s)

sequenceDiagram
  participant Dev as Developer / CI
  participant Build as Docusaurus Build
  participant Expander as expandRedirectFromVariants
  participant S3 as AWS S3 (docs/)
  participant Browser as End-User Browser

  Dev->>Build: run build (uses docusaurus.config.js)
  Build->>Expander: pass redirect entries
  Expander-->>Build: expanded redirects (from variants + normalized paths)
  Build->>S3: aws s3 sync upload of build/
  Dev->>S3: upload generated dot-path redirect HTML files (via workflow step)
  Browser->>S3: request dot-path URL
  S3-->>Browser: serve redirect HTML
  Browser->>Browser: JS reads location and redirects to intended `./<name>/` (preserving search/hash)
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Poem

🐰
I hop through slashes, tidy and neat,
moving hashes where endings should meet.
Variants expanded, redirects in line,
dot-pages forwarded — one smooth design.
A cheerful bounce for docs that align.

🚥 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 describes the main objective of the changeset: fixing incorrect redirects for release documentation URLs, which aligns with the modifications to docusaurus.config.js, redirect utilities, and deployment workflows.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
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

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
Review rate limit: 0/1 reviews remaining, refill in 13 minutes and 29 seconds.

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: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/deploy-dev.yml:
- Around line 87-95: The current "Create dot-path redirect stubs in S3" step
uploads stub objects into the bucket which later collides with the Amplify
redeploy step that syncs the bucket back to a local filesystem; instead of
creating those stubs in S3 with the aws s3 cp loop, build the Amplify deployment
artifact directly from ./build and inject the dotted-path stub entries into the
ZIP (e.g., use a zip writer such as Python's zipfile.writestr or equivalent) so
the archive contains both "foo" and "foo/index.html" without creating
conflicting S3 objects; remove or disable the existing stub-creation loop and
update the workflow to produce the final zip with appended stub entries before
the Amplify deploy step.
🪄 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: 240f736b-09cd-47be-9e14-c0d5bafb9c01

📥 Commits

Reviewing files that changed from the base of the PR and between 9389e55 and 38de82f.

📒 Files selected for processing (3)
  • .github/workflows/deploy-dev.yml
  • docusaurus.config.js
  • scripts/expand-redirect-from-variants.js

Comment thread .github/workflows/deploy-dev.yml Outdated
Comment on lines +87 to +95
- name: Create dot-path redirect stubs in S3
run: |
find ./build -mindepth 1 -type d | while IFS= read -r dir; do
name=$(basename "$dir")
if [[ "$name" == *.* ]]; then
rel="${dir#./build/}"
printf '<!DOCTYPE html><html><head><meta http-equiv="refresh" content="0;url=./%s/"><script>window.location.replace(location.pathname.replace(/\/?$/,"/")+location.search+location.hash)</script></head></html>' "$name" \
| aws s3 cp - "s3://${{ env.AWS_S3_BUCKET_NAME }}/docs/$rel" \
--content-type "text/html; charset=utf-8"
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 | 🔴 Critical

Don't round-trip these stub objects through a filesystem.

aws s3 sync at Line 85 already uploads docs/<rel>/index.html for dotted directories. This step adds a second S3 object at docs/<rel>, but the later Amplify redeploy step (Lines 101-111) syncs the bucket back to /tmp/full-site, where <rel> cannot be both a file and a directory. That will break or truncate the redeploy artifact for dotted release paths.

One workable fix

Build the Amplify zip directly from ./build and append the dotted-path stub entries to the zip archive itself (for example with Python's zipfile.writestr(...)) instead of syncing the bucket back to a local directory. ZIP archives can hold both foo and foo/index.html; a local filesystem cannot.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/deploy-dev.yml around lines 87 - 95, The current "Create
dot-path redirect stubs in S3" step uploads stub objects into the bucket which
later collides with the Amplify redeploy step that syncs the bucket back to a
local filesystem; instead of creating those stubs in S3 with the aws s3 cp loop,
build the Amplify deployment artifact directly from ./build and inject the
dotted-path stub entries into the ZIP (e.g., use a zip writer such as Python's
zipfile.writestr or equivalent) so the archive contains both "foo" and
"foo/index.html" without creating conflicting S3 objects; remove or disable the
existing stub-creation loop and update the workflow to produce the final zip
with appended stub entries before the Amplify deploy step.

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