Skip to content

694: Onboard GWC#737

Open
angelayu0530 wants to merge 5 commits intomainfrom
add-gwc
Open

694: Onboard GWC#737
angelayu0530 wants to merge 5 commits intomainfrom
add-gwc

Conversation

@angelayu0530
Copy link
Collaborator

@angelayu0530 angelayu0530 commented Feb 5, 2026

694

Description of changes

Checklist before review

  • I have done a thorough self-review of the PR
  • Copilot has reviewed my latest changes, and all comments have been fixed and/or closed.
  • If I have made database changes, I have made sure I followed all the db repo rules listed in the wiki here. (check if no db changes)
  • All tests have passed
  • I have successfully deployed this PR to staging
  • I have done manual QA in both dev (and staging if possible) and attached screenshots below.

Screenshots

Dev

Screenshot 2026-02-05 at 10 41 01 AM Screenshot 2026-02-05 at 10 44 04 AM Screenshot 2026-02-05 at 11 13 35 AM

Staging

Screenshot 2026-02-06 at 11 11 24 AM Screenshot 2026-02-06 at 11 12 09 AM Screenshot 2026-02-06 at 11 20 28 AM Screenshot 2026-02-06 at 11 21 23 AM

@angelayu0530
Copy link
Collaborator Author

/deploy

@github-actions
Copy link
Contributor

github-actions bot commented Feb 5, 2026

Available PR Commands

  • /ai - Triggers all AI review commands at once
  • /review - AI review of the PR changes
  • /describe - AI-powered description of the PR
  • /improve - AI-powered suggestions
  • /deploy - Deploy to staging

See: https://github.com/tahminator/codebloom/wiki/CI-Commands

@github-actions
Copy link
Contributor

github-actions bot commented Feb 5, 2026

Title

694: Onboard GWC


PR Type

Enhancement, Bug fix, Tests


Description

  • Onboard GWC-Hunter Discord club

  • Enable GWC leaderboard filtering

  • Fix MHC++ filter mapping

  • Update tests and client metadata


Diagram Walkthrough

flowchart LR
  tag["Tag enum: Gwc -> 'GWC-Hunter'"]
  filter["Leaderboard filters: add gwc, fix mhcplusplus"]
  migration["DB migration: insert GWC-Hunter + metadata"]
  script["Copy-prod-db: update GWC-Hunter metadata"]
  client["Client metadata: mark GWC non-school"]

  tag -- "used by" --> filter
  tag -- "referenced by" --> migration
  migration -- "IDs mirrored in" --> script
  tag -- "consumed by" --> client
Loading

File Walkthrough

Relevant files
Enhancement
Tag.java
Assign display name for GWC tag                                                   

src/main/java/org/patinanetwork/codebloom/common/db/models/usertag/Tag.java

  • Set Tag.Gwc display name to "GWC-Hunter".
+1/-1     
index.ts
Update client tag metadata for GWC                                             

js/src/lib/api/utils/metadata/tag/index.ts

  • Add Tag.Gwc to NON_SCHOOL_TAGS.
  • Keep Tag.Gwc in UNUSED_TAGS list.
+2/-1     
Bug fix
LeaderboardFilterGenerator.java
Add GWC filter and fix MHC++ mapping                                         

src/main/java/org/patinanetwork/codebloom/common/db/repos/leaderboard/options/LeaderboardFilterGenerator.java

  • Add gwc filter toggle mapped to Tag.Gwc.
  • Fix MHC++ mapping to opt.mhcplusplus(true).
+2/-1     
Tests
LeaderboardFilterGeneratorTest.java
Extend leaderboard tag tests with GWC                                       

src/test/java/org/patinanetwork/codebloom/common/db/repos/leaderboard/options/LeaderboardFilterGeneratorTest.java

  • Include Tag.Gwc in VALID_LEADERBOARD_TAGS.
  • Add Tag.Gwc to ALL_LEADERBOARD_TAGS.
+2/-1     
Configuration changes
index.ts
Seed GWC-Hunter metadata in copy-db script                             

.github/scripts/copy-prod-db/index.ts

  • Update DiscordClubMetadata for "GWC-Hunter".
  • Set guildId and leaderboardChannelId values.
+10/-1   
V0072__Add_gwc_hunter_to_discord_club.SQL
Migration to onboard GWC-Hunter club                                         

db/migration/V0072__Add_gwc_hunter_to_discord_club.SQL

  • Insert DiscordClub "GWC-Hunter" with tag Gwc.
  • Insert DiscordClubMetadata for prod and non-prod IDs.
+46/-0   

@github-actions
Copy link
Contributor

github-actions bot commented Feb 5, 2026

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 PR contains tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Possible Issue

NON_SCHOOL_TAGS includes Tag.MHCPlusPlus and Tag.Gwc twice (via the UNUSED_TAGS spread and explicit additions), which can lead to duplicated entries in consumers of this list. De-duplicate or use a Set-like construction.

export const UNUSED_TAGS: Tag[] = [Tag.MHCPlusPlus, Tag.Gwc];
export const NON_SCHOOL_TAGS: Tag[] = [
  ...UNUSED_TAGS,
  Tag.Patina,
  Tag.MHCPlusPlus,
  Tag.Gwc,
];
Missing Metadata

TAG_METADATA_LIST does not define metadata for Tag.Gwc. Any UI/logic expecting metadata for enabled tags may break or render incorrectly. Add a GWC metadata entry (name/icon/apiKey/alt) similar to MHC++ or ensure it remains fully unused on the frontend.

    shortName: "MHC++",
    name: "The MHC++ Club | Macaulay Hunter College",
    apiKey: "mhcplusplus",
    icon: "/brands/Mhcpp_logo.png",
    alt: "MHC++ Logo",
  },
} as const;
Migration Safety

The migration unconditionally inserts into DiscordClub and DiscordClubMetadata without ON CONFLICT/WHERE NOT EXISTS. If rows already exist or this migration is re-run, it can fail or create duplicates. Make it idempotent and verify the 'codebloom-prod' name matches production; consider a rollback strategy if required.

INSERT INTO "DiscordClub"
    (id, name, description, tag)
VALUES
    (gen_random_uuid(), 'GWC-Hunter', NULL, 'Gwc');


DO $$
BEGIN
    CASE current_database()
        WHEN 'codebloom-prod' THEN
            WITH CLUB AS (
                SELECT
                    *
                FROM
                    "DiscordClub"
                WHERE
                    name = 'GWC-Hunter'
            )
            INSERT INTO "DiscordClubMetadata"
                (id, "guildId", "leaderboardChannelId", "discordClubId")
            SELECT
                gen_random_uuid(),
                '1066177903345278986',
                '1468417251274129452',
                CLUB.id
            FROM CLUB;

        ELSE
            WITH CLUB AS (
                SELECT
                    *
                FROM
                    "DiscordClub"
                WHERE
                    name = 'GWC-Hunter'
            )
            INSERT INTO "DiscordClubMetadata"
                (id, "guildId", "leaderboardChannelId", "discordClubId")
            SELECT
                gen_random_uuid(),
                '1389762654452580373',
                '1463703700697518113',
                CLUB.id
            FROM CLUB;
    END CASE;
END $$;

@angelayu0530
Copy link
Collaborator Author

/deploy

@angelayu0530 angelayu0530 force-pushed the add-gwc branch 5 times, most recently from 013c6d9 to fbc81a2 Compare February 6, 2026 04:42
@angelayu0530
Copy link
Collaborator Author

/deploy

@angelayu0530
Copy link
Collaborator Author

/deploy

@angelayu0530 angelayu0530 force-pushed the add-gwc branch 2 times, most recently from b627293 to 41990c5 Compare February 6, 2026 15:11
@angelayu0530
Copy link
Collaborator Author

/deploy

@angelayu0530
Copy link
Collaborator Author

/deploy

@tahminator
Copy link
Owner

/copy

@github-actions
Copy link
Contributor

github-actions bot commented Feb 6, 2026

Database copy command completed successfully!

@angelayu0530
Copy link
Collaborator Author

/deploy

@angelayu0530
Copy link
Collaborator Author

/deploy

@tahminator
Copy link
Owner

/copy

@github-actions
Copy link
Contributor

github-actions bot commented Feb 6, 2026

Database copy command failed!

fixes

syntax error
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