Skip to content

Add run dedupe key and idempotent create flow - #6861

Merged
suhaibmujahid merged 6 commits into
mozilla:masterfrom
suhaibmujahid:dedup-key
Sep 17, 2026
Merged

suhaibmujahid merged 6 commits into
mozilla:masterfrom
suhaibmujahid:dedup-key

Conversation

@suhaibmujahid

Copy link
Copy Markdown
Member

Resolves #6279

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Production triggers remain unkeyed, and permanent uniqueness conflicts with the requirement to deduplicate only currently running jobs.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Adds API-level run deduplication using caller-provided keys.

Changes:

  • Adds dedupe-key persistence, validation, filtering, and collision handling.
  • Exposes deduplication through the client and UI types.
  • Adds supporting tests and documentation.
File summaries
File Description
services/hackbot-ui/lib/types.ts Adds dedupe keys to UI run documents.
services/hackbot-api/tests/test_finalize_run.py Updates no-execution finalization coverage.
services/hackbot-api/tests/test_create_run_api.py Tests keyed creation and collisions.
services/hackbot-api/tests/conftest.py Adds reusable API test fixtures.
services/hackbot-api/app/schemas.py Exposes dedupe keys in API schemas.
services/hackbot-api/app/routers/runs.py Implements validation, claiming, and filtering.
services/hackbot-api/app/database/models.py Adds the dedupe column and unique index.
services/hackbot-api/alembic/versions/a7d4e9c21b83_runs_dedupe_key.py Migrates the database schema.
libs/hackbot-client/hackbot_client/client.py Supports sending dedupe keys.
docs/hackbot/api.md Documents deduplication behavior.
Review details
  • Files reviewed: 10/10 changed files
  • Comments generated: 4
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread services/hackbot-api/app/routers/runs.py
Comment thread libs/hackbot-client/hackbot_client/client.py
Comment thread services/hackbot-api/app/routers/runs.py
@suhaibmujahid
suhaibmujahid marked this pull request as draft September 16, 2026 15:27
@suhaibmujahid
suhaibmujahid marked this pull request as ready for review September 16, 2026 16:48
Comment thread services/hackbot-api/app/routers/runs.py Outdated
Comment thread services/hackbot-api/app/routers/runs.py Outdated
@suhaibmujahid
suhaibmujahid merged commit d1f3e95 into mozilla:master Sep 17, 2026
8 checks passed
@suhaibmujahid
suhaibmujahid deleted the dedup-key branch September 17, 2026 04:01
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.

Hackbot job deduplication

3 participants