Skip to content

Define challenge forum discussion on create (opportunities app forums) - #161

Merged
jmgasper merged 1 commit into
developfrom
new-forums
Sep 18, 2026
Merged

jmgasper merged 1 commit into
developfrom
new-forums

Conversation

@jmgasper

Copy link
Copy Markdown
Contributor

Summary

Challenge forums are moving to the new forums implementation in the opportunities app, and the challenge-forum-processor flow (create a Vanilla forum, then write the URL back into discussions[].url) is being fully deprecated.

With this change the API defines the discussions object itself when a challenge is created:

  • provider: topcoder (was vanilla)
  • type: CHALLENGE
  • name: the challenge name, truncated to FORUM_TITLE_LENGTH_LIMIT
  • url: <OPPORTUNITIES_CHALLENGE_URL>/<challengeId>?tab=forum, e.g. https://www.topcoder.com/opportunities/challenge/6a5da7b6-3841-43cb-ae9d-98416bea0d9d?tab=forum

The challenge id is generated up front so the URL is known before the record is written. The challenge.notification.create bus event is still raised and now carries the completed discussion, so nothing downstream needs to fill it in. Any discussions supplied 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:

OPPORTUNITIES_CHALLENGE_URL=https://www.topcoder.com/opportunities/challenge

Not changed

  • The update flow's "only M2M can change discussion url/options" rule is untouched.
  • src/scripts/seed/Challenge.json still contains Vanilla discussion fixtures.

Testing

  • pnpm lint and tsc -p tsconfig.build.json --noEmit pass.
  • Added a unit test that creates a challenge and asserts the returned discussion, the persisted ChallengeDiscussion row, and the challenge.notification.create bus payload all carry the topcoder provider and the ?tab=forum URL. Run against a local Postgres: it passes, and the remaining create-challenge failures in that file are identical on develop (fixture uses lowercase type: "challenge", plus unconfigured external service URLs).

🤖 Generated with Claude Code

… 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>
@jmgasper
jmgasper merged commit 06ca2b6 into develop Sep 18, 2026
5 checks passed
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