-
-
Notifications
You must be signed in to change notification settings - Fork 699
Both run engines will only lock to versions they can handle #1922
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
WalkthroughThe changes update two functions responsible for selecting worker deployments by incorporating conditional logic based on deployment types. In one function, a new Changes
Sequence Diagram(s)sequenceDiagram
participant Caller as Caller
participant FWD as findCurrentWorkerDeployment()
participant DB as Prisma DB
Caller->>FWD: Invoke function
FWD->>Promotion: Check for promotion
alt Promotion not found
FWD-->>Caller: Return undefined
else Promotion exists
FWD->>Deployment: Check deployment.type
alt type === "V1"
FWD-->>Caller: Return current deployment
else type !== "V1"
FWD->>DB: Query latest "V1" deployment
DB-->>FWD: Return latest deployment (or undefined)
FWD-->>Caller: Return deployment or undefined
end
end
sequenceDiagram
participant Caller as Caller
participant GW as getWorkerFromCurrentlyPromotedDeployment()
participant DB as Prisma DB
Caller->>GW: Invoke function
GW->>Deployment: Check deployment.type
alt type === "MANAGED"
GW-->>Caller: Return worker, tasks, queues, deployment
else type !== "MANAGED"
GW->>DB: Query latest "MANAGED" deployment
DB-->>GW: Return latest details (or null)
GW-->>Caller: Return details or null
end
Poem
Tip ⚡💬 Agentic Chat (Pro Plan, General Availability)
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
⏰ Context from checks skipped due to timeout of 90000ms (5)
🔇 Additional comments (2)
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
internal-packages/run-engine/src/engine/db/worker.ts (1)
292-299
: Consider a more explicit name than"MANAGED"
for run engine V2.Using
"MANAGED"
to denote version 2 may be less transparent than naming it something like"RUN_ENGINE_V2"
. This is a minor naming preference, but it could improve code clarity if your organization often confuses these terms.apps/webapp/app/v3/models/workerDeployment.server.ts (1)
92-95
: Consider handling the missing promotion scenario more visibly.Returning
undefined
is fine, but you could add logging or a warning to spot unexpected absence of promotions in production.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
apps/webapp/app/v3/models/workerDeployment.server.ts
(2 hunks)internal-packages/run-engine/src/engine/db/worker.ts
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (5)
- GitHub Check: e2e / 🧪 CLI v3 tests (windows-latest - pnpm)
- GitHub Check: e2e / 🧪 CLI v3 tests (windows-latest - npm)
- GitHub Check: units / 🧪 Unit Tests
- GitHub Check: typecheck / typecheck
- GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (5)
internal-packages/run-engine/src/engine/db/worker.ts (2)
302-323
: Validate fallback for environments without"MANAGED"
deployments.This code fetches the most recent
"MANAGED"
deployment if the current environment isn't recognized as"MANAGED"
. Ensure that relevant tests verify this scenario so you avoid unexpected null returns.
326-329
: LGTM for returning the latest"MANAGED"
deployment.The returned structure is consistent with the code above and includes worker, tasks, queues, and deployment details.
apps/webapp/app/v3/models/workerDeployment.server.ts (3)
74-74
: Good addition of thetype
field.Including this field allows specialized handling of different deployment versions without guesswork.
96-99
: Logic verified for V1 deployment check.No issues here. This early return for
"V1"
deployments aligns with the intended version-based flow control.
101-135
: Request tests covering fallback to the latest"V1"
deployment.Please confirm that you have test coverage for cases without a current
"V1"
promotion to ensure the fallback logic functions as intended.
* run engine v1 will only lock to v1 deployments * run engine v2 will only lock to managed v2 deployments * test: create background worker and deployment with correct engine version
* WIP on secret env vars * Editing individual env var values is working * Sort the env vars by the key * Deleting values * Allowing setting secret env vars * Added medium switch style * Many style changes to the env var form * “Copy text” -> “Copy” * Draw a divider between hidden buttons * Env var tweaks * Don’t show Dev:you anymore * Grouping the same env var keys together * Styles improved * Improved styling of edit panel * Fix bun detection, dev flushing, and init command (#1914) * update nypm to support text-based bun lockfiles * add nypm changeset * handle dev flushing failures gracefully * fix path normalization for init.ts * add changesets * chore: remove pre.json after exiting pre mode * init command to install v4-beta packages * Revert "chore: remove pre.json after exiting pre mode" This reverts commit f5694fd. * make init default to cli version for all packages * Release 4.0.0-v4-beta.1 (#1916) * chore: Update version for release (v4-beta) * Release 4.0.0-v4-beta.1 --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: nicktrn <55853254+nicktrn@users.noreply.github.com> * Both run engines will only lock to versions they can handle (#1922) * run engine v1 will only lock to v1 deployments * run engine v2 will only lock to managed v2 deployments * test: create background worker and deployment with correct engine version * Add links to and from deployments (#1921) * link from deployments tasks to filtered runs view * jump to deployment * don't add version links for dev (yet) * Fix current worker deployment getter (#1924) * only return last v1 deployment in the shared queue consumer * be explicit about only returning managed deployments * Add a docs page for the human-in-the-loop example project (#1919) * Add a docs page for the human-in-the-loop example project * Order guides, example projects and example tasks alphabetically in the docs list * Managed run controller revamp (#1927) * update nypm to support text-based bun lockfiles * fix retry spans * only download debug logs if admin * add nypm changeset * pull out env override logic * use runner env gather helper * handle dev flushing failures gracefully * fix path normalization for init.ts * add logger * add execution heartbeat service * add snapshot poller service * fix poller * add changesets * create socket in constructor * enable strictPropertyInitialization * deprecate dequeue from version * start is not async * dependency injection in prep for tests * add warm start count to all controller logs * add restore count * pull out run execution logic * temp disable pre * add a controller log when starting an execution * refactor execution and squash some bugs * cleanup completed docker containers by default * execution fixes and logging improvements * don't throw afet abort cleanup * poller should use private interval * rename heartbeat service file * rename HeartbeatService to IntervalService * restore old heartbeat service but deprecate it * use the new interval service everywhere * Revert "temp disable pre" This reverts commit e03f417. * add changeset * replace all run engine find uniques with find first * Release 4.0.0-v4-beta.2 (#1928) * chore: Update version for release (v4-beta) * Release 4.0.0-v4-beta.2 --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: nicktrn <55853254+nicktrn@users.noreply.github.com> * Remove batch ID carryover for non-batch waits (#1930) * add failing test case * do not carry over previous batch id when blocking with waitpoint * delete irrelevant test * Delete project (#1913) * Delete project - Don’t schedule tasks if the project is deleted - Delete queues from the master queues - Add the old delete project UI back in * Mark the project as deleted last * Fix for overriding local variable * Added a todo for deleting env queues * Remove todo * Improve usage flushing (#1931) * add flush to global usage api * enable controller debug logs * initialize usage manager after env overrides * add previous run id to more debug logs * add changeset * For secret env vars, don’t return the value * Added a new env var repository function for getting secrets with redactions * Test task for env vars * Delete heartbeat file, merge mess up --------- Co-authored-by: nicktrn <55853254+nicktrn@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Saadi Myftija <saadi.myftija@gmail.com>
Previously, either run engine would lock to the current deployment, regardless of version. This meant that v3 runs could end up with a v4 deployment if there were any non-locked runs in the v3 queue. Those runs would fail. Same the other way around on downgrades. This has been fixed by locking to the last deployment of a compatible version if the current deployment is incompatible.
Summary by CodeRabbit
These updates streamline the process for obtaining deployment information, ensuring users receive more accurate and timely results.