Skip to content

chore: remove dead code (hydra)#4062

Merged
Flo4604 merged 4 commits intomainfrom
10-03-chore_remove_dead_code_hydra_
Oct 6, 2025
Merged

chore: remove dead code (hydra)#4062
Flo4604 merged 4 commits intomainfrom
10-03-chore_remove_dead_code_hydra_

Conversation

@chronark
Copy link
Collaborator

@chronark chronark commented Oct 3, 2025

What does this PR do?

we're not using this anymore

Fixes # (issue)

If there is not an issue for this, please create one first. This is used to tracking purposes and also helps use understand why this PR exists

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • Chore (refactoring code, technical debt, workflow improvements)
  • Enhancement (small improvements)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How should this be tested?

  • Test A
  • Test B

Checklist

Required

  • Filled out the "How to test" section in this PR
  • Read Contributing Guide
  • Self-reviewed my own code
  • Commented on my code in hard-to-understand areas
  • Ran pnpm build
  • Ran pnpm fmt
  • Checked for warnings, there are none
  • Removed all console.logs
  • Merged the latest changes from main onto my branch with git pull origin main
  • My changes don't cause any responsiveness issues

Appreciated

  • If a UI change was made: Added a screen recording or screenshots to this PR
  • Updated the Unkey Docs if changes were necessary

@changeset-bot
Copy link

changeset-bot bot commented Oct 3, 2025

⚠️ No Changeset found

Latest commit: c949ddf

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link

vercel bot commented Oct 3, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
dashboard Ignored Ignored Preview Oct 6, 2025 7:40am
engineering Ignored Ignored Preview Oct 6, 2025 7:40am

Copy link
Collaborator Author

chronark commented Oct 3, 2025

This stack of pull requests is managed by Graphite. Learn more about stacking.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 3, 2025

📝 Walkthrough

Walkthrough

This PR removes the entire Hydra workflow system (engine, worker, steps, sleep, cron, marshalling, metrics, store/SQLC, tests, docs) and related initialization from deployment. It also updates infra/docs to reflect the absence of Hydra, including Docker setup and database schema docs. One CLI doc file receives formatting-only tweaks.

Changes

Cohort / File(s) Summary
Docs formatting (CLI)
apps/engineering/content/docs/cli/run/ctrl/index.mdx
Formatting-only MDX adjustments; no semantic changes.
Infra and schema docs
apps/engineering/content/docs/infrastructure/database-schema.mdx
Removes Hydra mention; adds file structure and init order examples.
Deployment init and config
deployment/Dockerfile.mysql, deployment/docker-compose.yaml, deployment/init-databases.sql
Drops Hydra schema copy, removes UNKEY_DATABASE_HYDRA env, and stops creating/granting the hydra DB.
Hydra package: core runtime removed
go/pkg/hydra/engine.go, go/pkg/hydra/worker.go, go/pkg/hydra/workflow.go, go/pkg/hydra/step.go, go/pkg/hydra/sleep.go, go/pkg/hydra/cron.go, go/pkg/hydra/marshaller.go
Deletes engine, worker, workflow APIs, step/sleep execution, cron, and marshalling.
Hydra store (SQLC) removed
go/pkg/hydra/store/db.go, .../querier.go, .../models.go, .../workflows.sql.go, .../queries/workflows.sql, .../schema.sql, .../sqlc.json, .../generate.go, .../queries/*
Removes store models, interfaces, generated queries, SQL schema and config.
Hydra metrics removed
go/pkg/hydra/metrics/metrics.go, go/pkg/hydra/metrics/example_usage.go
Deletes all Prometheus metrics and examples.
Hydra tests and harness removed
go/pkg/hydra/*_test.go, go/pkg/hydra/test_helpers.go, go/pkg/hydra/testharness/events.go
Removes all tests (engine, steps, consistency, polling, heartbeats, performance) and test utilities/event collector.
Hydra docs removed
go/pkg/hydra/README.md, go/pkg/hydra/doc.go
Deletes Hydra package README and package docs.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Client
  participant Engine
  participant DB
  participant Worker
  participant Cron

  rect rgb(230,245,255)
  note over Engine,Worker: Before (Hydra present)
  Client->>Engine: StartWorkflow(payload)
  Engine->>DB: Insert workflow + payload
  Worker->>DB: Poll pending workflows
  Worker->>DB: Acquire lease
  Worker->>Worker: Execute steps (idempotent)
  Worker->>DB: Update step/workflow state
  Cron->>DB: List due cron jobs
  Cron->>Engine: Trigger StartWorkflow
  end

  rect rgb(255,235,230)
  note over Client,DB: After (Hydra removed)
  Client--X Engine: (API removed)
  Worker--X DB: (Polling/leases removed)
  Cron--X Engine: (Cron registration removed)
  end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Suggested reviewers

  • mcstepp
  • perkinsjr
  • MichaelUnkey

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The description uses the template headings but provides only a one-line justification without any detailed summary of changes, no specific issue linkage, and placeholder sections for testing and checkboxes that remain unfilled, leaving critical required information missing. Please expand the description to include a clear summary of what dead code is removed and why, fill in the issue number in “Fixes #”, select the appropriate change type, and provide concrete testing instructions and completed checklist items.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The title accurately and concisely describes the primary change of removing unused Hydra code, matching the main intent and scope of the PR.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch 10-03-chore_remove_dead_code_hydra_

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 441fb9b and c949ddf.

📒 Files selected for processing (40)
  • apps/engineering/content/docs/cli/run/ctrl/index.mdx (11 hunks)
  • apps/engineering/content/docs/infrastructure/database-schema.mdx (1 hunks)
  • deployment/Dockerfile.mysql (0 hunks)
  • deployment/docker-compose.yaml (0 hunks)
  • deployment/init-databases.sql (0 hunks)
  • go/pkg/hydra/README.md (0 hunks)
  • go/pkg/hydra/circuit_breaker_test.go (0 hunks)
  • go/pkg/hydra/complex_workflows_test.go (0 hunks)
  • go/pkg/hydra/cron.go (0 hunks)
  • go/pkg/hydra/data_consistency_test.go (0 hunks)
  • go/pkg/hydra/debug_test.go (0 hunks)
  • go/pkg/hydra/doc.go (0 hunks)
  • go/pkg/hydra/engine.go (0 hunks)
  • go/pkg/hydra/engine_test.go (0 hunks)
  • go/pkg/hydra/marshaller.go (0 hunks)
  • go/pkg/hydra/marshaller_test.go (0 hunks)
  • go/pkg/hydra/metrics/example_usage.go (0 hunks)
  • go/pkg/hydra/metrics/metrics.go (0 hunks)
  • go/pkg/hydra/simple_consistency_test.go (0 hunks)
  • go/pkg/hydra/sleep.go (0 hunks)
  • go/pkg/hydra/step.go (0 hunks)
  • go/pkg/hydra/step_atomicity_test.go (0 hunks)
  • go/pkg/hydra/step_idempotency_test.go (0 hunks)
  • go/pkg/hydra/store/db.go (0 hunks)
  • go/pkg/hydra/store/generate.go (0 hunks)
  • go/pkg/hydra/store/models.go (0 hunks)
  • go/pkg/hydra/store/querier.go (0 hunks)
  • go/pkg/hydra/store/queries.go (0 hunks)
  • go/pkg/hydra/store/queries/workflows.sql (0 hunks)
  • go/pkg/hydra/store/schema.sql (0 hunks)
  • go/pkg/hydra/store/sqlc.json (0 hunks)
  • go/pkg/hydra/store/workflows.sql.go (0 hunks)
  • go/pkg/hydra/store_coverage_test.go (0 hunks)
  • go/pkg/hydra/test_helpers.go (0 hunks)
  • go/pkg/hydra/testharness/events.go (0 hunks)
  • go/pkg/hydra/worker.go (0 hunks)
  • go/pkg/hydra/worker_heartbeat_test.go (0 hunks)
  • go/pkg/hydra/worker_polling_test.go (0 hunks)
  • go/pkg/hydra/workflow.go (0 hunks)
  • go/pkg/hydra/workflow_performance_test.go (0 hunks)
💤 Files with no reviewable changes (38)
  • go/pkg/hydra/store/generate.go
  • deployment/docker-compose.yaml
  • go/pkg/hydra/store/sqlc.json
  • go/pkg/hydra/store/querier.go
  • go/pkg/hydra/sleep.go
  • go/pkg/hydra/marshaller.go
  • go/pkg/hydra/step.go
  • go/pkg/hydra/worker.go
  • go/pkg/hydra/engine.go
  • go/pkg/hydra/store/queries.go
  • go/pkg/hydra/store_coverage_test.go
  • go/pkg/hydra/store/models.go
  • deployment/Dockerfile.mysql
  • go/pkg/hydra/store/schema.sql
  • go/pkg/hydra/engine_test.go
  • go/pkg/hydra/testharness/events.go
  • deployment/init-databases.sql
  • go/pkg/hydra/workflow.go
  • go/pkg/hydra/README.md
  • go/pkg/hydra/complex_workflows_test.go
  • go/pkg/hydra/metrics/metrics.go
  • go/pkg/hydra/workflow_performance_test.go
  • go/pkg/hydra/simple_consistency_test.go
  • go/pkg/hydra/data_consistency_test.go
  • go/pkg/hydra/doc.go
  • go/pkg/hydra/store/queries/workflows.sql
  • go/pkg/hydra/circuit_breaker_test.go
  • go/pkg/hydra/worker_heartbeat_test.go
  • go/pkg/hydra/test_helpers.go
  • go/pkg/hydra/cron.go
  • go/pkg/hydra/worker_polling_test.go
  • go/pkg/hydra/marshaller_test.go
  • go/pkg/hydra/store/db.go
  • go/pkg/hydra/step_idempotency_test.go
  • go/pkg/hydra/step_atomicity_test.go
  • go/pkg/hydra/metrics/example_usage.go
  • go/pkg/hydra/store/workflows.sql.go
  • go/pkg/hydra/debug_test.go
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-04-22T14:43:11.724Z
Learnt from: chronark
PR: unkeyed/unkey#3161
File: go/pkg/clickhouse/schema/databases/002_ratelimits/006_ratelimits_per_day_v1.sql:1-13
Timestamp: 2025-04-22T14:43:11.724Z
Learning: In the unkey project, the SQL files in clickhouse/schema/databases represent the current production schema and shouldn't be modified directly in PRs. Schema changes require dedicated migration scripts.

Applied to files:

  • apps/engineering/content/docs/infrastructure/database-schema.mdx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: Test API / API Test Local
  • GitHub Check: Test Go API Local / Test
  • GitHub Check: Build / Build
  • GitHub Check: Analyze (javascript-typescript)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@vercel vercel bot temporarily deployed to Preview – dashboard October 3, 2025 16:28 Inactive
@chronark chronark marked this pull request as ready for review October 3, 2025 16:28
@vercel vercel bot temporarily deployed to Preview – engineering October 3, 2025 16:28 Inactive
Copy link
Contributor

@imeyer imeyer left a comment

Choose a reason for hiding this comment

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

LGTM

it failed to build otherwise
@github-actions
Copy link
Contributor

github-actions bot commented Oct 3, 2025

Thank you for following the naming conventions for pull request titles! 🙏

@vercel vercel bot temporarily deployed to Preview – engineering October 3, 2025 17:18 Inactive
Copy link
Contributor

@ogzhanolguncu ogzhanolguncu left a comment

Choose a reason for hiding this comment

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

I thought hydra was unkillable

@graphite-app
Copy link

graphite-app bot commented Oct 3, 2025

Ad gif. 1990s clip from an Apple Promo of Brent Rambo looking at a desktop computer nodding and smiling, then looking at us and giving a thumbs up. (Added via Giphy)

@graphite-app
Copy link

graphite-app bot commented Oct 3, 2025

Graphite Automations

"Post a GIF when PR approved" took an action on this PR • (10/03/25)

1 gif was posted to this PR based on Andreas Thomas's automation.

Base automatically changed from 10-03-chore_deleting_dead_code_kv_package_ to main October 3, 2025 18:51
@Flo4604 Flo4604 enabled auto-merge October 6, 2025 07:40
@Flo4604 Flo4604 added this pull request to the merge queue Oct 6, 2025
Merged via the queue into main with commit 9ffae88 Oct 6, 2025
17 checks passed
@Flo4604 Flo4604 deleted the 10-03-chore_remove_dead_code_hydra_ branch October 6, 2025 07:53
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.

4 participants