Skip to content

Conversation

tejaskh3
Copy link
Contributor

@tejaskh3 tejaskh3 commented May 26, 2025

Date: 26 may, 2025

Developer Name: @tejaskh3


Issue Ticket Number

closes #310

Description

  • In this PR, we are adding a dev flag for the verify command
  • it should give us the link for the old site(my-site) when the dev flag is false and the link to the new site(true) for verification when the dev flag is true
  • added test cases for the same

Documentation Updated?

NA

Under Feature Flag

  • Yes
  • No

Database Changes

  • Yes
  • No

Breaking Changes

  • Yes
  • No

Development Tested?

  • Yes
  • No

Screenshots

testing video on new site vs old both are same

Screen.Recording.2025-05-26.at.10.11.06.AM.1.1.mov
image

new screenshot
after updation
image

Copy link

coderabbitai bot commented May 26, 2025

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.

Summary by CodeRabbit

  • New Features
    • Added support for a new optional "dev" flag to the VERIFY command, allowing users to verify from the main site.
    • Introduced new environment-specific main site URLs for production, staging, and development.
  • Enhancements
    • Verification messages now conditionally use different URLs based on the "dev" flag.
  • Chores
    • Minor updates to internal workflow configuration (no user impact).

Walkthrough

This update introduces a new MAIN_SITE_URL configuration for all environments, adds corresponding URL constants, and extends the /verify command with an optional boolean dev flag. The verification logic now conditionally uses the main site URL when the dev flag is set. Minor formatting adjustments are made in GitHub workflow files.

Changes

File(s) Change Summary
.github/workflows/register-commands-production.yaml
.github/workflows/register-commands-staging.yaml
Changed wranglerVersion value from single to double quotes.
src/constants/urls.ts Added RDS_MAIN_SITE_URL, RDS_STAGING_MAIN_SITE_URL, and RDS_DEVELOPMENT_MAIN_SITE_URL constants.
config/config.ts Added MAIN_SITE_URL to environment configs using new URL constants.
src/constants/commands.ts Added optional boolean dev option to VERIFY command.
src/controllers/baseHandler.ts Extracted and passed dev flag to verifyCommand for the VERIFY command.
src/controllers/verifyCommand.ts Updated function signature to accept optional dev parameter; logic now uses MAIN_SITE_URL if set.
src/typeDefinitions/default.types.d.ts Added MAIN_SITE_URL property to variables interface.
src/typeDefinitions/verify.types.ts Introduced new type alias DevFlag.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant DiscordBot
    participant verifyCommand
    participant Config

    User->>DiscordBot: Issues /verify command (with optional dev flag)
    DiscordBot->>verifyCommand: Calls verifyCommand(..., dev?)
    verifyCommand->>Config: Gets MAIN_SITE_URL based on env
    alt dev flag is true
        verifyCommand->>User: Responds with MAIN_SITE_URL + dev=true
    else dev flag is false or absent
        verifyCommand->>User: Responds with VERIFICATION_SITE_URL
    end
Loading

Possibly related PRs

  • Real-Dev-Squad/discord-slash-commands#303: Updates the cloudflare/wrangler-action version in the production workflow, modifying the same workflow file as in this PR but for a different configuration aspect.

Poem

A bunny hops with URLs anew,
A dev flag now for you to view!
Main site links in configs dwell,
And workflows quote their version well.
With every verify, we leap ahead—
🐇 Onward, where the carrots are spread!


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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@tejaskh3 tejaskh3 self-assigned this May 26, 2025
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: 5

🔭 Outside diff range comments (1)
src/controllers/baseHandler.ts (1)

46-46: ⚠️ Potential issue

Fix the import path for DevFlag.

The import statement shows DevFlag being imported from "../typeDefinitions/filterUsersByRole", but according to the relevant code snippets and other files in this PR, it should be imported from "../typeDefinitions/verify.types".

-import { DevFlag } from "../typeDefinitions/filterUsersByRole";
+import { DevFlag } from "../typeDefinitions/verify.types";
📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1f352b4 and 0363e9f.

📒 Files selected for processing (9)
  • .github/workflows/register-commands-production.yaml (1 hunks)
  • .github/workflows/register-commands-staging.yaml (1 hunks)
  • config/config.ts (4 hunks)
  • src/constants/commands.ts (1 hunks)
  • src/constants/urls.ts (1 hunks)
  • src/controllers/baseHandler.ts (1 hunks)
  • src/controllers/verifyCommand.ts (2 hunks)
  • src/typeDefinitions/default.types.d.ts (1 hunks)
  • src/typeDefinitions/verify.types.ts (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (3)
src/controllers/baseHandler.ts (3)
src/typeDefinitions/discordMessage.types.d.ts (1)
  • messageRequestDataOptions (66-71)
src/typeDefinitions/verify.types.ts (1)
  • DevFlag (1-5)
src/controllers/verifyCommand.ts (1)
  • verifyCommand (13-47)
config/config.ts (1)
src/constants/urls.ts (3)
  • RDS_MAIN_SITE_URL (31-31)
  • RDS_STAGING_MAIN_SITE_URL (32-32)
  • RDS_DEVELOPMENT_MAIN_SITE_URL (33-33)
src/controllers/verifyCommand.ts (3)
src/typeDefinitions/default.types.d.ts (1)
  • env (1-3)
src/typeDefinitions/verify.types.ts (1)
  • DevFlag (1-5)
src/constants/responses.ts (2)
  • VERIFICATION_STRING (37-38)
  • VERIFICATION_SUBSTRING (40-41)
🔇 Additional comments (7)
.github/workflows/register-commands-staging.yaml (1)

57-57: Standardize YAML quoting for wranglerVersion
Changed the wranglerVersion value from single quotes to double quotes to match the production workflow and ensure consistent YAML style.

.github/workflows/register-commands-production.yaml (1)

57-57: Ensure consistent quoting style
Updated wranglerVersion to use double quotes for consistency with the staging workflow and YAML conventions.

src/typeDefinitions/default.types.d.ts (1)

16-16: LGTM!

The MAIN_SITE_URL property addition is consistent with the existing interface structure and properly typed as a string.

config/config.ts (2)

16-18: LGTM! Clean import of main site URL constants.

The imports follow the established pattern and include all necessary environment-specific URLs.


80-80: LGTM! Consistent addition of MAIN_SITE_URL across environments.

The MAIN_SITE_URL property is correctly added to all three environment configurations (production, staging, default) with their respective URL constants.

Also applies to: 89-89, 99-99

src/controllers/verifyCommand.ts (2)

11-11: LGTM! Correct import of DevFlag type.

The import follows the proper path structure for the DevFlag type definition.


19-21: LGTM! Function signature properly updated.

The optional dev parameter is correctly added to support the new feature flag functionality.

@tejaskh3 tejaskh3 force-pushed the feat-feature-flag-for-verify-command branch from f158da0 to d1d97d0 Compare May 26, 2025 05:33
@tejaskh3 tejaskh3 force-pushed the feat-feature-flag-for-verify-command branch from 1db11ae to 30e42e8 Compare May 26, 2025 19:22
@tejaskh3 tejaskh3 requested a review from pankajjs May 26, 2025 19:39
@tejaskh3 tejaskh3 force-pushed the feat-feature-flag-for-verify-command branch 2 times, most recently from 3cc98a0 to d1d97d0 Compare May 26, 2025 20:36
@iamitprakash iamitprakash merged commit 58e74b3 into develop May 26, 2025
3 checks passed
@iamitprakash iamitprakash deleted the feat-feature-flag-for-verify-command branch May 26, 2025 21:05
@tejaskh3 tejaskh3 mentioned this pull request May 26, 2025
10 tasks
iamitprakash added a commit that referenced this pull request May 27, 2025
* feat: add feature flag on verify command

* feat: add test cases

* fix: comments

* revert: yml file changes

Co-authored-by: Amit Prakash <[email protected]>
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.

[My Site Migration]feat: add feature flag on verify command
3 participants