Skip to content

feat: add external submissions onboarding CLI#217

Open
RaidedCluster wants to merge 1 commit into
forecastingresearch:mainfrom
RaidedCluster:johan/external-submissions-v3
Open

feat: add external submissions onboarding CLI#217
RaidedCluster wants to merge 1 commit into
forecastingresearch:mainfrom
RaidedCluster:johan/external-submissions-v3

Conversation

@RaidedCluster

Copy link
Copy Markdown
Collaborator

No description provided.

return re.sub(r"^anonymous #(\d+)$", r"anonymous \1", normalized)


def get_next_forecast_due_date(today: Optional[date] = None) -> str:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move this to src/helpers/question_curation.py

r"""Admin CLI to manage external submission teams.

Run locally by an admin with gcloud application-default credentials; not deployed. See
`src/external-submissions/DESIGN.md` for the architecture and the requirements this implements.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the comment is not correct, e.g. no file named src/external-submissions/DESIGN.md

subject = "ForecastBench — your team has been registered"
anonymous_note = (
f"\nYou are registered anonymously. Your public name is '{organization}': use it for"
" both 'organization' and 'model_organization' in your forecast files.\n"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just for 'organization'. They can choose whether or not to use it for 'model_organization'

{next_due_date}.{organization}.1.json
4. Upload it with either command before 23:59:59 UTC on the forecast due date:
gsutil cp your-file.json gs://{bucket}/{team_id}/
gcloud storage cp your-file.json gs://{bucket}/{team_id}/

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delete 1-4 above. Let's just leave the link to the wiki, that way if anything changes we only change it there

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove "You may submit up to 3 forecast sets per round (one per model). "

register_parser.add_argument("--service-accounts", nargs="*", default=[])
register_parser.add_argument("--anonymous", action="store_true")

remove_parser = subparsers.add_parser("remove", help="Deactivate a team.")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perhaps call this deactivate instead of remove

remove_parser = subparsers.add_parser("remove", help="Deactivate a team.")
remove_parser.add_argument("--team-id", required=True)

init_parser = subparsers.add_parser("init-counters", help="One-time counter setup.")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is run once, then 2 months later run again, will that break things? If so, then remove it as an option and move the initialization to a setup script that will only be run once

Comment thread src/helpers/env.py Outdated
RUNNING_LOCALLY = bool(int(os.environ.get("RUNNING_LOCALLY", False)))
BUCKET_MOUNT_POINT = os.environ.get("BUCKET_MOUNT_POINT", "")
WORKSPACE_BUCKET = os.environ.get("WORKSPACE_BUCKET")
BUILD_ENV = os.environ.get("BUILD_ENV", "dev")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's remove this. Prefer RunMode.

The rule is that BUILD_ENV is used to choose the deployment environment (e.g., the website builds the dev version or the prod version). RunMode controls Python behavior.

register_parser.add_argument("--emails", nargs="*", default=[])
register_parser.add_argument("--service-accounts", nargs="*", default=[])
register_parser.add_argument("--anonymous", action="store_true")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Following the BUILD_ENV change above, please add this functionality to the CLI:

  • --mode TEST: do not attempt SMTP, return welcome_email_sent: false, and add a warning like "Welcome email skipped in TEST mode. email would have been sent to <<email address(es)>>. pass --send-email-in-test to send a rerouted test email."
  • --mode TEST --send-email-in-test: email is sent with [TEST] prefix in subject
  • --mode PROD: Email is sent normally without [TEST] prefix. --send-email-in-test has no effect.

We'll have a dev version of the firebase in the dev enivonnment that will have our email addresses in it.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if --mode is not passed, default to TEST

@:

clean:
rm -rf __pycache__

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a file called onboard.example.sh that looks likething like:

EMAILS=[]
ORGANIZATION=""
...
python main.py --emails=$EMAILS --organization=$ORGANIZATION --run-mode=TEST ...

add onboard.sh to .gitignore

Then we'll run from the script such that fields are easier to modify and commands don't stay in local history (so aren't unintentionally run).

Comment thread src/tests/test_email.py Outdated
def test_returns_false_without_password(self, monkeypatch):
monkeypatch.setattr(env, "SMTP_USER", "sender@example.org")
monkeypatch.delenv("SMTP_PASSWORD", raising=False)
assert email.send_email(["a@x.com"], "subject", "body") is False

@houtanb houtanb Jun 11, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prefer a different domain than x.com since it actually means something. just a random hash will do: dummy-domain-x92ah8.com.

@RaidedCluster RaidedCluster force-pushed the johan/external-submissions-v3 branch from 550bcdb to 3c1ad45 Compare June 11, 2026 18:49
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