-
Notifications
You must be signed in to change notification settings - Fork 619
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
feat: MQTT triggers #5277
base: main
Are you sure you want to change the base?
feat: MQTT triggers #5277
Conversation
Deploying windmill with
|
Latest commit: |
cf15245
|
Status: | ✅ Deploy successful! |
Preview URL: | https://319dbf9c.windmill.pages.dev |
Branch Preview URL: | https://dieri-mqtt-trigger-captures.windmill.pages.dev |
30f0807
to
9c57565
Compare
3a05600
to
3b6585a
Compare
… misses client impleme
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.
❌ Changes requested. Reviewed everything up to c9aff53 in 7 minutes and 32 seconds
More details
- Looked at
6364
lines of code in80
files - Skipped
0
files when reviewing. - Skipped posting
60
drafted comments based on config settings.
1. frontend/src/lib/components/sidebar/SidebarContent.svelte:140
- Draft comment:
Good inclusion of the MQTT triggers link with proper permission check. - Reason this comment was not posted:
Confidence changes required:0%
<= threshold50%
None
2. frontend/src/lib/components/triggers.ts:70
- Draft comment:
The switch case now includes a 'mqtt' case; validate that captureTriggerKindToTriggerKind mapping is consistent with backend. - Reason this comment was not posted:
Confidence changes required:0%
<= threshold50%
None
3. frontend/src/lib/components/triggers/CaptureButton.svelte:134
- Draft comment:
The new button for 'mqtt' trigger appears consistent with others; ensure UX consistency in labeling. - Reason this comment was not posted:
Confidence changes required:0%
<= threshold50%
None
4. frontend/src/lib/components/triggers/mqtt/MqttEditorConfigSection.svelte:28
- Draft comment:
Bindings for MQTT specific configuration (client_version, mqtt_resource_path, subscribe_topics, client_id) are properly set. Verify DEFAULT_V3_CONFIG and DEFAULT_V5_CONFIG suit your requirements. - Reason this comment was not posted:
Confidence changes required:0%
<= threshold50%
None
5. frontend/src/lib/components/triggers/mqtt/MqttTriggerEditorInner.svelte:91
- Draft comment:
The loadTrigger function uses $workspaceStore correctly to fetch MQTT trigger. Consider additional error handling if backend returns non-standard errors. - Reason this comment was not posted:
Confidence changes required:33%
<= threshold50%
None
6. frontend/src/lib/components/triggers/TriggersEditor.svelte:66
- Draft comment:
The ToggleButtonGroup configuration now includes MQTT in event stream selection. Verify that the 'otherValues' array in Tab includes 'mqtt' as intended. - Reason this comment was not posted:
Confidence changes required:0%
<= threshold50%
None
7. frontend/src/routes/(root)/(logged)/mqtt_triggers/+page.svelte:39
- Draft comment:
Loading and periodic updating of MQTT triggers seem implemented correctly; ensure proper cancellation on component destroy. - Reason this comment was not posted:
Confidence changes required:0%
<= threshold50%
None
8. frontend/src/routes/(root)/(logged)/scripts/get/[...hash]/+page.svelte:91
- Draft comment:
MQTT triggers panel inclusion in script view looks consistent; check that all trigger panels render appropriately when 'mqtt' is selected. - Reason this comment was not posted:
Confidence changes required:0%
<= threshold50%
None
9. frontend/src/lib/components/triggers/CaptureWrapper.svelte:119
- Draft comment:
Good use of a switch to set default arguments for MQTT triggers. Consider explicitly typing the default client_version (currently 'v5') to match the expected enum so that future changes in type are caught at compile time. - 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. frontend/src/lib/components/triggers/TestTriggerConnection.svelte:15
- Draft comment:
The MQTT branch in testTriggerConnection is integrated consistently. Ensure that the error handling (using error.body) works as expected if the error object structure changes. - Reason this comment was not posted:
Comment did not seem useful. Confidence is useful =0%
<= threshold50%
This comment is asking the PR author to ensure that the error handling works as expected if the error object structure changes. This falls under the category of asking the author to double-check or ensure behavior, which is against the rules.
11. frontend/src/lib/components/triggers/TriggersEditor.svelte:65
- Draft comment:
Including 'mqtt' in otherValues for the 'kafka' tab ensures MQTT is grouped with other event streams. Verify that the UI label remains clear to users. - Reason this comment was not posted:
Comment did not seem useful. Confidence is useful =0%
<= threshold50%
The comment is asking the PR author to verify the behavior of including 'mqtt' in 'otherValues' for the 'kafka' tab. This falls under asking the author to confirm their intention or ensure behavior, which is against the rules.
12. frontend/src/lib/components/triggers/TriggersWrapper.svelte:75
- Draft comment:
The new MQTT branch rendering is clear. Confirm that all required bindings (v3_config, v5_config, client_version, subscribe_topics, mqtt_resource_path, client_id) are available from the args. - Reason this comment was not posted:
Comment did not seem useful. Confidence is useful =0%
<= threshold50%
The comment is asking the PR author to confirm the availability of certain bindings from the arguments. This falls under the category of asking the author to double-check or confirm something, which is against the rules.
13. frontend/src/lib/components/triggers/mqtt/MqttEditorConfigSection.svelte:51
- Draft comment:
The connection setup and topics sections are well structured. Consider adding user feedback (e.g. error messages) if the subscribe_topics array is empty, since isValid is tied to its length. - 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 UI already indicates that topics are required through the Required component. The CaptureSection being disabled provides implicit feedback. Adding explicit error messages would be redundant since the required nature is already communicated. This seems like a UI/UX suggestion rather than a critical code issue.
The comment raises a valid UX concern about providing clear feedback to users. The current Required indicator might be subtle.
However, this is a UI/styling suggestion about error states, which our rules explicitly say we should not comment on. We should assume the UI/UX decisions were intentional.
Delete the comment since it relates to UI feedback design rather than code logic issues, and our rules state we should not comment on pure UI/styling changes.
14. frontend/src/lib/components/triggers/mqtt/MqttTriggersPanel.svelte:48
- Draft comment:
The periodic refresh (setInterval every 5 seconds) is useful for live updates. Consider whether this polling interval is optimal for performance in production if many triggers are present. - Reason this comment was not posted:
Comment was on unchanged code.
15. frontend/src/lib/components/triggers/mqtt/constant.ts:3
- Draft comment:
Constants for DEFAULT_V5_CONFIG and DEFAULT_V3_CONFIG are clearly defined. Ensure these defaults are updated if the schema for MqttV5Config or MqttV3Config changes. - Reason this comment was not posted:
Comment did not seem useful. Confidence is useful =0%
<= threshold50%
The comment is asking the author to ensure that constants are updated if certain schemas change. This falls under asking the author to ensure something is done, which is against the rules. The comment does not provide a specific suggestion or point out a specific issue with the code.
16. frontend/src/lib/script_helpers.ts:232
- Draft comment:
The preprocessor module code now includes 'mqtt' in the allowed kinds. This update appears consistent across both BUN and DENO modules. - 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.
17. frontend/src/routes/(root)/(logged)/mqtt_triggers/+page.svelte:1
- Draft comment:
The page for MQTT triggers is properly set up, with a relevant title. Ensure that the UI components for MQTT integration match the functionality of other trigger types. - Reason this comment was not posted:
Comment did not seem useful. Confidence is useful =0%
<= threshold50%
This comment is asking the PR author to ensure that the UI components for MQTT integration match the functionality of other trigger types. It is not making a specific suggestion or pointing out a specific issue with the code. It falls under the category of asking the author to ensure something, which is against the rules.
18. frontend/src/routes/(root)/(logged)/scripts/get/[...hash]/+page.svelte:250
- Draft comment:
The addition of the MQTT triggers slot is consistent with other trigger types. Verify that the MqttTriggersPanel is rendered correctly when a script is loaded. - 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.
19. .github/workflows/publish_windows_worker.yml:46
- Draft comment:
Typographical error: The environment variable '$env:VCPKGRS_DYNAMIC' on line 46 appears to have a typo. Did you mean to name it '$env:VCPKG_DYNAMIC' (or another intended name)? Please verify and correct 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.
20. backend/.sqlx/query-186aef850c2eeb89c186ac6b2934dd3a703e2b9428096801e1d2d61fdbb99c9e.json:7
- Draft comment:
Typo detected: the parameter key 'Left' is capitalized. To maintain a consistent naming convention (as seen in other keys which use lower case), consider renaming it to 'left'. - 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%
- This is in a .sqlx directory which typically contains auto-generated files. 2. The file has a hash in its name, suggesting it's machine-generated. 3. The "Left" capitalization is likely intentional and part of the sqlx library's schema. 4. Modifying auto-generated files is generally not a good practice as they'll be overwritten.
What if the capitalization actually indicates something important in the sqlx schema? What if other files in the project do use lowercase and this is inconsistent?
Since this is clearly an auto-generated file (based on directory and hash), any style inconsistencies should be addressed in the generator, not in the generated file.
Delete this comment as it suggests modifying an auto-generated file, which would be overwritten on the next generation anyway.
21. backend/.sqlx/query-31b6fccad46b22bcbba6bbce22209ccb1825116004ed72682854ce3352f454a5.json:3
- Draft comment:
There is an inconsistency in casing for the SQL aliasing keyword. In some parts of the query, the alias operator is written as 'AS' while in other parts it is written as 'as'. Consider standardizing the casing (preferably using 'AS' throughout) for improved 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 the comment is technically correct about the inconsistency, I need to consider if this is important enough to flag. SQL keywords are case-insensitive, and this is purely a style issue. The code works perfectly fine either way. The comment also provides a concrete suggestion for standardization. However, per the rules, we should avoid purely stylistic comments unless they significantly impact readability or maintainability.
The inconsistency is minor and doesn't affect functionality. Many SQL style guides don't even specify casing requirements for keywords.
However, consistency in code style does help with maintainability and readability, and this is a new file where establishing good practices is important.
While the comment is accurate, it addresses a very minor style issue that doesn't significantly impact code quality. Per the rules about avoiding obvious or unimportant comments, this should be removed.
22. backend/.sqlx/query-548a1424a6b9ac9998b8fc5312bcff671ee7fe59154e9ef32800c117e64bce19.json:32
- Draft comment:
The alias 'trigger_config!: _' used in the query and describe sections appears to be a typographical error. Please confirm if the extra characters ('!: _') are intentional; if not, consider correcting it to the intended column name (possibly 'trigger_config'). - 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 "!: _" syntax looks unusual but appears intentional since it's used consistently in both the query and describe sections. This is likely Rust-specific SQLX syntax for type handling. Without deeper knowledge of SQLX and Rust type system, we shouldn't assume this is a typo. The suggestion to remove it could break type handling.
I might be missing some context where this syntax is actually incorrect. The consistent usage doesn't guarantee correctness.
Even if there's a chance it's incorrect, we don't have strong evidence that this is a typo. The consistency suggests intentional usage, and modifying type-related syntax without understanding it is risky.
Delete this comment. The unusual syntax appears intentional and is likely related to SQLX/Rust type handling. Without strong evidence that it's incorrect, we shouldn't suggest changing it.
23. backend/.vscode/settings.json:13
- Draft comment:
Typo detected: The word 'restructring' on line 13 is likely a misspelling of 'restructuring'. Please correct it. - Reason this comment was not posted:
Comment was on unchanged code.
24. backend/Cargo.toml:29
- Draft comment:
It appears that in the workspace members list the entry for windmill-macros is duplicated. The first instance (line 18) correctly uses "./windmill-macros", but the second instance (line 29) is listed as "windmill-macros" without the './' prefix, which is inconsistent. Please remove or correct the duplicate to ensure a consistent path. - 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.
25. backend/migrations/20250207172929_mqtt_trigger.up.sql:1
- Draft comment:
Consider revising the comment on line 1 from 'Add up migration script here' to something clearer like 'Add up migration script' or 'Add migration script for up migration' to improve clarity. - 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 about a trivial wording change in a comment that doesn't affect functionality. The existing comment is clear enough and follows standard migration comment format. This kind of nitpicking about comment wording doesn't help improve code quality and could be distracting.
Maybe clearer comments could help future developers better understand the migration's purpose? The suggested wording is marginally more descriptive.
The existing comment follows standard format and is sufficient. The suggested change doesn't add meaningful clarity and isn't worth the developer's time to change.
Delete this comment as it suggests a trivial change to a standard migration comment format that doesn't meaningfully improve code quality or clarity.
26. backend/migrations/20250207173304_add_mqtt_type_value_to_trigger_kind_type.down.sql:1
- Draft comment:
The file is missing a trailing newline. Adding a newline at the end of the file would adhere to POSIX best practices and prevent potential issues with some tools. - 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 missing trailing newlines can technically cause issues with some tools, this is a placeholder migration file that will need to be modified anyway. The comment is more about general file formatting than a specific code change. Most modern IDEs and git tools handle this automatically. This seems like an overly pedantic comment for a placeholder file.
The missing newline could potentially cause merge conflicts or issues with some SQL tools. Maybe this is more important for SQL files specifically?
The file is clearly a placeholder that will be modified later with actual migration code. Any formatting issues will be addressed when the real content is added.
Delete the comment. It's too minor of an issue for a placeholder file, and it will likely be resolved naturally when the actual migration code is added.
27. backend/windmill-api/openapi.yaml:5798
- Draft comment:
Typo: 'exisst' should be corrected to 'exists' in the summary for the endpoint '/w/{workspace}/apps/exists/{path}'. - 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.
28. backend/windmill-api/openapi.yaml:6949
- Draft comment:
Typo: The operationId 'getJob logs' should be 'getJobLogs' without a space. - 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.
29. backend/windmill-api/src/mqtt_triggers.rs:445
- Draft comment:
Typo detected: "occured" should be spelled "occurred" in timeout error messages. Please correct it wherever it appears. - 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 spelling errors should be fixed, the review rules state not to make comments that are obvious or unimportant. A spelling error in an error message that rarely appears to users is relatively minor. The error message is only shown when there's a timeout connecting to the MQTT broker. Additionally, the comment only suggests fixing one instance when there are multiple instances of the same misspelling.
The spelling error could affect user experience and code quality. Error messages should be professional and correct. Multiple instances of the same error suggest a systematic issue.
However, this is a very minor issue that doesn't affect functionality. The error message is rarely seen by users and the misspelling doesn't impede understanding. The rules explicitly say not to make unimportant comments.
The comment should be deleted as it violates the rule about not making unimportant comments. The spelling error is minor and doesn't significantly impact the code or user experience.
30. backend/windmill-api/src/mqtt_triggers.rs:609
- Draft comment:
Typo detected: 'commiting' should be corrected to 'committing' in the debug message. - 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 comment is technically correct about the typo, debug messages are not user-facing and only appear in logs when debugging. The typo does not affect functionality. According to the rules, we should not make comments that are obvious or unimportant. A typo in a debug message is very low impact.
The typo could theoretically make logs slightly harder to search for if someone was specifically searching for "committing". However, the context makes it clear what the message means regardless.
The extremely minor benefit of fixing this typo does not justify the overhead of a PR comment and review cycle. Debug messages are internal-only and the meaning is clear despite the typo.
This comment should be deleted as it addresses a trivial typo in debug-only code that does not impact functionality or user experience.
31. backend/windmill-api/src/resources.rs:1237
- Draft comment:
There's a grammatical/typographical error in the error message string in try_get_resource_from_db_as. The message reads "resource at path :{} do not exist". Consider revising it to something like "resource at path {} does not exist" 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.
32. backend/windmill-api/src/workspaces.rs:1887
- Draft comment:
Typo: The error message uses 'Usermame' instead of 'Username'. Please correct it to 'Username can only contain alphanumeric characters and underscores and must start with a letter'. - 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.
33. backend/windmill-api/src/workspaces.rs:2203
- Draft comment:
Typo: The log message string contains 'criticital' which should be corrected to 'critical'. - 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.
34. cli/gen/services.gen.ts:367
- Draft comment:
Typo in comment: 'is domain allowed for auto invi' should probably be 'is domain allowed for auto invite'. - 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.
35. cli/gen/services.gen.ts:1043
- Draft comment:
Typo in comment: 'require to be super amdin' should be 'require to be super admin'. - 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.
36. cli/gen/services.gen.ts:4309
- Draft comment:
Typo in comment: 'make the run invisible to the the flow owner' has a duplicated 'the'. - 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.
37. cli/gen/services.gen.ts:2941
- Draft comment:
Typo in function name: 'geDefaultTags' is likely a misspelling of 'getDefaultTags'. - 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.
38. cli/gen/services.gen.ts:7131
- Draft comment:
Typo in function description: 'remove user to group' should be 'remove user from group'. - 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.
39. cli/gen/types.gen.ts:5156
- Draft comment:
Typo: The phrase 'non non started job' appears here. Consider revising it to something like 'non-started job' or 'job that has not started' 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.
40. cli/gen/types.gen.ts:4871
- Draft comment:
Typo: The word 'waitinf' appears in the comment (e.g. "hence waitinf for a worker"). It should be corrected to 'waiting'. - 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.
41. cli/gen/types.gen.ts:2661
- Draft comment:
Typo: The comment reads 'List of headers's keys (separated with ',') whove value are added to the args'. The word 'whove' should be corrected to 'whose'. - Reason this comment was not posted:
Comment was on unchanged code.
42. cli/sync.ts:1818
- Draft comment:
Minor: In the option description for '--skip-resources', there's a double space in 'Skip syncing resources'. Please fix the extra space for consistency. - 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.
43. cli/sync.ts:1821
- Draft comment:
Minor: In the option description for '--include-schedules', there's a double space in 'Include syncing schedules'. Please remove the extra space. - 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.
44. frontend/src/lib/components/Path.svelte:32
- Draft comment:
Typo: The module name 'random_positive_adjetive' looks like it should be 'random_positive_adjective'. Consider correcting the spelling in the import statement to avoid confusion. - 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.
45. frontend/src/lib/components/ShareModal.svelte:114
- Draft comment:
Typographical error: 'modify its permisions' should be corrected to 'modify its permissions'. - 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.
46. frontend/src/lib/components/details/DetailPageDetailPanel.svelte:22
- Draft comment:
Typo found: Consider renaming 'simplfiedPoll' to 'simplifiedPoll' for clarity and consistency. - 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.
47. frontend/src/lib/components/details/DetailPageLayout.svelte:60
- Draft comment:
Typographical error: The prop name 'simplfiedPoll' appears to be a typo. It should likely be 'simplifiedPoll' to match the declared variable. Please correct it. - 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.
48. frontend/src/lib/components/details/DetailPageLayout.svelte:111
- Draft comment:
Typographical error: The prop name 'simplfiedPoll' is misspelled. It should be 'simplifiedPoll' for consistency. Please update accordingly. - 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.
49. frontend/src/lib/components/details/DetailPageTriggerPanel.svelte:32
- Draft comment:
Typo found: The variable 'simplfiedPoll' is misspelled. Consider renaming it to 'simplifiedPoll' for better readability and consistency. - Reason this comment was not posted:
Comment was on unchanged code.
50. frontend/src/lib/components/sidebar/OperatorMenu.svelte:68
- Draft comment:
Consider updating the label from 'Websocket triggers' to 'WebSocket triggers' for consistency with common naming conventions. - 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.
51. frontend/src/lib/components/sidebar/OperatorMenu.svelte:228
- Draft comment:
It looks like the href attribute on line 228 is using quotes with a curly brace expression ("{base}/user/workspaces"). To enable dynamic computation, please update it to use Svelte's binding syntax, for example: href={${base}/user/workspaces
}. - 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.
52. frontend/src/lib/components/triggers.ts:75
- Draft comment:
Typographical note: In the 'postgres' case, the return statement has two spaces between 'return' and '"postgres"' (line 75). While this doesn't affect functionality, it's a minor formatting inconsistency. Please adjust it to match the style used in other cases. - 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.
53. frontend/src/lib/components/triggers/CaptureWrapper.svelte:125
- Draft comment:
Typo: In the comment within the 'mqtt' case in the setDefaultArgs function, please change 'define these field' to 'define these fields' to accurately reflect that multiple fields are being initialized. - 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 the comment is technically correct about the grammar, it's just about a typo in a comment. Comments about documentation or comment text are generally not important enough to include in a PR review. The meaning is still clear despite the minor grammatical error.
The grammar error could theoretically make the code slightly less professional or harder to maintain. Some teams do care about documentation quality.
The grammatical error is so minor that it doesn't impact code understanding or maintainability. This kind of nitpick creates noise in PR reviews.
Delete this comment as it's too minor and doesn't affect code functionality or maintainability.
54. frontend/src/lib/components/triggers/mqtt/MqttEditorConfigSection.svelte:124
- Draft comment:
Minor typographical suggestion: Consider renaming the property 'collapsable' to 'collapsible' for consistency with common usage. - 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 this is technically about changed code since it's a new file, the suggestion is very minor and doesn't affect functionality. The word 'collapsable' is a valid alternative spelling, though 'collapsible' is more common. This seems more like a personal preference than a real issue. The comment doesn't point out a bug or significant code quality issue.
The spelling 'collapsable' might be consistently used across the codebase, making this change actually harmful to consistency. Also, this could be a prop name defined by the Subsection component that we can't change here.
Good points - without seeing the Subsection component definition, we can't know if changing this would even be possible. And consistency with existing code is more important than following general English preferences.
This comment should be deleted as it suggests a minor spelling change that may not even be possible to implement, and could harm codebase consistency.
55. frontend/src/lib/components/triggers/mqtt/MqttTriggerEditorInner.svelte:203
- Draft comment:
There is an inconsistency in the casing of 'mqtt'. In some messages it appears as 'mqtt trigger' (lowercase) while in others it's 'MQTT trigger'. For clarity and consistency, consider using 'MQTT' consistently. - 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 the comment is technically correct about the inconsistency, this is a relatively minor UI text issue. The rules state not to make purely informative comments and to focus on logic rather than UI. Capitalization in UI text falls more under UI/styling concerns which we're told to assume the author handled correctly.
The inconsistency could potentially confuse users if they're searching for error messages or documentation. Consistent branding is sometimes important for product quality.
While consistency is good, this is ultimately a UI text styling issue, not a logic issue. The rules explicitly tell us not to comment on UI/styling changes and to assume the author handled those correctly.
Delete this comment as it relates to UI text styling rather than logic, and the rules tell us not to comment on UI/styling changes.
56. frontend/src/lib/components/triggers/mqtt/MqttTriggersPanel.svelte:75
- Draft comment:
There's a slight grammatical typo at line 75: 'Windmill can connect to an MQTT broker and subscribes to specific topics...' should probably use 'subscribe' instead of 'subscribes' since 'Windmill' is singular and the phrase reads better as '...and subscribe to specific topics...'. - Reason this comment was not posted:
Comment did not seem useful. Confidence is useful =40%
<= threshold50%
The comment is pointing out a grammatical error in the code comments or documentation. While this is not directly related to the functionality of the code, it can be considered useful for maintaining code quality and readability. However, it does not directly relate to the code's functionality or logic, which is the primary focus of the rules. Therefore, it might not be considered useful in the context of this review process.
57. frontend/src/lib/components/triggers/mqtt/constant.ts:9
- Draft comment:
Minor stylistic note: the file lacks a newline at the end, which might cause minor issues with some tools. Please add a newline at the end of the file. - 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%
Missing newlines at end of file are typically handled by IDE settings, linters, or git configurations. It's a very minor issue that doesn't affect functionality. Most modern development environments handle this automatically. The comment doesn't suggest any meaningful code changes.
The missing newline could potentially cause issues with some tools or make git diffs less clean. It's a widely accepted convention to end files with newlines.
While it's a valid convention, this is exactly the kind of minor, obvious issue that should be handled by automated tools rather than manual review comments. It doesn't warrant human intervention.
Delete this comment as it's too minor and would typically be handled by automated tooling rather than code review.
58. frontend/src/lib/script_helpers.ts:716
- Draft comment:
Typo found: In the approval code, the comment says "clude instead the resume url...". Please change "clude" to "include" 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.
59. frontend/src/lib/script_helpers.ts:564
- Draft comment:
Typo found: In the approval code, the comment says "clude instead the resume url...". Please change "clude" to "include" 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.
60. frontend/src/routes/(root)/(logged)/mqtt_triggers/+page.svelte:270
- Draft comment:
It appears that the href attribute in the anchor tag is written as "#{path}". In Svelte, to interpolate a variable into a string, you should use the proper syntax (e.g., href={#${path}
}) or concatenation (e.g., href={'#' + path}). Please update this for correct rendering. - 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 current syntax href="#{path}" is actually valid Svelte syntax - Svelte allows interpolation within quoted attributes using {}.
- The href is only used as an anchor and the actual navigation is handled by the click handler.
- The suggested changes would work equivalently but don't provide any real benefit.
- This is a style preference rather than a functional issue.
The current syntax is valid and works correctly. The comment is suggesting an alternative syntax that provides no functional benefit.
While the suggested syntax changes are valid alternatives, they don't improve anything and the current code works perfectly fine.
Delete this comment as it suggests unnecessary changes to valid, working code based purely on style preferences.
Workflow ID: wflow_68RYKg4YJyptnGVs
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.
client_id = s.client_id ?? '' | ||
can_write = canWrite(s.path, s.extra_perms, $userStore) | ||
} catch (error) { | ||
sendUserToast(`Could not load mqtt trigger: ${error.body}`, true) |
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.
When loading an existing MQTT trigger, the error caught is assumed to have a 'body' property. Consider verifying that error.body exists to avoid runtime undefined errors.
sendUserToast(`Could not load mqtt trigger: ${error.body}`, true) | |
sendUserToast(`Could not load mqtt trigger: ${error.body ?? 'unknown error'}`, true) |
- connection | ||
responses: | ||
"200": | ||
description: successfuly connected to mqtt |
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.
Typo: Replace 'successfuly' with 'successfully' in response descriptions.
description: successfuly connected to mqtt | |
description: successfully connected to mqtt |
tx.commit().await?; | ||
|
||
Ok(format!( | ||
"succesfully updated mqttq trigger at path {} to status {}", |
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.
Typo detected: 'succesfully updated mqttq trigger at path {} to status {}'. Consider changing 'succesfully' to 'successfully' and 'mqttq' to 'mqtt'.
"succesfully updated mqttq trigger at path {} to status {}", | |
"successfully updated mqtt trigger at path {} to status {}", |
} | ||
|
||
export async function openNew( | ||
nis_flow: boolean, |
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.
The function parameter 'nis_flow' seems inconsistent with the naming used elsewhere (e.g., 'isFlow' in openEdit). Consider renaming it for consistency, perhaps to 'isFlow' or 'is_flow'.
<Skeleton layout={[[6], 0.4]} /> | ||
{/each} | ||
{:else if !triggers?.length} | ||
<div class="text-center text-sm text-tertiary mt-2"> No mqtt triggers </div> |
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.
For consistency, consider capitalizing 'mqtt' to 'MQTT' in the user-facing message at line 255 (i.e., change "No mqtt triggers" to "No MQTT triggers"). This will match the capitalization used elsewhere in the file.
<div class="text-center text-sm text-tertiary mt-2"> No mqtt triggers </div> | |
<div class="text-center text-sm text-tertiary mt-2"> No MQTT triggers </div> |
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.
❌ Changes requested. Incremental review on c507ef5 in 3 minutes and 2 seconds
More details
- Looked at
242
lines of code in2
files - Skipped
0
files when reviewing. - Skipped posting
15
drafted comments based on config settings.
1. backend/windmill-api/src/mqtt_triggers.rs:314
- Draft comment:
Consider adding additional context when propagating Base64 decode errors. This would aid debugging if certificate decoding fails. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 30% vs. threshold = 50%
While adding error context can be helpful for debugging, in this case:
- The error is already fairly clear - it's a base64 decode error on a client certificate
- The error gets propagated up and wrapped in a more specific error type (Error::Base64Decode)
- The error location is obvious from the code structure
- The suggestion is more of a nice-to-have than fixing a real issue
The comment does have merit - more specific error messages can help with debugging. And the change is simple and low-risk.
However, the existing error handling is already adequate. The base64 error type is specific, the context is clear from the code, and it gets wrapped in a custom error type. Additional context would be redundant.
While not incorrect, this suggestion is more of an optional improvement than fixing a real issue. The existing error handling is sufficient.
2. backend/windmill-api/src/mqtt_triggers.rs:195
- Draft comment:
Renaming 'host' to 'broker' improves clarity. Ensure all documentation and API clients are updated to reflect this change. - Reason this comment was not posted:
Comment did not seem useful. Confidence is useful =0%
<= threshold50%
This comment is asking the PR author to ensure that documentation and API clients are updated, which falls under the rule of not asking the author to ensure things. It doesn't provide a specific code suggestion or point out a specific issue with the code itself.
3. backend/windmill-api/src/mqtt_triggers.rs:340
- Draft comment:
TLS configuration is consistently applied in both V3 and V5 clients. Confirm that the certificate bytes and password are in the expected format. - Reason this comment was not posted:
Confidence changes required:50%
<= threshold50%
None
4. frontend/src/lib/components/triggers/mqtt/MqttTriggerEditorInner.svelte:237
- Draft comment:
This new conditional block to display a 'Create from template' button improves usability when no script is selected. - Reason this comment was not posted:
Confidence changes required:0%
<= threshold50%
None
5. frontend/src/lib/components/triggers/mqtt/MqttTriggerEditorInner.svelte:84
- Draft comment:
Ensure that client_version is properly defaulted (set to 'v5' as in the new trigger creation) and that downstream APIs are aware of the version naming conventions. - 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/mqtt_triggers.rs:308
- Draft comment:
In get_tls_configuration(), consider handling cases where only a client certificate is provided without a CA certificate. Right now the TLS config is only set if ca_certificate is non-empty. - 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 raises a valid point about a potential edge case. However, in TLS, a CA certificate is typically required to validate the server's certificate - it's not common or recommended to have client certificate authentication without server certificate validation. The current implementation enforcing CA certificate presence is likely intentional as a security measure. Additionally, the rumqttc library may not even support client auth without CA certs.
I may be making assumptions about the requirements and capabilities of the rumqttc library. There could be valid use cases for client certificates without CA certificates that I'm not considering.
While there may be edge cases, requiring a CA certificate for TLS connections is a security best practice. The current implementation enforces this in a reasonable way.
The comment should be deleted as it suggests a change that could weaken security by allowing TLS connections without proper server certificate validation.
7. backend/windmill-api/src/mqtt_triggers.rs:314
- Draft comment:
Consider adding more contextual information to Base64 decoding errors for the pkcs12_client_certificate to aid in debugging failures. - Reason this comment was not posted:
Confidence changes required:50%
<= threshold50%
None
8. backend/windmill-api/src/mqtt_triggers.rs:344
- Draft comment:
Defaulting credentials to empty strings when not provided might mask configuration issues. Consider logging a warning or validating if non-empty values were expected. - 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 the comment raises a valid concern about silently accepting empty credentials, there are several factors to consider:
- The code is intentionally handling optional credentials this way
- Empty credentials are a valid use case for MQTT brokers that don't require auth
- The comment doesn't provide a clear actionable suggestion
- The current behavior allows flexibility in configuration
The comment identifies a potential issue with error visibility, but may be overestimating the risk since empty credentials are valid in MQTT.
Given that empty credentials are a valid MQTT configuration and the code handles optionals explicitly, the current implementation seems reasonable and intentional rather than problematic.
The comment should be deleted as it suggests changing intentional behavior that is actually valid for MQTT, without providing clear actionable improvements.
9. frontend/src/lib/components/triggers/mqtt/MqttTriggerEditorInner.svelte:109
- Draft comment:
In loadTrigger(), using error.body assumes the error object has a 'body' property. Consider adding a fallback (e.g. error.message) to prevent potential runtime issues. - 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. frontend/src/lib/components/triggers/mqtt/MqttTriggerEditorInner.svelte:84
- Draft comment:
Ensure that the default value 'v5' for client_version matches the expected MqttClientVersion type (e.g. an enum value) to avoid type inconsistencies. - Reason this comment was not posted:
Confidence changes required:33%
<= threshold50%
None
11. backend/windmill-api/src/mqtt_triggers.rs:480
- Draft comment:
Typo: 'Timeout occured' should be spelled 'Timeout occurred'. - 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-api/src/mqtt_triggers.rs:889
- Draft comment:
Typo: In the success message, 'succesfully updated mqttq trigger' should be corrected to 'successfully updated mqtt trigger'. - 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-api/src/mqtt_triggers.rs:637
- Draft comment:
Typo: 'commiting' should be corrected to 'committing'. - 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. frontend/src/lib/components/triggers/mqtt/MqttTriggerEditorInner.svelte:65
- Draft comment:
The parameter name 'nis_flow' in the openNew function appears inconsistent with the 'is_flow' variable used elsewhere. Consider renaming it to 'is_flow' (or 'isFlow' if following a camelCase convention) 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.
15. frontend/src/lib/components/triggers/mqtt/MqttTriggerEditorInner.svelte:59
- Draft comment:
There is an inconsistency in the capitalization of "MQTT trigger" in toast messages (e.g., line 59 uses "mqtt trigger" while later messages use "MQTT trigger"). Consider standardizing the capitalization throughout for consistency. - 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_MjlmOmI8sfq5nH6B
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.
btnClasses="ml-4 mt-2" | ||
color="dark" | ||
size="xs" | ||
href={itemKind === 'flow' ? '/flows/add?hub=59' : '/scripts/add?hub=hub%2F11604'} |
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.
The 'Create from template' button uses hardcoded hub values in its href. Consider making these values configurable to better accommodate multiple environments.
Important
Add MQTT triggers to the system, enabling scripts and flows to be triggered by MQTT events, with full backend and frontend integration.
build-publish-rh-image.yml
,build_windows_worker_.yml
,docker-image-rpi4.yml
,docker-image.yml
, andpublish_windows_worker.yml
.openapi.yaml
to include MQTT trigger endpoints for create, update, delete, get, list, exists, set enabled, and test connection.capture.rs
andmqtt_triggers.rs
.+layout.svelte
,+page.svelte
, and+page.js
for UI integration.mqtt_trigger
table andMQTT_CLIENT_VERSION
type in20250207172929_mqtt_trigger.up.sql
and20250207172929_mqtt_trigger.down.sql
.TRIGGER_KIND
type to include 'mqtt' in20250207173304_add_mqtt_type_value_to_trigger_kind_type.up.sql
.MqttTrigger
,NewMqttTrigger
,EditMqttTrigger
,MqttV3Config
,MqttV5Config
,SubscribeTopic
, andMqttClientVersion
inopenapi.yaml
.MqttTriggersPanel
,MqttTriggerEditor
,MqttEditorConfigSection
, andMqttIcon.svelte
for MQTT trigger management.DetailPageLayout.svelte
,DetailPageTriggerPanel.svelte
, andTriggersBadge.svelte
to include MQTT triggers.rumqttc
andserde_repr
dependencies inCargo.toml
andCargo.lock
.OpenAPI.ts
andservices.gen.ts
for MQTT trigger API integration.This description was created by
for c507ef5. It will automatically update as commits are pushed.