Add External Competitions feature - #2508
Open
ihsaan-ullah wants to merge 2 commits into
Open
Conversation
…Codabench/CodaLab instances New app — external_competitions - Models: ExternalPlatform (a registered remote instance), ExternalCompetition (a fetched competition), ExternalFetchLog (per-sync audit trail with SUCCESS/PARTIAL_SUCCESS/FAILURE status, counts, and error messages) - admin.py registrations for all three models with list filters/search - Initial migration Fetchers - fetchers/codabench_fetcher.py — paginated fetch from a Codabench instance's public competitions API, with a page-fetch throttle and a MAX_PAGES safety cap - fetchers/codalab_fetcher.py — flat-list fetch from a CodaLab instance - fetchers/exceptions.py — PartialFetchError, letting a fetcher hand back whatever it collected before a later page failed Sync task - fetch_sync.py — fetch_external_competitions Celery task (feature-flag gated, scheduled daily via CELERY_BEAT_SCHEDULE) and sync_platform, which diffs fetched data against the DB (create/update/delete), skipping the delete step on a partial fetch to avoid dropping valid competitions from unfetched pages API - api/serializers/external_competitions.py — ExternalCompetitionSerializer, ExternalPlatformFilterSerializer - api/views/external_competitions.py — list view with search/platform filtering, and an unpaginated platforms list for the filter UI - api/urls.py — both routes registered only when EXTERNAL_COMPETITIONS_ENABLED is on Frontend - external_competitions/urls.py + views.py + templates/external_competitions/public.html — the public page route - static/riot/external_competitions/external_competition_list.tag — the competition list/filter/pagination UI - client.js — API helpers for the two new endpoints - public-list.tag — banner linking to the External Competitions page (shown only when the feature is enabled) - base.html / context_processors.py — expose the feature flag and public URL to the frontend Settings - EXTERNAL_COMPETITIONS_ENABLED flag (settings/base.py, .env_sample), off by default - external_competitions added to INSTALLED_APPS Test data - factories.py — ExternalPlatformFactory, ExternalCompetitionFactory Tests - external_competitions/tests/test_fetchers.py — unit tests for both fetchers (pagination, throttling, MAX_PAGES, error propagation, partial-fetch handling) - external_competitions/tests/test_fetch_sync.py — unit tests for sync_platform/fetch_external_competitions (create/update/delete diffing, partial-success handling, per-platform failure isolation) - api/tests/test_external_competitions.py — API tests for both endpoints, plus flag-gated URL registration tests Documentation - New External-Competitions.md page: enabling the flag, admin fields, sync mechanics, and registration/unregistration instructions for other platform maintainers - zensical.toml nav entry - Tip added to the deploy guide pointing self-hosters at registering their instance
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.
Description
Screenshots
External competition banner in public benchmarks page

External competitions page

Checklist