Skip to content

feat(platform): mctf platform configure — event start/end + ctf_description - #64

Merged
ademboukabes merged 3 commits into
developfrom
feat/platform-configure-event-metadata
Oct 13, 2026
Merged

ademboukabes merged 3 commits into
developfrom
feat/platform-configure-event-metadata

Conversation

@ademboukabes

Copy link
Copy Markdown
Collaborator

Summary

Extends event configuration and mctf platform configure to synchronize competition start/end timestamps and description to CTFd global configurations, resolving #49.

Changes

  • Schema & Model (schema/mctf-config.schema.json, internal/config):
    • Added event.description (string), event.start_at (RFC3339 date-time format), and event.end_at (RFC3339 date-time format) to schema v1.
    • Synchronized embedded schemas via make schemas.
    • Added typed fields Description, StartAt, and EndAt to config.Event.
    • Added unit tests in internal/config/config_test.go covering metadata loading and schema rejection of invalid timestamps.
  • CTFd Client (internal/platform/ctfd):
    • Introduced EventConfig struct and Configure(ctx context.Context, cfg EventConfig) error method on Client.
    • Sequentially patches /api/v1/configs/ctf_name, ctf_description, start, and end for non-empty fields with contextual error reporting.
    • Added unit tests in internal/platform/ctfd/client_test.go covering full and partial configuration payloads and error propagation.
  • CLI Command (cmd/platform.go):
    • Updated mctf platform configure to display all planned fields under --dry-run.
    • Added logical date validation ensuring start_at is strictly before end_at when both are supplied.
    • Delegated synchronization to client.Configure.
    • Added unit tests in cmd/platform_configure_test.go.
  • Documentation & Sample Event:
    • Updated command summary in docs/commands.md.
    • Showcased metadata fields in examples/sample-event/mctf.config.yml.
    • Marked feature as shipped in docs/BACKLOG.md.
    • Documented changes in docs/spec/CHANGELOG.md.

Verification

  • make schemas: Embedded schemas in sync with 0 drift.
  • make lint: Clean (0 issues).
  • go test -race ./...: All unit and integration tests pass.
  • ./mctf -C examples/sample-event validate: OK.
  • ./mctf -C examples/sample-event generate --check: In sync.
  • End-to-end functional test against local mock CTFd verifying --dry-run, live PATCH requests, date ordering rejection, and JSON Schema enforcement.

Closes #49

… and config model

Extend event configuration in schema/mctf-config.schema.json with optional description, start_at (RFC3339), and end_at (RFC3339) properties. Synchronize embedded schemas via make schemas, add corresponding fields to config.Event, and add unit tests validating loading and schema rejection of invalid date-time strings.
…configure command

Add EventConfig DTO and Configure method to the CTFd client to patch ctf_name, ctf_description, start, and end configs sequentially. Update mctf platform configure to display all planned fields in dry-run, validate that start_at is strictly before end_at when both are provided, and dispatch Configure to sync the platform state.
…atform configure

Document ctf_description, start, and end synchronisation in docs/commands.md. Showcase description, start_at, and end_at in examples/sample-event/mctf.config.yml. Mark platform configure extensions as shipped in docs/BACKLOG.md and document the feature in docs/spec/CHANGELOG.md.
@ademboukabes
ademboukabes merged commit 24f342e into develop Oct 13, 2026
3 checks passed
@ademboukabes
ademboukabes deleted the feat/platform-configure-event-metadata branch October 13, 2026 19:50
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