Skip to content
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

backend: simplify insert in completed_job #4999

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

uael
Copy link
Collaborator

@uael uael commented Dec 31, 2024

Important

Simplifies insert operation and streamlines canceled state handling in add_completed_job in jobs.rs.

  • Behavior:
    • Simplifies insert operation in add_completed_job in jobs.rs using a SELECT statement.
    • Streamlines canceled state handling with a boolean flag.
  • Error Handling:
    • Adjusts error handling in add_completed_job to align with new canceled state handling.
  • Logging:
    • Updates logging to reflect changes in canceled state handling.

This description was created by Ellipsis for b2ebb6d. It will automatically update as commits are pushed.

@uael uael requested a review from rubenfiszel as a code owner December 31, 2024 07:22
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Reviewed everything up to d723c0c in 20 seconds

More details
  • Looked at 244 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. backend/windmill-queue/src/jobs.rs:588
  • Draft comment:
    Ensure that the logic for determining the canceled status is consistent. The use of COALESCE($7, queue.canceled_by) IS NOT NULL might not correctly reflect the cancellation status if canceled_by is None but queue.canceled_by is not. Consider revising this logic to ensure accuracy.
  • Reason this comment was not posted:
    Comment did not seem useful.

Workflow ID: wflow_qCI5Wjd903hoR66x


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

@uael
Copy link
Collaborator Author

uael commented Dec 31, 2024

tested but not fully tested

@uael uael force-pushed the uael/simplify_add_completed_job branch from d723c0c to afb0a55 Compare December 31, 2024 07:28
Copy link

cloudflare-workers-and-pages bot commented Dec 31, 2024

Deploying windmill with  Cloudflare Pages  Cloudflare Pages

Latest commit: b2ebb6d
Status: ✅  Deploy successful!
Preview URL: https://662e93f9.windmill.pages.dev
Branch Preview URL: https://uael-simplify-add-completed.windmill.pages.dev

View logs

Copy link

Deploying windmill with  Cloudflare Pages  Cloudflare Pages

Latest commit: afb0a55
Status:⚡️  Build in progress...

View logs

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Incremental review on afb0a55 in 17 seconds

More details
  • Looked at 286 lines of code in 2 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. backend/windmill-queue/src/jobs.rs:524
  • Draft comment:
    The canceled variable is introduced here but ensure its usage is consistent throughout the function. Double-check that all logic depending on canceled is correctly updated to use this variable.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The PR introduces a new variable canceled to track the cancellation status of a job. This variable is used in multiple places, but its initialization and usage should be consistent and clear. The current implementation initializes canceled using a SQL query result, which is fine, but the logic around its usage should be double-checked for consistency and correctness.

Workflow ID: wflow_MZG9p9U69UgrOnq6


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

@uael uael force-pushed the uael/simplify_add_completed_job branch from afb0a55 to d5dab8b Compare December 31, 2024 13:30
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Incremental review on d5dab8b in 18 seconds

More details
  • Looked at 361 lines of code in 3 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. backend/windmill-queue/src/jobs.rs:524
  • Draft comment:
    The canceled variable is introduced to track the cancellation status of a job. Ensure that this variable is consistently set and used throughout the function to avoid incorrect cancellation status.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The PR introduces a new variable canceled to track the cancellation status of a job. This variable is used in multiple places to determine if a job was canceled. However, the logic for setting this variable is not consistent with the previous logic, which could lead to incorrect cancellation status being recorded.

Workflow ID: wflow_vgkrOcsmQnHXakBM


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

@uael uael force-pushed the uael/simplify_add_completed_job branch from d5dab8b to b2ebb6d Compare December 31, 2024 13:35
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Incremental review on b2ebb6d in 22 seconds

More details
  • Looked at 361 lines of code in 3 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. backend/windmill-queue/src/jobs.rs:587
  • Draft comment:
    Ensure that the logic for setting the canceled field correctly reflects the intended state of the job. If both $7 and queue.canceled_by are NULL, the canceled field should not default to FALSE if the job was previously canceled. Consider revising the logic to handle this case appropriately.
  • Reason this comment was not posted:
    Comment did not seem useful.

Workflow ID: wflow_ibYymL69jlHwUejJ


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

&& (queued_job.job_kind == JobKind::Script
|| queued_job.job_kind == JobKind::Preview)
{
if let Err(e) = sqlx::query!(
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@rubenfiszel Removed this as after this change, completed_job.flow_status should have the same value as q.flow_status

@uael uael marked this pull request as draft January 3, 2025 15:33
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