Define challenge forum discussion on create (opportunities app forums) - #161
Merged
Merged
Conversation
… app forums Challenge forums now live in the opportunities app, so the discussion is fully defined when a challenge is created instead of being filled in by the retired challenge-forum-processor: provider "topcoder", the challenge name and a URL to the challenge's forum tab (<OPPORTUNITIES_CHALLENGE_URL>/<challengeId>?tab=forum). The challenge id is generated up front so the URL is known before the record is written, and the challenge.notification.create bus event carries the completed discussion. Adds the OPPORTUNITIES_CHALLENGE_URL config value, documents it, and covers the created discussion and bus payload in the challenge service unit tests. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Challenge forums are moving to the new forums implementation in the opportunities app, and the
challenge-forum-processorflow (create a Vanilla forum, then write the URL back intodiscussions[].url) is being fully deprecated.With this change the API defines the
discussionsobject itself when a challenge is created:provider:topcoder(wasvanilla)type:CHALLENGEname: the challenge name, truncated toFORUM_TITLE_LENGTH_LIMITurl:<OPPORTUNITIES_CHALLENGE_URL>/<challengeId>?tab=forum, e.g.https://www.topcoder.com/opportunities/challenge/6a5da7b6-3841-43cb-ae9d-98416bea0d9d?tab=forumThe challenge id is generated up front so the URL is known before the record is written. The
challenge.notification.createbus event is still raised and now carries the completed discussion, so nothing downstream needs to fill it in. Anydiscussionssupplied by the caller on create are replaced by the API-defined one (the create request schema still accepts them for backward compatibility).Config
New
OPPORTUNITIES_CHALLENGE_URL(documented in the README). It follows the repo convention of defaulting to the dev host (https://www.topcoder-dev.com/opportunities/challenge), so production needs:Not changed
src/scripts/seed/Challenge.jsonstill contains Vanilla discussion fixtures.Testing
pnpm lintandtsc -p tsconfig.build.json --noEmitpass.ChallengeDiscussionrow, and thechallenge.notification.createbus payload all carry thetopcoderprovider and the?tab=forumURL. Run against a local Postgres: it passes, and the remaining create-challenge failures in that file are identical ondevelop(fixture uses lowercasetype: "challenge", plus unconfigured external service URLs).🤖 Generated with Claude Code