Skip to content

feat(python): per import requirement pin #5520

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

Merged
merged 28 commits into from
Apr 11, 2025
Merged

feat(python): per import requirement pin #5520

merged 28 commits into from
Apr 11, 2025

Conversation

pyranota
Copy link
Contributor

@pyranota pyranota commented Mar 27, 2025

Important

Adds per-import requirement pinning for Python scripts, updating import parsing and dependency resolution logic, with tests to verify functionality.

  • Behavior:
    • Adds support for per-import requirement pinning in Python scripts, allowing pin and repin annotations in lib.rs.
    • Updates parse_python_imports in python_executor.rs to handle new pinning logic and provide compilation error hints.
    • Modifies handle_python_deps in worker_lockfiles.rs to integrate new pinning logic.
  • Models:
    • Introduces NImport, NImportResolved, and ImportPin enums in lib.rs to represent different import types and pinning states.
  • Tests:
    • Adds tests in worker.rs to verify the functionality of per-import requirement pinning and its integration with the lockfile generation process.
  • Misc:
    • Updates JSON query files in backend/.sqlx/ to reflect changes in import handling.

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

@pyranota pyranota changed the title Py pin annotation feat: per import requirment pin Mar 27, 2025
@pyranota pyranota changed the title feat: per import requirment pin feat(python): per import requirment pin Mar 27, 2025
Copy link

cloudflare-workers-and-pages bot commented Mar 27, 2025

Deploying windmill with  Cloudflare Pages  Cloudflare Pages

Latest commit: c925304
Status:🚫  Build failed.

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! Reviewed everything up to 8406ee8 in 2 minutes and 18 seconds

More details
  • Looked at 76 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 9 drafted comments based on config settings.
1. backend/parsers/windmill-parser-py-imports/src/lib.rs:110
  • Draft comment:
    Consider using a slice of the original string instead of collecting chars (e.g., &code[range.end().to_usize()..]) for efficiency and clarity when extracting the inline comment.
  • Reason this comment was not posted:
    Confidence changes required: 50% <= threshold 50%
    None
2. backend/parsers/windmill-parser-py-imports/src/lib.rs:124
  • Draft comment:
    Ensure that the logic for handling pin annotations for import statements with multiple names is intentional. Currently, if a pin annotation is present but names.len() > 1, it falls back to processing each name. Clarify if this is the desired behavior.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 40% <= threshold 50%
    The comment is asking the author to clarify if the behavior is intentional, which violates the rule against asking for confirmation of intention. However, it does point out a specific behavior that might be unintended, which could be useful for the author to consider. The comment could be rephrased to suggest a specific change or to highlight a potential issue without asking for confirmation.
3. backend/parsers/windmill-parser-py-imports/src/lib.rs:23
  • Draft comment:
    Verify that importing TextRange from rustpython_parser remains compatible with all targeted versions.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50%
    None
4. backend/parsers/windmill-parser-py-imports/src/lib.rs:45
  • Draft comment:
    Consider using '+' instead of '*' in the PIN_RE regex to avoid matching empty pin annotations.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 10% vs. threshold = 50%
    The current pattern \s* means "zero or more whitespace", while \s+ means "one or more whitespace". The suggestion aims to prevent matching cases where there's no space between "pin:" and the value. However, this seems overly strict - there's no clear reason why requiring at least one space would be better. The current pattern is more flexible and matches valid cases like "#pin:value" which seem reasonable.
    The suggestion could prevent some malformed pin annotations, but it may also reject valid ones. I don't see strong evidence that empty pin annotations are actually a problem that needs solving.
    Without evidence that empty pin annotations are causing issues, making the regex more restrictive seems unnecessary and could break valid use cases.
    The comment should be deleted as it suggests a change that is not clearly beneficial and could potentially break valid use cases without solving a demonstrated problem.
5. backend/parsers/windmill-parser-py-imports/src/lib.rs:106
  • Draft comment:
    Consider using string slicing instead of iterating over code.chars() to extract the remainder of the line for efficiency and clarity.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 20% vs. threshold = 50%
    The comment has a point - string slicing would likely be more efficient than iterating over chars. However, the current approach works correctly and the performance difference is likely negligible since this is parsing source code (not a hot path). The code is also quite readable as-is. The comment doesn't provide specific guidance on how to implement the suggestion.
    The performance impact could be more significant than I initially assumed if this code processes many large files. String slicing would be a cleaner approach.
    While string slicing may be marginally better, this is a code parsing tool where correctness is more important than minor performance optimizations. The current implementation is clear and correct.
    Delete the comment. While the suggestion has merit, the current implementation is sufficiently clear and correct. The potential optimization is minor and not worth the churn.
6. backend/parsers/windmill-parser-py-imports/src/lib.rs:124
  • Draft comment:
    Pin annotations are only applied for single-name import statements. Ensure this behavior is clearly documented.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50%
    The comment is asking the author to ensure that a behavior is documented. This falls under the rule of not asking the author to ensure something is documented or tested. Therefore, this comment should be removed.
7. backend/parsers/windmill-parser-py-imports/src/lib.rs:144
  • Draft comment:
    For 'from' imports, a pin annotation (if present) overrides the default import processing. Confirm that this override is intended and properly documented.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50%
    The comment is asking the PR author to confirm their intention regarding the use of a pin annotation in 'from' imports. This violates the rule against asking the author to confirm their intention or ensure behavior is intended. The comment does not provide a specific code suggestion or ask for a specific test to be written.
8. backend/parsers/windmill-parser-py-imports/src/lib.rs:50
  • Draft comment:
    The variable name 'splitted_path' is used on line 50. The more conventional term is 'split_path' (since 'split' is already the correct past tense of 'split'). Consider renaming for clarity.
  • 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.
9. backend/parsers/windmill-parser-py-imports/src/lib.rs:309
  • Draft comment:
    The entry '-bootsubprocess' in the STDIMPORTS list (line 309) appears to be a typographical error. This might be intended to be '-subprocess' (which is a standard Python module) or needs clarification. Please review and correct if necessary.
  • 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_08FiPAQKrY25YJS0


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

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 8f0d4e3 in 1 minute and 36 seconds

More details
  • Looked at 33 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 5 drafted comments based on config settings.
1. backend/parsers/windmill-parser-py-imports/src/lib.rs:125
  • Draft comment:
    The check for multiple imports (if names.len() > 1) was removed. This means that for import a, b, any pin comment will now be applied even though there are multiple names. Ensure this change is intentional.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 10% vs. threshold = 50%
    The comment correctly identifies a behavior change, but it's phrased as a request to "ensure this change is intentional" rather than pointing out a specific issue. The comment doesn't explain why having multiple imports with a pin comment would be problematic. Without understanding the purpose of pin comments or why multiple imports were blocked before, I can't be confident this is actually an issue.
    I may be too harsh - perhaps there is an important reason why pin comments shouldn't apply to multiple imports that I'm missing due to lack of context about the pin comment feature.
    While there could be a good reason for the original restriction, the comment itself doesn't provide that context or clearly state what should be done. It just asks for verification, which violates our rules.
    The comment should be deleted because it merely asks for verification without providing actionable feedback or explaining why the change would be problematic.
2. backend/parsers/windmill-parser-py-imports/src/lib.rs:125
  • Draft comment:
    Removed check on names.len() > 1 now applies pin for multi-imports; ensure this behavior is intentional.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 0% vs. threshold = 50%
    The comment is asking the author to verify if this behavior change is intentional. However, this violates our rules - we should not ask authors to verify their intentions. The change appears to be a deliberate simplification of the pin handling logic. If there was a real issue with the change, the comment should state it directly.
    The code change could have unintended consequences for pin behavior that I'm not fully understanding. Maybe there was a good reason for the original length check.
    Even if there are potential issues, asking the author to verify intentions is not helpful. If there is a specific problem, it should be stated directly with evidence.
    This comment should be deleted as it merely asks the author to verify their intentions rather than pointing out a specific issue.
3. backend/parsers/windmill-parser-py-imports/src/lib.rs:125
  • Draft comment:
    Consider using or_else() instead of or() to defer evaluation of process_import alternative.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 20% vs. threshold = 50%
    The difference between or() and or_else() is that or() eagerly evaluates both operands, while or_else() lazily evaluates the second operand only if needed. In this case, the second operand involves iterating over names and processing imports, which could be expensive. However, since find_pin() is likely to return None in most cases (it's looking for special pin comments), the second branch will almost always be evaluated anyway. The optimization would be minimal.
    The comment is technically correct - or_else() would be more idiomatic here. But is this optimization important enough to warrant a code change and review cycle?
    While technically correct, this optimization would have negligible real-world impact since the alternative branch needs to be evaluated most of the time anyway.
    The comment should be removed. While technically correct, the suggested optimization is too minor to justify a code change.
4. backend/parsers/windmill-parser-py-imports/src/lib.rs:63
  • Draft comment:
    Typo: The variable 'imprt' is likely meant to be 'import' for clarity.
  • 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/parsers/windmill-parser-py-imports/src/lib.rs:51
  • Draft comment:
    Consider renaming 'splitted_path' to 'split_path' for a more standard naming convention.
  • 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_pbPyj1nLTPghFYNh


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

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 5b16ae2 in 1 minute and 0 seconds

More details
  • Looked at 291 lines of code in 4 files
  • Skipped 0 files when reviewing.
  • Skipped posting 18 drafted comments based on config settings.
1. backend/windmill-worker/src/worker_lockfiles.rs:146
  • Draft comment:
    Using is_some_and() is concise but note that it requires Rust 1.70+; ensure your minimal supported version is updated.
  • 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:112
  • Draft comment:
    Consider avoiding excessive cloning and unwraps in dependency processing. For example, the use of unwrap_or_default in several places (e.g., line 112) may hide errors and affect robustness.
  • 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:1290
  • Draft comment:
    The frequent use of Box::pin(...).await in lock_modules may be simplified. It might be possible to avoid boxing via restructuring the async calls, which could improve readability.
  • 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:435
  • Draft comment:
    The remove_ansi_codes function compiles a regex in a lazy_static block inside the function. Consider moving this regex outside the function so that it is global and avoids repeated initialization if the function is called frequently.
  • 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:1807
  • Draft comment:
    In capture_dependency_job, the match arms for different ScriptLang variants are long. Refactoring into separate helper functions or modules could improve readability and 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.
6. backend/windmill-worker/src/worker_lockfiles.rs:95
  • Draft comment:
    The SQL INSERT in add_relative_imports_to_dependency_map uses a non‐sequential parameter order ($1, $2, $4, $3, $5). This makes it hard to verify that each value goes into the correct column. Consider reordering the parameters to match the column order for clarity.
  • 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_lockfiles.rs:164
  • Draft comment:
    The try_normalize function returns None when encountering a Prefix or RootDir component. It would help to document this behavior explicitly so that callers understand that absolute paths are rejected.
  • 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-worker/src/worker_lockfiles.rs:186
  • Draft comment:
    In parse_ts_relative_imports, the call to trim_end_matches('.ts') assumes only .ts files. Consider generalizing the logic (or adding comments) to cover possible variations (e.g. .tsx) if applicable.
  • 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.
9. backend/windmill-worker/src/worker_lockfiles.rs:1171
  • Draft comment:
    In insert_flow_node, using unwrap_or with Default::default() for the optional 'code' and 'lock' values may mask missing data. Consider handling the None case explicitly (or returning an error) rather than silently defaulting to empty strings.
  • 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.
10. backend/windmill-worker/src/worker_lockfiles.rs:1280
  • Draft comment:
    The reduce_flow function deserializes module.value via from_str without adding much context. It might be beneficial to wrap the error with additional context (e.g. the module id or expected structure) to aid in debugging.
  • 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.
11. backend/windmill-worker/src/worker_lockfiles.rs:1425
  • Draft comment:
    The logic in skip_creating_new_lock for ScriptLang::Bun/Bunnative is a bit hard to follow. Consider adding more descriptive comments or refactoring this check so that the intention is clearer.
  • 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.
12. backend/windmill-worker/src/worker_lockfiles.rs:1064
  • Draft comment:
    In the lock_modules function, the job directory is removed and recreated for new lock generation. Deleting the entire job directory repeatedly may be expensive and could affect performance. Consider a strategy to update only the necessary lock file instead of recreating the entire directory.
  • 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.
13. backend/windmill-worker/src/worker_lockfiles.rs:1808
  • Draft comment:
    In capture_dependency_job, the raw_deps flag significantly alters the behavior (using full job code versus parsed imports). Make sure this behavior is well documented so that future maintainers understand when to set raw_deps and the implications for dependency resolution.
  • 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.
14. backend/parsers/windmill-parser-py-imports/src/lib.rs:54
  • Draft comment:
    The variable name 'splitted_path' appears to use a non-standard form. Consider renaming it to 'split_path' (or simply using the result of path.split("/") directly) to improve readability.
  • 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.
15. backend/parsers/windmill-parser-py-imports/src/lib.rs:66
  • Draft comment:
    The variable 'imprt' in the function process_import seems likely to be a typo for 'import'. A small change here will help keep the code clear.
  • 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.
16. backend/windmill-worker/src/python_executor.rs:1422
  • Draft comment:
    The diff introduces a new variable declaration: let compilation_error_hint; right after declaring let mut requirements;. This is required to capture the second return value from parse_python_imports, and later it is used in constructing the error message. Please ensure that the new variable is used appropriately in the error formatting.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50%
    The comment is purely informative, explaining what the code does and asking the author to ensure the variable is used appropriately. It doesn't provide a specific suggestion or point out a potential issue.
17. backend/windmill-worker/src/python_executor.rs:1443
  • Draft comment:
    The diff adjusts the call to windmill_parser_py_imports to assign both returned_requirements and returned_hint, and then sets (requirements, compilation_error_hint) accordingly. Please verify that the expected types match and this change is correctly propagated in the subsequent logic.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50%
    The comment is asking the PR author to verify that the expected types match and that the change is correctly propagated. This falls under asking the author to double-check things, which is against the rules. The comment does not provide a specific suggestion or point out a specific issue.
18. backend/windmill-worker/src/python_executor.rs:1467
  • Draft comment:
    In the error mapping for the uv_pip_compile call, the error message was updated to include compilation_error_hint.unwrap_or_default(). Please ensure that compilation_error_hint is properly set from the parse_python_imports call so that the error message is complete and helpful.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50%
    The comment is asking the PR author to ensure that a variable is properly set, which violates the rule against asking the author to ensure behavior is intended or tested. It does not provide a specific suggestion or ask for a test to be written. Therefore, this comment should be removed.

Workflow ID: wflow_gaUeC1hv8O4tUAyp


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

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.

❌ Changes requested. Incremental review on 93b1124 in 2 minutes and 26 seconds

More details
  • Looked at 156 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 11 drafted comments based on config settings.
1. backend/parsers/windmill-parser-py-imports/src/lib.rs:90
  • Draft comment:
    Great detailed enum documentation. Make sure these inline comments stay updated with any changes to the variant fields.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50%
    None
2. backend/parsers/windmill-parser-py-imports/src/lib.rs:178
  • Draft comment:
    Replacing 'names.get(0).unwrap()' with 'and_then' improves safety. Confirm that the first element is always the intended one.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50%
    None
3. backend/parsers/windmill-parser-py-imports/src/lib.rs:208
  • Draft comment:
    Filtering STDIMPORTS now uses a pattern match for the Auto variant. Ensure that this covers all cases and that any future variants requiring STDIMPORTS filtering are handled accordingly.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50%
    None
4. backend/parsers/windmill-parser-py-imports/src/lib.rs:403
  • Draft comment:
    When extracting the base using match in nested imports, consider matching on a reference instead of cloning the entire NImport. This might reduce unnecessary cloning.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50%
    None
5. backend/parsers/windmill-parser-py-imports/src/lib.rs:450
  • Draft comment:
    Update comment style; "do nothing" is clearer than commented out phrases. Ensure consistency across similar match arms.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50%
    None
6. backend/parsers/windmill-parser-py-imports/src/lib.rs:186
  • Draft comment:
    Good replacement of 'unwrap' with and_then to safely access the first element of 'names'.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50%
    None
7. backend/parsers/windmill-parser-py-imports/src/lib.rs:213
  • Draft comment:
    Verify that filtering STDIMPORTS is intentionally limited to the Auto variant. If other variants (Pin/Repin) should also be excluded, adjust the filter accordingly.
  • Reason this comment was not posted:
    Confidence changes required: 50% <= threshold 50%
    None
8. backend/parsers/windmill-parser-py-imports/src/lib.rs:404
  • Draft comment:
    Refactoring to use explicit pattern matching for base extraction (instead of the removed get_base method) is clear. Consider extracting this logic into a helper function if used in multiple places.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50%
    None
9. backend/parsers/windmill-parser-py-imports/src/lib.rs:257
  • Draft comment:
    Consider removing or clarifying the commented-out call to '.unique()'. If deduplication is not required here, remove the commented code to keep the codebase clean.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50%
    None
10. backend/parsers/windmill-parser-py-imports/src/lib.rs:106
  • Draft comment:
    Typo: The comment says "Automatically inferenced requirement". Consider changing it to "Automatically inferred requirement".
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 0% vs. threshold = 50%
    While this is technically a correct fix for a typo (inferenced is not a real word, inferred is correct), the comment is purely about documentation and doesn't affect functionality. The rules state not to make purely informative comments. Additionally, this is a very minor documentation issue that doesn't impact code understanding.
    The typo could be seen as reducing code quality and professionalism. Documentation accuracy is important.
    While documentation accuracy matters, this is an extremely minor issue that doesn't impact code understanding or functionality. The rules explicitly state not to make purely informative comments.
    The comment should be removed as it is purely informative and doesn't require any functional code changes.
11. backend/parsers/windmill-parser-py-imports/src/lib.rs:382
  • Draft comment:
    Typo: The comment says "This why we can safely assume later, that there is no relative imports". Consider changing it to "That's why we can safely assume later that there are no relative imports".
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 10% vs. threshold = 50%
    While the grammar correction is technically accurate, code comments are primarily meant to convey technical meaning. The current comment, despite its grammatical imperfections, clearly conveys its technical meaning. The suggested changes don't materially improve understanding of the code. This seems like an unnecessary nitpick that doesn't add value.
    The comment does point out real grammatical issues. Poor grammar in comments could theoretically make them harder to understand for non-native English speakers.
    While good grammar is nice to have, this comment is still perfectly understandable despite the minor grammatical issues. Making such minor grammar corrections creates noise in the PR review process without adding meaningful value.
    Delete this comment as it focuses on minor grammatical issues rather than substantive code improvements.

Workflow ID: wflow_FhscoTxe2Lxwm9FO


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

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 3018cb3 in 2 minutes and 25 seconds

More details
  • Looked at 28 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 6 drafted comments based on config settings.
1. backend/parsers/windmill-parser-py-imports/src/lib.rs:40
  • Draft comment:
    Consider adding documentation for the new return type Option in replace_full_import. The behavior change (returning None when no mapping is found) should be noted to avoid confusion.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 20% vs. threshold = 50%
    While documenting return types is generally good practice, this is a very simple internal helper function that is only used once in the codebase. The Option return type is a common Rust pattern and its meaning is clear from the code - it returns None when the key isn't found in the map. The change appears to be a refactoring to make the None case explicit rather than having a default fallback.
    The comment does identify a real change in behavior that could affect maintainability. Documentation could help future developers understand the intent.
    However, the function is very simple, only used internally, and follows standard Rust patterns. The behavior is clear from reading the implementation. Documentation would be redundant.
    This comment should be deleted as it suggests documentation that would be redundant for a simple internal helper function following standard Rust patterns.
2. backend/parsers/windmill-parser-py-imports/src/lib.rs:68
  • Draft comment:
    Verify that the new condition (if module == root) in the Auto import construction is intended, as the previous logic compared full == root. This subtle change may impact behavior.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 50% <= threshold 50%
    The comment is asking the PR author to verify their intention, which is against the rules. However, it does point out a specific change in logic that could impact behavior, which is useful. The comment could be rephrased to suggest checking the logic without asking for verification.
3. backend/parsers/windmill-parser-py-imports/src/lib.rs:40
  • Draft comment:
    Changing replace_full_import to return an Option is more idiomatic. Please add a comment noting that it now returns a mapped value if present and does not provide a default fallback.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 10% vs. threshold = 50%
    The function is very simple and its behavior is clear from the code - it just maps a lookup result. The Option return type is idiomatic Rust and its meaning is well understood. The function name and parameter names are descriptive. Additional documentation would be redundant and not add value.
    The comment correctly identifies that returning Option is more idiomatic Rust. However, maybe there's important context about why this change was made that should be documented?
    Looking at the diff and full file, this appears to be a simple refactoring to make the code more idiomatic. The usage shows it's just used for lookups where None is handled appropriately. No special context needs to be documented.
    The comment should be deleted. The Option return type is self-documenting and additional comments would be redundant for this simple lookup function.
4. backend/parsers/windmill-parser-py-imports/src/lib.rs:68
  • Draft comment:
    The new logic in process_import computes root via the full import map (or falling back to the short mapping) and then sets the auto field as Some(module) if module != root. This differs from the previous check (comparing full == root). Please confirm that comparing the original module string is the intended behavior.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50%
    The comment is asking the PR author to confirm their intention regarding a change in logic. It points out a specific change in behavior and asks for confirmation if this is intended. This is not allowed as per the rules, which prohibit asking the author to confirm their intention or ensure behavior is intended.
5. backend/parsers/windmill-parser-py-imports/src/lib.rs:64
  • Draft comment:
    Typo detected: The variable name 'imprt' appears to be missing the letter 'o'. Consider renaming it to 'import' for clarity.
  • 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/parsers/windmill-parser-py-imports/src/lib.rs:103
  • Draft comment:
    Typographical error found in comment: 'Automatically inferenced requirement' should be corrected to 'Automatically inferred requirement' for improved clarity.
  • 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_aJT3LBeNZ5SEOxU7


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

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 1829c85 in 1 minute and 37 seconds

More details
  • Looked at 15 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 3 drafted comments based on config settings.
1. backend/parsers/windmill-parser-py-imports/src/lib.rs:162
  • Draft comment:
    Removed the condition checking if the pin value equals 'ignore'. Verify if this change is intentional, as it now processes 'ignore' as a valid pin.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 0% vs. threshold = 50%
    The comment asks the author to "verify if this change is intentional" which directly violates the rule against asking authors to verify/confirm/ensure things. The comment doesn't provide evidence that processing "ignore" as a pin would cause any actual issues. If there was a real problem with removing the ignore case, the comment should state what that problem is.
    Maybe there is some important semantic meaning to "ignore" pins that I'm missing? But without clear evidence in the code that this would cause problems, I shouldn't speculate.
    The code shows that pins are just processed into Pin or Repin structs - there's no evidence that "ignore" has any special meaning that would make this change problematic. The comment is purely speculative.
    Delete this comment. It violates the rule against asking for verification and doesn't provide evidence of any actual problems with the change.
2. backend/parsers/windmill-parser-py-imports/src/lib.rs:161
  • Draft comment:
    The removed ignore-check means that a comment like # pin: ignore will now produce an import pin with the value "ignore" instead of being skipped. Please ensure this change is intentional and update docs/tests accordingly.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 50% <= threshold 50%
    The comment is pointing out a change in behavior due to the removal of an ignore-check. It asks the author to ensure the change is intentional and to update documentation/tests accordingly. The part about ensuring the change is intentional violates the rules, but the suggestion to update docs/tests is specific and actionable.
3. backend/parsers/windmill-parser-py-imports/src/lib.rs:103
  • Draft comment:
    Typo detected in comment: 'Automatically inferenced requirement'. Consider changing it to 'Automatically inferred requirement'.
  • 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_EmfT0H2kEoTDM4xO


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

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 2dc3155 in 1 minute and 2 seconds

More details
  • Looked at 23 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 4 drafted comments based on config settings.
1. backend/parsers/windmill-parser-py-imports/src/lib.rs:396
  • Draft comment:
    Good change: using 'let mut nested' and sorting nested imports ensures consistent resolution order when merging nested import pins.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50%
    None
2. backend/parsers/windmill-parser-py-imports/src/lib.rs:358
  • Draft comment:
    Changing to a mutable binding (let mut nested) to allow sorting is appropriate. Make sure that the derived ordering (Ord on NImport) indeed gives the intended deterministic order.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50%
    This comment is asking the author to ensure that the derived ordering is deterministic, which falls under the category of asking the author to confirm their intention or ensure behavior. This violates the rules.
3. backend/parsers/windmill-parser-py-imports/src/lib.rs:393
  • Draft comment:
    Sorting the nested imports reinforces determinism. Please ensure test cases cover cases with multiple relative imports.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50%
    The comment is asking the PR author to ensure that test cases cover specific scenarios. This falls under the rule of not asking the author to ensure that their change is tested or similar. Therefore, this comment should be removed.
4. backend/parsers/windmill-parser-py-imports/src/lib.rs:103
  • Draft comment:
    Typo in comment: Consider changing 'Automatically inferenced requirement' to 'Automatically inferred requirement' for clarity.
  • 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_kvCzPrtBdbwbSoKX


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

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 b27b992 in 1 minute and 50 seconds

More details
  • Looked at 20 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 5 drafted comments based on config settings.
1. backend/parsers/windmill-parser-py-imports/src/lib.rs:252
  • Draft comment:
    Using .unique() replaces the previous sorting behavior. If the import order matters for downstream resolution, consider whether preserving the original order (first occurrence) is intended. Document this change if it's deliberate.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 10% vs. threshold = 50%
    The imports being processed here are requirements/dependencies, not actual Python import statements. The order of these doesn't matter for dependency resolution - what matters is the version constraints. Looking at the broader context, these imports are being processed for dependency management, not for Python's import resolution order. The previous sort() was likely just for deterministic output, not for functional reasons.
    I could be wrong about the purpose of the sorting - maybe there is some subtle dependency resolution order that matters that I'm missing.
    Looking at the code more carefully, the imports at this stage are already processed and flattened into just version requirements. The order truly doesn't matter anymore since we're past the import resolution phase.
    The comment should be deleted. The order of dependency requirements doesn't matter at this stage of processing, and the previous sort() was not functionally important.
2. backend/parsers/windmill-parser-py-imports/src/lib.rs:254
  • Draft comment:
    The removal of sort() in favor of .unique() changes the ordering from sorted to first-occurrence order. Ensure this is the intended behavior; if a sorted order is required for reproducibility, consider sorting after deduplication.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 0% vs. threshold = 50%
    Looking at the code context:
  1. This is in a function that parses Python imports
  2. The imports are used to build a list of requirements/dependencies
  3. The order of dependencies generally doesn't matter for Python package management
  4. Earlier in the file (L351-358), there is explicit sorting of imports based on type (Repins, Pins, Auto, Relative) which is the important ordering
  5. This final sorting was likely just for determinism but not functionally required
    The comment is technically correct - the ordering does change. And deterministic output can sometimes be valuable for testing and reproducibility.
    However, the important ordering (by import type) is handled earlier in the code. This final sort was not functionally required, and Python package management is not sensitive to dependency order.
    The comment should be deleted. While technically correct, the ordering change is not important enough to warrant a comment since it doesn't affect functionality.
3. backend/parsers/windmill-parser-py-imports/src/lib.rs:103
  • Draft comment:
    Typo: Consider changing 'Automatically inferenced requirement' to 'Automatically inferred requirement'.
  • 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/parsers/windmill-parser-py-imports/src/lib.rs:277
  • Draft comment:
    Typo: In the comment, 'Check if there are multiple annotated version' should likely be 'Check if there are multiple annotated versions'.
  • 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/parsers/windmill-parser-py-imports/src/lib.rs:282
  • Draft comment:
    Typo: The phrase 'replace on flight' should likely be 'replace on the fly'.
  • 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_DhvGJQ9NdHSwSlEu


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

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 83b8cd2 in 48 seconds

More details
  • Looked at 13 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 3 drafted comments based on config settings.
1. backend/parsers/windmill-parser-py-imports/src/lib.rs:102
  • Draft comment:
    Typo fixed: 'Automatically inferenced requirement' has been corrected to 'Automatically inferred requirement'.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50%
    None
2. backend/parsers/windmill-parser-py-imports/src/lib.rs:100
  • Draft comment:
    Typo fix: replaced 'Automatically inferenced requirement' with 'Automatically inferred requirement'.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50%
    None
3. backend/parsers/windmill-parser-py-imports/src/lib.rs:64
  • Draft comment:
    Typo: In the variable name 'imprt' on line 64, it seems you intended to use 'import'. Consider renaming it for clarity.
  • 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_uzlQHbmzVRfD3Mub


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

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 e7f193d in 41 seconds

More details
  • Looked at 56 lines of code in 2 files
  • Skipped 0 files when reviewing.
  • Skipped posting 4 drafted comments based on config settings.
1. backend/.sqlx/query-443bd83bcea1d37c79cb080095343c98104529879f991c49585cd181e34aa827.json:3
  • Draft comment:
    Consider revising SQL query formatting for improved readability. The current indentation mixes spaces and newlines, making it slightly harder to follow.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50%
    None
2. backend/.sqlx/query-ac01e45d3335015f53f3d63fe159e631efb65c3d326b6b6ae8361a2116bff145.json:1
  • Draft comment:
    Removal of the obsolete query file detected. Verify that no parts of the codebase reference this query.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50%
    None
3. backend/.sqlx/query-443bd83bcea1d37c79cb080095343c98104529879f991c49585cd181e34aa827.json:3
  • Draft comment:
    Consider standardizing the query string formatting (indentation/newlines) for better readability.
  • Reason this comment was not posted:
    Confidence changes required: 30% <= threshold 50%
    None
4. backend/.sqlx/query-ac01e45d3335015f53f3d63fe159e631efb65c3d326b6b6ae8361a2116bff145.json:1
  • Draft comment:
    Ensure the removal of this duplicate query file is fully reflected in all references.
  • 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_yjzVLgGrFrpynmlR


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

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 195a472 in 44 seconds

More details
  • Looked at 22 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 5 drafted comments based on config settings.
1. backend/parsers/windmill-parser-py-imports/src/lib.rs:173
  • Draft comment:
    Changing nimports from immutable to mutable to allow in-place sorting is clear. Ensure that the Ord implementation for NImport gives the intended sort order.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50%
    None
2. backend/parsers/windmill-parser-py-imports/src/lib.rs:217
  • Draft comment:
    Sorting the collected imports ensures deterministic output. Verify that this sort aligns with the intended priority of import types.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50%
    None
3. backend/parsers/windmill-parser-py-imports/src/lib.rs:173
  • Draft comment:
    Changing the vector to mutable for later sorting is fine. Please confirm that the derived Ord for NImport reflects the intended import resolution order (Repin, Pin, Auto, Relative).
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50%
    This comment is asking the PR author to confirm their intention regarding the order of Ord for NImport. It doesn't provide a specific suggestion or point out a potential issue, but rather asks for confirmation, which violates the rules.
4. backend/parsers/windmill-parser-py-imports/src/lib.rs:217
  • Draft comment:
    Sorting the collected imports ensures stable order for resolution. Verify that this order (via derived sorting) is aligned with the intended resolution priorities.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50%
    The comment is asking the PR author to verify the order of imports, which is not allowed according to the rules. It doesn't provide a specific suggestion or point out a clear issue with the code.
5. backend/parsers/windmill-parser-py-imports/src/lib.rs:64
  • Draft comment:
    Typo detected: the variable name 'imprt' on line 64 appears to be missing an 'o'. Consider renaming it to 'import' for clarity.
  • 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_z5Zj8Kf1bRYJLPtz


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

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 7fae4bc in 1 minute and 50 seconds

More details
  • Looked at 22 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 5 drafted comments based on config settings.
1. backend/parsers/windmill-parser-py-imports/src/lib.rs:257
  • Draft comment:
    Sorting imports for deterministic output is good. Consider adding a short comment to note that lexicographical order is intended and, if order stability isn't critical, using sort_unstable might be a slight optimization.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 10% vs. threshold = 50%
    Looking at the broader context, this is a parser for Python imports that collects and deduplicates imports. The sorting is likely just to provide a consistent order. The suggestion to use sort_unstable() is a micro-optimization that likely won't have meaningful impact given the small size of typical import lists. The comment about documenting lexicographical order seems unnecessary since alphabetical sorting is a common default that doesn't need explanation.
    The comment does point out a potential minor performance optimization. Maybe there's a case where sorting performance matters significantly?
    Given this is a parser for Python imports, the number of imports will typically be small (less than 100), so sorting performance is not a bottleneck. The difference between sort() and sort_unstable() would be negligible.
    The comment suggests minor optimizations and documentation that don't provide meaningful value given the context and typical use case.
2. backend/parsers/windmill-parser-py-imports/src/lib.rs:227
  • Draft comment:
    Changed binding to mutable so .sort() can be called. This looks fine.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50%
    None
3. backend/parsers/windmill-parser-py-imports/src/lib.rs:257
  • Draft comment:
    Sorting the imports ensures a consistent (deterministic) order in the output.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50%
    None
4. backend/parsers/windmill-parser-py-imports/src/lib.rs:64
  • Draft comment:
    The variable name 'imprt' in line 64 appears to be a typo. Consider renaming it to 'import' for clarity.
  • 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/parsers/windmill-parser-py-imports/src/lib.rs:52
  • Draft comment:
    The variable 'splitted_path' defined around line 52 might be better named as 'split_path' or simply 'parts' to avoid the non-standard usage of 'splitted'.
  • 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_7T91UzI2icB6YBkg


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

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 b848be1 in 1 minute and 10 seconds

More details
  • Looked at 233 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 17 drafted comments based on config settings.
1. backend/parsers/windmill-parser-py-imports/src/lib.rs:69
  • Draft comment:
    Formatting update: spacing for NImport::Auto initializer is now consistent.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50%
    None
2. backend/parsers/windmill-parser-py-imports/src/lib.rs:95
  • Draft comment:
    Struct variants Repin and Pin now use multiline formatting. This improves readability without logic change.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50%
    None
3. backend/parsers/windmill-parser-py-imports/src/lib.rs:168
  • Draft comment:
    Minor reformatting inside the find_pin closure. No functional changes.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50%
    None
4. backend/parsers/windmill-parser-py-imports/src/lib.rs:186
  • Draft comment:
    Reformatted the filter_map for Stmt::Import. The logic remains unchanged.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50%
    None
5. backend/parsers/windmill-parser-py-imports/src/lib.rs:270
  • Draft comment:
    The compile_error_hint update is only reformatting for consistency.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50%
    None
6. backend/parsers/windmill-parser-py-imports/src/lib.rs:425
  • Draft comment:
    Minor reformatting in match arms for NImport::Auto. No logic change.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50%
    None
7. backend/parsers/windmill-parser-py-imports/src/lib.rs:69
  • Draft comment:
    Formatting: Added space in NImport::Auto initialization for consistency.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50%
    None
8. backend/parsers/windmill-parser-py-imports/src/lib.rs:92
  • Draft comment:
    Formatting: Enum variants (Repin, Pin) now use multi-line definitions for improved readability.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50%
    None
9. backend/parsers/windmill-parser-py-imports/src/lib.rs:121
  • Draft comment:
    Formatting: Added space in the ImportPin struct definition for consistency.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50%
    None
10. backend/parsers/windmill-parser-py-imports/src/lib.rs:166
  • Draft comment:
    Formatting: Improved indentation in the find_pin closure (use of braces in NImport::Pin/Repin).
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50%
    None
11. backend/parsers/windmill-parser-py-imports/src/lib.rs:183
  • Draft comment:
    Refactored: Chained method calls in the Stmt::Import match arm for improved clarity.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50%
    None
12. backend/parsers/windmill-parser-py-imports/src/lib.rs:207
  • Draft comment:
    Refactored: Chained method calls in the Stmt::ImportFrom match arm; behavior remains unchanged.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50%
    None
13. backend/parsers/windmill-parser-py-imports/src/lib.rs:265
  • Draft comment:
    Formatting: Cleaned up compile_error_hint chaining for improved readability.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50%
    None
14. backend/parsers/windmill-parser-py-imports/src/lib.rs:330
  • Draft comment:
    Formatting: Reorganized multi-line blocks for inserting requirements (NImport::Repin) to enhance readability.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50%
    None
15. backend/parsers/windmill-parser-py-imports/src/lib.rs:425
  • Draft comment:
    Formatting: Consistent spacing in pattern matching for NImport::Auto.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50%
    None
16. backend/parsers/windmill-parser-py-imports/src/lib.rs:489
  • Draft comment:
    Formatting: Removed extraneous newline in the NImport::Pin match arm for cleaner code flow.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50%
    None
17. backend/parsers/windmill-parser-py-imports/src/lib.rs:64
  • Draft comment:
    Typo spotted: The variable name 'imprt' in the process_import function (line 64) seems to be a misspelling of 'import'. Consider renaming it for clarity.
  • 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_hr9EXa0FkxIhsl0L


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

@pyranota pyranota changed the title feat(python): per import requirment pin feat(python): per import requirement pin Mar 28, 2025
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 5e276c1 in 2 minutes and 6 seconds

More details
  • Looked at 44 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 11 drafted comments based on config settings.
1. backend/windmill-worker/src/python_executor.rs:1453
  • Draft comment:
    Using tuple destructuring assignment for (requirements, compilation_error_hint) is less common. Ensure that the Rust version used supports this fully and consider adding explicit type annotations for clarity.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 50% <= threshold 50%
    The comment suggests ensuring compatibility with the Rust version, which is not allowed. However, it also suggests adding explicit type annotations for clarity, which is a valid suggestion. The comment is partially useful.
2. backend/windmill-worker/src/python_executor.rs:1385
  • Draft comment:
    Typo in error message text: 'last part of path ma' likely should be 'last part of path match'.
  • 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/python_executor.rs:1441
  • Draft comment:
    The use of an uninitialized mutable variable and shadowing (declaring let mut requirements; and then shadowing it with let requirements = match requirements_o { ... }) is confusing. Consider refactoring to avoid this pattern.
  • 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/python_executor.rs:1442
  • Draft comment:
    The variable compilation_error_hint is declared without an initial value and only set in the None branch. Initialize it or refactor to ensure it’s always safely used.
  • 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/python_executor.rs:1384
  • Draft comment:
    Typo in error message for secret variable. The message says "(last part of path ma)" – likely it should read "match" or a clearer phrase.
  • 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/python_executor.rs:1583
  • Draft comment:
    In spawn_uv_install, a reference to a local _owner is pushed into vars (via vars.push(("PY_PATH", &_owner))). Ensure that the envs API clones the value so there’s no risk of a dangling reference.
  • 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/python_executor.rs:1832
  • Draft comment:
    When constructing the virtual environment path from the requirement string via replacements (e.g. using req.replace(' ', "").replace('/', "").replace(':', "")), consider a more robust sanitization (or hashing) to avoid collisions or unexpected characters.
  • 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-worker/src/python_executor.rs:1380
  • Draft comment:
    Avoid using unwrap() on regex captures in replace_pip_secret. It would be safer to handle the capture with an if let to prevent a potential panic if the capture fails unexpectedly.
  • 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.
9. backend/windmill-worker/src/python_executor.rs:721
  • Draft comment:
    Typo found in the comment: 'It is guranteed that additional_python_paths only contains paths within windmill/cache/'. Please correct 'guranteed' to 'guaranteed'.
  • 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.
10. backend/windmill-worker/src/python_executor.rs:932
  • Draft comment:
    Typo detected in the variable name in the wrapper content: 'kwrags_json'. Consider renaming it to 'kwargs_json' for clarity.
  • 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.
11. backend/windmill-worker/src/python_executor.rs:1384
  • Draft comment:
    Typo found in error message: 'invalid secret variable in pip requirements, (last part of path ma): {}'. The 'ma' is likely a typo; please verify and correct it (possibly to 'match' or the intended word).
  • 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_4btHUmywRSVe4lEY


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

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 5348acd in 3 minutes and 7 seconds

More details
  • Looked at 271 lines of code in 2 files
  • Skipped 0 files when reviewing.
  • Skipped posting 14 drafted comments based on config settings.
1. backend/tests/fixtures/lockfile_python.sql:3927
  • Draft comment:
    The tests for python dependency pinning (especially for extra_requirements and repin behavior) are very comprehensive. Consider adding inline comments or documentation in the test file to clarify the expected resolution order when both 'pin' and 'repin' directives are used, which will help future developers understand the rules without having to decipher the expected output.
  • 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/tests/worker.rs:3979
  • Draft comment:
    The test 'test_extra_requirements_python2' correctly asserts that lock file generation includes both the extra requirement for tiny and the pinned version for simplejson. Ensure the logic for merging extra_requirements and requirement pins is clearly documented in both tests and implementation.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 20% <= threshold 50%
    The comment is asking for documentation in both tests and implementation, which is not specific enough to be actionable. It doesn't suggest a specific change or improvement to the code itself, nor does it point out a potential issue or ask for a specific test to be written. It seems to be more of a general request for documentation, which doesn't align with the rules provided.
3. backend/tests/worker.rs:4007
  • Draft comment:
    In 'test_pins_python', the expected lock file includes multiple dependencies from different sources ('requirements', 'pins'). It might be helpful to add a brief comment describing why the specific versions (like 'microdot==2.2.0') are expected and how conflicts between direct pins and repins are resolved.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50%
    The comment is asking for additional comments in the code to explain why specific versions are expected and how conflicts are resolved. This is a request for clarification and documentation, which is not allowed according to the rules. The comment does not provide a specific code suggestion or point out a potential issue with the code itself.
4. backend/tests/worker.rs:4267
  • Draft comment:
    Mutating global version flags in test_for_versions may lead to order dependencies or concurrency issues. Consider isolating these flags or ensuring serial test execution.
  • 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/tests/worker.rs:3805
  • Draft comment:
    Relative Python imports using leading dots (e.g. 'from .same_folder_script import ...') might fail if package is not configured correctly in the test environment.
  • 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/tests/worker.rs:3377
  • Draft comment:
    Using a 5000ms timeout for schedule handler events could lead to flaky tests on slower systems. Consider a more robust timeout or environment configuration.
  • 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/tests/worker.rs:4145
  • Draft comment:
    The update query in test_job_labels relies on setting labels via a sorted vector. This may be brittle if the database returns labels in a different order.
  • Reason this comment was not posted:
    Confidence changes required: 50% <= threshold 50%
    None
8. backend/tests/worker.rs:3899
  • Draft comment:
    Multiple unwrap() calls are used; while acceptable in tests, using the '?' operator could provide clearer error context.
  • Reason this comment was not posted:
    Confidence changes required: 40% <= threshold 50%
    None
9. backend/tests/worker.rs:4707
  • Draft comment:
    The pattern matching using 'let FlowStatusModule::Success { job, .. } = ... else { panic!(...) }' is correct, but consider adding a more descriptive error message in the panic for clarity.
  • Reason this comment was not posted:
    Confidence changes required: 40% <= threshold 50%
    None
10. backend/tests/worker.rs:4916
  • Draft comment:
    Hardcoded expected output strings in test_raw_flow_payload_with_restarted_from can be brittle. Consider extracting these expected values as constants or documenting the expected format explicitly.
  • Reason this comment was not posted:
    Confidence changes required: 50% <= threshold 50%
    None
11. backend/tests/worker.rs:3688
  • Draft comment:
    The functions run_deployed_relative_imports and run_preview_relative_imports share similar logic. Consider refactoring them to reduce 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.
12. backend/tests/worker.rs:3970
  • Draft comment:
    Test for extra requirements relies on a specific order (joined by '\n'). Ensure that dependency ordering is deterministic to avoid flaky tests.
  • Reason this comment was not posted:
    Comment looked like it was already resolved.
13. backend/tests/worker.rs:4024
  • Draft comment:
    In test_pins_python, verify that the pin resolution logic properly prioritizes dependency versions. The expected lock file includes multiple pins; ensure this order reflects the intended override behavior.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50%
    The comment is asking the PR author to verify the behavior of the pin resolution logic and ensure it reflects the intended override behavior. This falls under asking the author to confirm their intention and ensure behavior, which is against the rules.
14. backend/tests/fixtures/lockfile_python.sql:42
  • Draft comment:
    Typographical error: In the third INSERT statement (line 42), the SQL script imports 'tiny' with a comment stating '# pin: bottle==0.13.2'. This seems like an accidental mismatch. Verify whether the intended module is 'bottle' (and update the import accordingly) or adjust the comment if different.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 10% vs. threshold = 50%
    This is a test fixture file, so these scripts are likely intentionally set up this way to test different scenarios. The mismatch between importing 'tiny' but pinning 'bottle' in the third script could be intentional to test how the system handles such cases. Without knowing the test's purpose, suggesting a change could actually break the test case.
    I could be wrong - maybe this is actually a copy-paste error and the test fixture really should be consistent. The comment might be pointing out a genuine issue.
    However, test fixtures often intentionally include edge cases and "wrong" configurations to verify system behavior. Making assumptions about the intended behavior and suggesting changes could interfere with test coverage.
    The comment should be deleted because it makes assumptions about the intended behavior of a test fixture without sufficient context to know if the "mismatch" is actually a bug.

Workflow ID: wflow_sswQCfyS15B3bLik


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

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 c925304 in 1 minute and 55 seconds

More details
  • Looked at 30 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 5 drafted comments based on config settings.
1. backend/parsers/windmill-parser-py-imports/src/lib.rs:161
  • Draft comment:
    Good improvement by extracting the substring into a variable. Consider adding a brief inline comment explaining why returning None on an empty trimmed line is desired behavior.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50%
    None
2. backend/parsers/windmill-parser-py-imports/src/lib.rs:161
  • Draft comment:
    Consider using string slicing (e.g., splitting on '\n') instead of iterating over .chars() for potential performance and clarity, if UTF-8 guarantees hold.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50%
    None
3. backend/parsers/windmill-parser-py-imports/src/lib.rs:162
  • Draft comment:
    Consider renaming the variable 'hs' to a more descriptive name (e.g. remaining_line or post_pin_text) and adding a brief comment to explain the purpose of checking trim_start().is_empty(). This will improve readability.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 20% vs. threshold = 50%
    While better variable names are generally good, this suggestion is not critical. The variable is short-lived (only used for a few lines) and its purpose is fairly clear from context - it's getting the remaining text on the line. The empty check is also straightforward - if there's nothing after trimming whitespace, return None. This feels more like a style preference than a necessary change.
    The variable name could be confusing to new contributors, and documenting the empty check logic could help maintainability.
    The scope is very limited and the logic is simple enough that the current code is understandable without these changes. The function itself is already well-named as find_pin which provides good context.
    While better names and docs can be helpful, this suggestion is not critical enough to warrant a comment, given the limited scope and straightforward logic.
4. backend/parsers/windmill-parser-py-imports/src/lib.rs:550
  • Draft comment:
    Typographical error: The entry '-bootsubprocess' appears to be a typo. It might be intended to be '-subprocess' (or another valid module name) so please double-check and correct it if needed.
  • 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/parsers/windmill-parser-py-imports/src/lib.rs:845
  • Draft comment:
    There is an empty string as the last element in the STDIMPORTS array. If this is unintentional, please remove the empty string.
  • 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_sKuqsTYhtAvE9U7B


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

@rubenfiszel rubenfiszel merged commit 0b6d017 into main Apr 11, 2025
7 of 8 checks passed
@rubenfiszel rubenfiszel deleted the py-pin-annotation branch April 11, 2025 21:31
@github-actions github-actions bot locked and limited conversation to collaborators Apr 11, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants