-
Notifications
You must be signed in to change notification settings - Fork 784
feat(backend): retrieve root_job for MiniPulledJob + fix root job for flow jobs #6490
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
Deploying windmill with
|
Latest commit: |
5b75652
|
Status: | ✅ Deploy successful! |
Preview URL: | https://8c13671e.windmill.pages.dev |
Branch Preview URL: | https://hc-pass-root-job-to-minipull.windmill.pages.dev |
Claude finished @hugocasa's task —— View job Code Review: feat(backend): retrieve root_job for MiniPulledJob + fix root job for flow jobsI've conducted a comprehensive review of this PR. The changes implement a mechanism to properly track and expose root job IDs throughout the job execution system. Task List:
🎯 OverviewThis PR adds a
✅ Positive AspectsStrong Implementation Design:
Security & Performance:
|
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.
Important
Looks good to me! 👍
Reviewed everything up to 464711f in 1 minute and 37 seconds. Click for details.
- Reviewed
919
lines of code in23
files - Skipped
0
files when reviewing. - Skipped posting
7
draft comments. View those below. - Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. backend/windmill-worker/src/worker_lockfiles.rs:205
- Draft comment:
Consider using proper path manipulation (e.g. Path::join or calling .parent()) instead of string formatting to compute relative paths in parse_ts_relative_imports. This avoids potential path resolution errors. - Reason this comment was not posted:
Comment was not on a location in the diff, so it can't be submitted as a review comment.
2. backend/windmill-worker/src/worker_lockfiles.rs:210
- Draft comment:
Avoid using unwrap() on to_str() when converting a normalized path to a string. Consider handling potential non-UTF8 paths gracefully. - Reason this comment was not posted:
Comment was not on a location in the diff, so it can't be submitted as a review comment.
3. backend/windmill-worker/src/worker_lockfiles.rs:250
- Draft comment:
Parsing booleans from job arguments by converting them to strings and comparing with "true" is brittle. Consider explicitly parsing these values as booleans. - Reason this comment was not posted:
Comment was not on a location in the diff, so it can't be submitted as a review comment.
4. backend/windmill-worker/src/worker_lockfiles.rs:1294
- Draft comment:
Recreating the job_dir via remove_dir_all() followed by create_dir_all() can be destructive if job_dir is shared. Consider isolating lock file work in a dedicated subdirectory. - Reason this comment was not posted:
Comment was not on a location in the diff, so it can't be submitted as a review comment.
5. backend/windmill-worker/src/worker_lockfiles.rs:1050
- Draft comment:
The async recursive functions (e.g. lock_modules and lock_modules_app) use Box::pin and deep nesting. Consider refactoring to simplify the structure for better maintainability and potential performance improvements. - Reason this comment was not posted:
Comment was not on a location in the diff, so it can't be submitted as a review comment.
6. backend/windmill-worker/src/worker_lockfiles.rs:2258
- Draft comment:
The capture_dependency_job function contains extensive language‑specific logic. Consider splitting this logic into separate modules or functions to simplify maintenance and enhance testability for each supported language. - Reason this comment was not posted:
Comment was not on a location in the diff, so it can't be submitted as a review comment.
7. backend/windmill-worker/src/worker_flow.rs:2839
- Draft comment:
There seems to be an inconsistency in the variable naming: the debug log referencesjob_root
, but the root job is assigned toflow_root_job
on line 2831. Please confirm whetherjob_root
should be updated toflow_root_job
. - Reason this comment was not posted:
Comment was on unchanged code.
Workflow ID: wflow_Du1lYwx3P1Yr5pGm
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
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.
Important
Looks good to me! 👍
Reviewed 759ee88 in 1 minute and 15 seconds. Click for details.
- Reviewed
36
lines of code in1
files - Skipped
0
files when reviewing. - Skipped posting
8
draft comments. View those below. - Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. backend/windmill-api/src/jobs.rs:1
- Draft comment:
This file exceeds 7000 lines and contains many responsibilities. Consider splitting it into smaller modules for improved maintainability. - Reason this comment was not posted:
Comment was not on a location in the diff, so it can't be submitted as a review comment.
2. backend/windmill-api/src/jobs.rs:6680
- Draft comment:
Many SQL query strings are repeated. Consider refactoring common query fragments or helper functions/constants to avoid duplication. - Reason this comment was not posted:
Comment was not on a location in the diff, so it can't be submitted as a review comment.
3. backend/windmill-api/src/jobs.rs:7010
- Draft comment:
The loop traversing the parent_job chain (in get_completed_job_result) lacks a safety limit. Introduce a maximum iteration count to avoid potential infinite loops. - Reason this comment was not posted:
Comment was not on a location in the diff, so it can't be submitted as a review comment.
4. backend/windmill-api/src/jobs.rs:6260
- Draft comment:
The SSE polling loop in get_job_update_sse_stream spawns a long‐lived task. Ensure proper cancellation (e.g. when client disconnects) to avoid resource leaks. - Reason this comment was not posted:
Comment was not on a location in the diff, so it can't be submitted as a review comment.
5. backend/windmill-api/src/jobs.rs:6950
- Draft comment:
Avoid using the literal string 'anonymous' repeatedly; define and use a constant to reduce typos and ease future changes. - Reason this comment was not posted:
Comment was not on a location in the diff, so it can't be submitted as a review comment.
6. backend/windmill-api/src/jobs.rs:2500
- Draft comment:
Avoid using unwrap/unwrap_or in SQL query result handling; prefer explicit error handling to prevent panics in production. - Reason this comment was not posted:
Comment was not on a location in the diff, so it can't be submitted as a review comment.
7. backend/windmill-api/src/jobs.rs:1
- Draft comment:
Consider separating business logic (SQL queries, job scheduling) from HTTP response construction to improve clarity and testability. - Reason this comment was not posted:
Comment was not on a location in the diff, so it can't be submitted as a review comment.
8. backend/windmill-api/src/jobs.rs:6340
- Draft comment:
The polling intervals in the SSE stream are hard-coded. Consider externalizing these durations into configuration to allow tuning for load and performance. - Reason this comment was not posted:
Comment was not on a location in the diff, so it can't be submitted as a review comment.
Workflow ID: wflow_sfOiVFIkq3cTttQF
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
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.
Important
Looks good to me! 👍
Reviewed 5b75652 in 45 seconds. Click for details.
- Reviewed
56
lines of code in2
files - Skipped
0
files when reviewing. - Skipped posting
1
draft comments. View those below. - Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. backend/.sqlx/query-0e14ab95a08572f0672db266187335f578c622eb335cfc7cd0969633d85c9f73.json:3
- Draft comment:
Verify that the alias 'root_job!' (with an exclamation mark) is intentional and consistent with naming conventions. - Reason this comment was not posted:
Confidence changes required:33%
<= threshold50%
None
Workflow ID: wflow_oCTpJj5FNPgIHqL1
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
Important
Enhances job handling by adding a query for
root_job
retrieval inMiniPulledJob
and fixing root job handling for flow jobs.root_job
forMiniPulledJob
inquery-02c945b5f18a56a826721f6884846d79167747742de236ce57f395561685adc0.json
.compute_root_job_for_flow()
injobs.rs
to useCOALESCE
for determiningroot_job
.query-b2e4dfaaee713604d0700ea4675ed2d4534e08471a60005bff85b952874c54c2.json
andquery-fc243af1bc70f04e28c006364d6dfdfc49981568e8c496fb6a163c499c3e4ad1.json
.query-4aaab98ebdaa90f1edf49ac96fba6c391c4d0054a618b861464ee37239f1f1e0.json
toquery-f3f96e066716e61042519a645d487b578bc63792cdb0f7ddaeb82e9771287c22.json
and updates it to includeroot_job
.get_root_job_id()
incommon.rs
to useroot_job
directly.MiniPulledJob
struct injobs.rs
to includeroot_job
.worker.rs
,apps.rs
,flows.rs
,jobs.rs
,resources.rs
,scripts.rs
,trigger_helpers.rs
,variables.rs
,worker.rs
,worker_flow.rs
,worker_lockfiles.rs
to handleroot_job
andflow_innermost_root_job
.This description was created by
for 5b75652. You can customize this summary. It will automatically update as commits are pushed.