Skip to content

Conversation

@MayankBansal12
Copy link
Member

@MayankBansal12 MayankBansal12 commented Jan 9, 2026

Date: 09-01-2026

Developer Name: @MayankBansal12


Issue Ticket Number

Description

  • Replace my site urls with updated migrated pages
  • Use environment based config for staging urls (in dev and staging) for navigation
    (Prod urls were being used for navigation before)

Documentation Updated?

  • Yes
  • No

Under Feature Flag

  • Yes
  • No

Database Changes

  • Yes
  • No

Breaking Changes

  • Yes
  • No

Development Tested?

  • Yes
  • No

Screenshots

demo
Screencast.from.2026-01-10.00-05-58.mp4

Test Coverage

coverage image

@vercel
Copy link

vercel bot commented Jan 9, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
status-app Error Error Jan 9, 2026 6:42pm

@coderabbitai
Copy link

coderabbitai bot commented Jan 9, 2026

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

Three test files add fake timers for deterministic time-based assertions. The URL constants file is refactored to support environment-aware prefixes for staging and production. The Dropdown component migrates from MY_SITE_URL to MAIN_SITE_URL. New URL constants for items, tags, levels, and tasks are introduced. Events URL changes from .../events.html to .../events.

Changes

Cohort / File(s) Summary
Test file timer fixes
__tests__/Unit/Components/ExtensionRequest/ExtensionStatusModal.test.tsx, __tests__/Unit/Components/Tasks/Card.test.tsx
Added jest.useFakeTimers() and jest.setSystemTime() calls to fix deterministic output in time-relative assertions (relative time formatting and "Started X years ago" text).
Test URL assertion update
__tests__/Unit/Components/Navbar/Navbar.test.tsx
Updated Events link href expectation from https://www.realdevsquad.com/events.html to https://www.realdevsquad.com/events (removed .html extension).
Component URL migration
src/components/Dropdown/Dropdown.tsx
Replaced MY_SITE_URL references with MAIN_SITE_URL across Status, Profile, and Identity links. Added direct Tasks link pointing to /tasks.
URL constants refactoring
src/constants/url.ts
Introduced envPrefix logic to support staging and production environment prefixes. Removed MY_SITE_URL. Refactored multiple URL constants (USER_PROFILE_URL, HOME_URL, WELCOME_URL, EVENTS_URL, CRYPTO_URL, STATUS_URL, MEMBERS_URL, SIGNUP_LINK, MAIN_SITE_URL, DASHBOARD_URL) to use environment-aware prefixes. Added new exports: ITEMS_URL, ALL_TAGS_URL, ALL_LEVELS_URL, TASKS_URL. Updated EVENTS_URL to remove .html extension and point to SIGNUP_LINK at new-signup endpoint.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 With timers set and URLs dressed in their staging attire,
Tests now tick steadily, never to retire.
MY_SITE_URL fades as MAIN takes its place,
Environment-aware links keep pace.
New constants bloom—ITEMS, TAGS, and TASKS shine bright!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically summarizes the main changes: replacing 'my site' URLs and implementing environment-based URL redirection for staging environments.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description check ✅ Passed The PR description clearly relates to the changeset, explaining the migration of URLs and environment-based configuration for staging navigation.

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


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.

@MayankBansal12 MayankBansal12 changed the title cfix: replace my site urls and use env based redirection fix: replace my site urls and use env based redirection Jan 9, 2026
Copy link

@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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
__tests__/Unit/Components/Tasks/Card.test.tsx (1)

539-555: Fix timer management conflict with suite-level fake timers.

This test calls jest.useFakeTimers() and jest.setSystemTime() within a specific test, then restores real timers with jest.useRealTimers() at line 554. However, the entire test suite already uses fake timers (set at line 76), and many other tests rely on jest.advanceTimersByTime() (e.g., lines 156, 172, 357, etc.). Restoring real timers here will break those tests if they run after this one.

🔧 Proposed fix

Since the suite-level fake timers are already active, only set the system time without redundantly calling useFakeTimers(), and remove the useRealTimers() call:

     it('renders "Started" with a specific date if status is not AVAILABLE', () => {
-        jest.useFakeTimers();
         jest.setSystemTime(new Date('2025-01-01T00:00:00Z'));
         const { getByTestId } = renderWithRouter(
             <Provider store={store()}>
                 <Card
                     content={CONTENT[2]}
                     shouldEdit={true}
                     onContentChange={jest.fn()}
                 />
             </Provider>,
             {}
         );
         const spanElement = screen.getByTestId('started-on');
         expect(spanElement).toHaveTextContent('Started 4 years ago'); // Mocked date from moment
-        jest.useRealTimers();
     });
🤖 Fix all issues with AI agents
In @src/constants/url.ts:
- Around line 5-6: The staging detection using
process.env.NEXT_PUBLIC_BASE_URL?.includes('staging') is too loose; replace it
with a precise check such as parsing NEXT_PUBLIC_BASE_URL hostname (or using a
regex that matches subdomain prefix like /^staging(\.|-)/) or, even better, rely
on an explicit env flag (e.g., process.env.NEXT_PUBLIC_ENV === 'staging');
update the isStaging variable to use that precise check and keep envPrefix =
isStaging ? 'staging-' : '' so downstream code uses the correct prefix.
📜 Review details

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 45c0ed5 and 5365901.

📒 Files selected for processing (5)
  • __tests__/Unit/Components/ExtensionRequest/ExtensionStatusModal.test.tsx
  • __tests__/Unit/Components/Navbar/Navbar.test.tsx
  • __tests__/Unit/Components/Tasks/Card.test.tsx
  • src/components/Dropdown/Dropdown.tsx
  • src/constants/url.ts
🧰 Additional context used
🧬 Code graph analysis (2)
__tests__/Unit/Components/ExtensionRequest/ExtensionStatusModal.test.tsx (1)
src/components/ExtensionRequest/ExtensionStatusModal.tsx (1)
  • formatToRelativeTime (24-27)
src/components/Dropdown/Dropdown.tsx (1)
src/constants/url.ts (1)
  • MAIN_SITE_URL (35-35)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build (18.x)
🔇 Additional comments (5)
__tests__/Unit/Components/ExtensionRequest/ExtensionStatusModal.test.tsx (1)

122-133: LGTM! Fake timers ensure deterministic time-based assertions.

The use of fake timers with a fixed system time ensures the formatToRelativeTime test produces consistent, predictable output. The cleanup with jest.useRealTimers() properly prevents timer leakage to other tests.

__tests__/Unit/Components/Navbar/Navbar.test.tsx (1)

90-93: LGTM! Events URL updated to match the new endpoint.

The test expectation correctly reflects the removal of the .html extension from the Events URL, aligning with the updated EVENTS_URL constant in src/constants/url.ts.

src/components/Dropdown/Dropdown.tsx (1)

1-52: LGTM! MY_SITE_URL successfully migrated to MAIN_SITE_URL.

All dropdown navigation links now use MAIN_SITE_URL, which supports environment-aware routing (staging vs. production). The migration is complete and consistent across all external links (Status, Profile, Identity), while the new Tasks link correctly uses an internal route.

src/constants/url.ts (2)

5-36: LGTM! Environment-aware URL configuration implemented correctly.

The refactoring successfully introduces environment-based URL configuration using envPrefix, enabling seamless navigation between staging and production environments. The removal of MY_SITE_URL and introduction of MAIN_SITE_URL with new API endpoint constants (ITEMS_URL, ALL_TAGS_URL, etc.) aligns well with the PR objectives.

Key improvements:

  • All user-facing URLs now support staging environment
  • New API endpoint constants follow consistent patterns
  • EVENTS_URL path updated from .../events.html to .../events

14-14: Verify GitHub OAuth app configuration for staging redirect URIs.

The STATUS_URL is correctly environment-aware and will resolve to https://staging-status.realdevsquad.com in staging and https://status.realdevsquad.com in production. However, verify that the GitHub OAuth application has been configured to accept the staging callback URL (https://staging-status.realdevsquad.com) in addition to the production URL. This requires checking the GitHub OAuth app settings, which is not visible in the frontend code.

Copy link
Member Author

@MayankBansal12 MayankBansal12 Jan 9, 2026

Choose a reason for hiding this comment

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

this change is done because with the year change, the test was expecting "4 years ago"...jest is used to freeze time for previous year

const spanElement = screen.getByTestId('started-on');
expect(spanElement).toHaveTextContent('Not started');
});

Copy link
Member Author

Choose a reason for hiding this comment

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

this change is done because with the year change expectation was being changed...jest is used to freeze time for previous year without updating test expectation

@iamitprakash iamitprakash merged commit d280775 into develop Jan 12, 2026
3 of 4 checks passed
@iamitprakash iamitprakash deleted the fix/replace-my-site branch January 12, 2026 12:37
@MayankBansal12 MayankBansal12 mentioned this pull request Jan 16, 2026
10 tasks
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.

4 participants