Skip to content

feat(research): short, human-readable experiment ids (EXP-XXXXXXXX)#694

Merged
yasithdev merged 1 commit into
apache:masterfrom
yasithdev:feat-short-experiment-id
Jun 15, 2026
Merged

feat(research): short, human-readable experiment ids (EXP-XXXXXXXX)#694
yasithdev merged 1 commit into
apache:masterfrom
yasithdev:feat-short-experiment-id

Conversation

@yasithdev

Copy link
Copy Markdown
Contributor

Summary

Experiment ids were generated as sanitize(name)[:50] + "_" + UUID — e.g. Echo_on_Jun_14,_2026_9:36_PM_96aa3cbd-6ff9-4664-970e-30a803e03a6c — mashing the experiment name and a uuid into the primary key, which is also the portal's URL identifier.

This generates a short, URL-safe, collision-checked code instead (e.g. EXP-7QK2F9MX) and keeps the human name in the separate experiment_name field.

Changes

  • AiravataUtils.getReadableId(prefix)<prefix>-XXXXXXXX from an unambiguous Crockford-style alphabet (no 0/1/I/L/O).
  • ExperimentRepository.addExperiment() — mint EXP-… and regenerate on the (vanishingly rare) collision via the existing isExperimentExist(). experiment_name is untouched.
  • experiment_id stays a varchar(255) PK, so existing ids and all FK references (PROCESS/EXPERIMENT_STATUS/EXPERIMENT_ERROR) keep working. Only new experiments are affected.
  • Two tests that asserted the id embeds the normalized name now assert the new contract: a short EXP- code, with the experiment name preserved verbatim (it was previously mangled into the id).

AiravataUtils.getId() is unchanged (projects/applications/tasks/processes still use it; they aren't URL-facing).

Why it's safe

A cross-repo sweep found no code that parses the name/uuid out of experiment_id. The Django portal needs no change — it already routes by experiment_id ([^/]+), and EXP-7QK2F9MX is URL-safe.

Test plan

  • Verified live: creating + launching an Echo experiment yields /workspace/experiments/EXP-7TF68CM7/, with the name preserved as "Echo on Jun 15, 2026 12:18 AM", status LAUNCHED.
  • Updated unit + integration tests assert the new id format and name preservation.

🤖 Generated with Claude Code

Experiment ids were sanitize(name)[:50] + "_" + UUID, e.g.
Echo_on_Jun_14,_2026_9:36_PM_96aa3cbd-..., which mashed the name and a uuid into
the primary key and the portal URL. Generate a short, URL-safe, collision-checked
code instead (e.g. EXP-7QK2F9MX) via AiravataUtils.getReadableId, keeping the name
as the separate experiment_name field. Only new experiments are affected; the id
stays a varchar PK so existing ids and all FK references keep working. The portal
already routes by experiment_id, so URLs become /workspace/experiments/EXP-7QK2F9MX/
with no portal change.

The two tests that asserted the id embeds the normalized name now assert the new
contract: a short EXP- code, with the experiment name preserved verbatim.
@yasithdev yasithdev merged commit 6edb39c into apache:master Jun 15, 2026
6 of 7 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