-
Notifications
You must be signed in to change notification settings - Fork 622
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
fix: improve teams settings in workspace settings #5316
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Looks good to me! Reviewed everything up to af19721 in 36 seconds
More details
- Looked at
9
lines of code in1
files - Skipped
0
files when reviewing. - Skipped posting
3
drafted comments based on config settings.
1. backend/ee-repo-ref.txt:1
- Draft comment:
Commit hash updated to new reference; change appears straightforward. - Reason this comment was not posted:
Confidence changes required:0%
<= threshold50%
None
2. backend/ee-repo-ref.txt:1
- Draft comment:
Verify updated commit hash is correct. - Reason this comment was not posted:
Confidence changes required:0%
<= threshold50%
None
3. backend/ee-repo-ref.txt:1
- Draft comment:
Consider adding a trailing newline for style consistency if required by the project's guidelines. - Reason this comment was not posted:
Confidence changes required:33%
<= threshold50%
None
Workflow ID: wflow_s6LbaiC6OO3Fi6Mx
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
Deploying windmill with
|
Latest commit: |
0979b49
|
Status: | ✅ Deploy successful! |
Preview URL: | https://7fb6ece9.windmill.pages.dev |
Branch Preview URL: | https://alp-latest-ee.windmill.pages.dev |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❌ Changes requested. Incremental review on a02d838 in 2 minutes and 6 seconds
More details
- Looked at
131
lines of code in6
files - Skipped
0
files when reviewing. - Skipped posting
7
drafted comments based on config settings.
1. backend/.sqlx/query-65c339164e7669360d231d70105849e72bdc197c17c0fc51777c1dc9267e2daf.json:3
- Draft comment:
Update statement appears appropriate; review access rights and transactional consistency. - Reason this comment was not posted:
Confidence changes required:0%
<= threshold50%
None
2. backend/.sqlx/query-ddf2eccb78a310ed00c7d8b9c3f05d394a7cbcf0038c72a78add5c7b02ef5927.json:17
- Draft comment:
Nullable flag changed from 'true' to 'null'. Confirm if this change correctly reflects the column’s nullability. - 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 appears to be an auto-generated file based on the .sqlx extension and its JSON structure. The change is likely a result of the SQL query tooling rather than a direct manual edit. The nullability change itself doesn't indicate a problem - both null and true would allow null values, and this is metadata rather than actual code logic.
The comment might be pointing out a potential schema inconsistency that could cause runtime issues. Generated files can sometimes indicate underlying problems.
However, this is clearly a generated file, and any actual schema issues would be caught by the build process or database migrations. Commenting on generated files violates our review principles.
Delete the comment as it's discussing a change in a generated file, which should not be manually reviewed or modified.
3. backend/.sqlx/query-df3b60c1d0fb44c97bf2611a7cda6bdb16a1be66e993a5cfadf6de2e3c8a5021.json:3
- Draft comment:
UPDATE statement for global_settings looks correct; verify that filtering out 'teams_channel' is intended. - Reason this comment was not posted:
Confidence changes required:0%
<= threshold50%
None
4. backend/.sqlx/query-e565f3b2e51059f563d18a8a9442bcae9640cee7b936820cb46c011222a77ff0.json:3
- Draft comment:
UPDATE global_settings setting the value for 'teams' seems fine; ensure proper Jsonb handling in application code. - Reason this comment was not posted:
Confidence changes required:0%
<= threshold50%
None
5. backend/.sqlx/query-50c17c7848760aaf0f869acfc444caecda6335eda5b2e97e5a7370361653ff48.json:20
- Draft comment:
Potential JSON key mismatch: the SELECT extracts team->>'team_internal_id' as team_id, yet the WHERE clause checks team->>'team_id' IS NOT NULL. Confirm if this is intentional. - Reason this comment was not posted:
Marked as duplicate.
6. backend/.sqlx/query-65c339164e7669360d231d70105849e72bdc197c17c0fc51777c1dc9267e2daf.json:3
- Draft comment:
Confirm that nulling all team-related columns in workspace_settings is intentional as it resets team associations. - 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 violates one of our key rules: "Do NOT ask the PR author to confirm their intention". The comment is asking for confirmation that nulling these fields is intentional. We should assume the author knows what they're doing when making database changes. Additionally, this is a .sqlx file which is typically generated from actual code, so the intention would be better reviewed in the source code that generates this query.
Perhaps nulling all team-related fields could have serious implications for the application's functionality that we should warn about?
While the change might be impactful, asking for confirmation isn't helpful - we should trust that the author has considered the implications of their changes. If there was a specific technical issue, that would be worth commenting on.
The comment should be deleted as it merely asks for confirmation of intention, which violates our review rules.
7. backend/.sqlx/query-ddf2eccb78a310ed00c7d8b9c3f05d394a7cbcf0038c72a78add5c7b02ef5927.json:17
- Draft comment:
Nullable metadata changed from 'true' to 'null'. Verify that this update aligns with intended schema definitions and does not break dependent code. - Reason this comment was not posted:
Marked as duplicate.
Workflow ID: wflow_N1E2fUDaWvs7zJeK
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.
@@ -0,0 +1,26 @@ | |||
{ | |||
"db_name": "PostgreSQL", | |||
"query": "\n WITH assigned_teams AS (\n SELECT teams_team_id\n FROM workspace_settings\n ),\n all_teams AS (\n SELECT jsonb_array_elements(CASE\n WHEN jsonb_typeof(value::jsonb) = 'array' THEN value::jsonb\n ELSE '[]'::jsonb\n END) AS team\n FROM global_settings\n WHERE name = 'teams'\n )\n SELECT team->>'team_name' AS team_name, team->>'team_internal_id' AS team_id\n FROM all_teams\n WHERE NOT EXISTS (\n SELECT 1\n FROM assigned_teams\n WHERE assigned_teams.teams_team_id = team->>'team_internal_id'\n )\n AND team->>'team_name' IS NOT NULL\n AND team->>'team_id' IS NOT NULL\n ", |
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.
Possible key name mismatch: the SELECT uses team->>'team_internal_id' AS team_id, but the null check uses team->>'team_id'. Ensure consistent key usage.
"query": "\n WITH assigned_teams AS (\n SELECT teams_team_id\n FROM workspace_settings\n ),\n all_teams AS (\n SELECT jsonb_array_elements(CASE\n WHEN jsonb_typeof(value::jsonb) = 'array' THEN value::jsonb\n ELSE '[]'::jsonb\n END) AS team\n FROM global_settings\n WHERE name = 'teams'\n )\n SELECT team->>'team_name' AS team_name, team->>'team_internal_id' AS team_id\n FROM all_teams\n WHERE NOT EXISTS (\n SELECT 1\n FROM assigned_teams\n WHERE assigned_teams.teams_team_id = team->>'team_internal_id'\n )\n AND team->>'team_name' IS NOT NULL\n AND team->>'team_id' IS NOT NULL\n ", | |
"query": "\n WITH assigned_teams AS (\n SELECT teams_team_id\n FROM workspace_settings\n ),\n all_teams AS (\n SELECT jsonb_array_elements(CASE\n WHEN jsonb_typeof(value::jsonb) = 'array' THEN value::jsonb\n ELSE '[]'::jsonb\n END) AS team\n FROM global_settings\n WHERE name = 'teams'\n )\n SELECT team->>'team_name' AS team_name, team->>'team_internal_id' AS team_id\n FROM all_teams\n WHERE NOT EXISTS (\n SELECT 1\n FROM assigned_teams\n WHERE assigned_teams.teams_team_id = team->>'team_internal_id'\n )\n AND team->>'team_name' IS NOT NULL\n AND team->>'team_internal_id' IS NOT NULL\n " |
@@ -0,0 +1,12 @@ | |||
{ | |||
"db_name": "PostgreSQL", | |||
"query": "\n UPDATE global_settings\n SET value = (\n SELECT jsonb_agg(elem)\n FROM jsonb_array_elements(value) AS elem\n WHERE NOT (elem ? 'teams_channel')\n )\n WHERE name = 'critical_error_channels'\n ", |
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.
Consider using COALESCE with jsonb_agg (e.g. COALESCE(jsonb_agg(elem), '[]'::jsonb)) to ensure an empty array is returned instead of NULL when no elements pass the filter.
"query": "\n UPDATE global_settings\n SET value = (\n SELECT jsonb_agg(elem)\n FROM jsonb_array_elements(value) AS elem\n WHERE NOT (elem ? 'teams_channel')\n )\n WHERE name = 'critical_error_channels'\n ", | |
"query": "\n UPDATE global_settings\n SET value = (\n SELECT COALESCE(jsonb_agg(elem), '[]'::jsonb)\n FROM jsonb_array_elements(value) AS elem\n WHERE NOT (elem ? 'teams_channel')\n )\n WHERE name = 'critical_error_channels'\n ", |
Important
Update SQL queries for better JSON handling and update
ee-repo-ref.txt
to a new reference.query-2fa27b0a71740e4e168879cf9a58ed593004c22bb5d11170b3196e290dd1d966.json
withquery-50c17c7848760aaf0f869acfc444caecda6335eda5b2e97e5a7370361653ff48.json
to handle JSON arrays more robustly inglobal_settings
.query-65c339164e7669360d231d70105849e72bdc197c17c0fc51777c1dc9267e2daf.json
to resetteams_command_script
,teams_team_id
, andteams_team_name
inworkspace_settings
.query-ddf2eccb78a310ed00c7d8b9c3f05d394a7cbcf0038c72a78add5c7b02ef5927.json
to change nullable fromtrue
tonull
.query-df3b60c1d0fb44c97bf2611a7cda6bdb16a1be66e993a5cfadf6de2e3c8a5021.json
to updateglobal_settings
by removingteams_channel
elements.query-e565f3b2e51059f563d18a8a9442bcae9640cee7b936820cb46c011222a77ff0.json
to updateteams
inglobal_settings
with a JSONB parameter.ee-repo-ref.txt
to new hashe507af5589efb1a8a72ae4e231130f749bde738d
.This description was created by
for a02d838. It will automatically update as commits are pushed.