-
Notifications
You must be signed in to change notification settings - Fork 780
improve audit aprovals #5161
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
improve audit aprovals #5161
Conversation
Deploying windmill with
|
Latest commit: |
7ea14b0
|
Status: | ✅ Deploy successful! |
Preview URL: | https://d70fe301.windmill.pages.dev |
Branch Preview URL: | https://alp-approval-audit.windmill.pages.dev |
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.
👍 Looks good to me! Reviewed everything up to 4e3e118 in 1 minute and 0 seconds
More details
- Looked at
82
lines of code in2
files - Skipped
0
files when reviewing. - Skipped posting
6
drafted comments based on config settings.
1. backend/windmill-api/src/jobs.rs:1969
- Draft comment:
The PR lacks a description, making it difficult to understand the intent behind the changes. Please ensure to add a description for better context. - Reason this comment was not posted:
Confidence changes required:50%
The code is missing a description for the PR, which makes it difficult to understand the intent behind the changes. However, based on the code changes, it seems to be related to improving audit logging for job approvals and suspensions.
2. backend/windmill-api/src/jobs.rs:1973
- Draft comment:
The audit log action name has been changed from 'jobs.approved' to 'jobs.suspend_resume'. Ensure this change aligns with the intended audit logging behavior. - Reason this comment was not posted:
Confidence changes required:50%
The audit log action name has been changed from 'jobs.approved' to 'jobs.suspend_resume'. This change should be verified to ensure it aligns with the intended audit logging behavior.
3. backend/windmill-api/src/jobs.rs:1968
- Draft comment:
Good use ofunwrap_or_else
to handleapprover
variable, avoiding potential panics fromunwrap
. This pattern is used consistently in the changes. - Reason this comment was not posted:
Confidence changes required:0%
The code usesunwrap_or_else
to handle theapprover
variable, which is a good practice to avoid potential panics fromunwrap
. This pattern is used consistently in the changes.
4. backend/windmill-api/src/jobs.rs:1977
- Draft comment:
Good use ofserde_json::json!
for constructing JSON objects, enhancing readability and maintainability. - Reason this comment was not posted:
Confidence changes required:0%
The code usesserde_json::json!
to construct JSON objects, which is a good practice for readability and maintainability. This pattern is used consistently in the changes.
5. backend/windmill-queue/src/jobs.rs:550
- Draft comment:
Good practice to check for 'SuspendedTimedOut' error and log it, ensuring specific error cases are recorded in the audit log. - Reason this comment was not posted:
Confidence changes required:0%
The code checks for the 'SuspendedTimedOut' error and logs it, which is a good practice for handling specific error cases and ensuring they are recorded in the audit log.
6. backend/windmill-queue/src/jobs.rs:548
- Draft comment:
Good use ofunwrap_or_else
to handle potential errors when convertingresult
to JSON, avoiding panics and handling errors gracefully. - Reason this comment was not posted:
Confidence changes required:0%
The code usesunwrap_or_else
to handle potential errors when convertingresult
to JSON, which is a good practice to avoid panics and handle errors gracefully.
Workflow ID: wflow_auilFFWTADBK8jZt
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
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.
👍 Looks good to me! Incremental review on 52a535e in 19 seconds
More details
- Looked at
101
lines of code in2
files - Skipped
0
files when reviewing. - Skipped posting
1
drafted comments based on config settings.
1. backend/windmill-worker/src/worker_flow.rs:1914
- Draft comment:
Consider extracting the repeatedaudit_log
calls into a helper function to reduce code duplication and potential errors. This applies to lines 1914 and 1994. - Reason this comment was not posted:
Confidence changes required:50%
The audit log function is used multiple times with similar parameters. It would be more efficient to extract this into a helper function to avoid repetition and potential errors.
Workflow ID: wflow_n1RUNDCb2DzzODPW
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
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.
👍 Looks good to me! Incremental review on 7ea14b0 in 17 seconds
More details
- Looked at
13
lines of code in1
files - Skipped
0
files when reviewing. - Skipped posting
1
drafted comments based on config settings.
1. backend/windmill-worker/src/worker_flow.rs:1900
- Draft comment:
Ensure that the 'u/' prefix is consistently present in all usernames. If not, this change might lead to incorrect usernames being processed. - Reason this comment was not posted:
Confidence changes required:50%
The change trims the prefix 'u/' from the username. This is a reasonable change if usernames are expected to have this prefix in the data source. However, it should be verified that this prefix is consistently present and that removing it won't cause issues elsewhere in the system.
Workflow ID: wflow_EYLZvptjq2m9z5wX
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
Important
Improve audit logging for job approvals and suspensions with detailed status and approver information.
audit_log
calls injobs.rs
andworker_flow.rs
to include detailed approval status and approver information."jobs.approved"
to"jobs.suspend_resume"
injobs.rs
.audit_log
entries.worker_flow.rs
.This description was created by
for 7ea14b0. It will automatically update as commits are pushed.