-
Notifications
You must be signed in to change notification settings - Fork 1.6k
feat(preference): add support for objects and arrays #8142
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
base: main
Are you sure you want to change the base?
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.
Caution
Changes requested ❌
Reviewed everything up to a7d0ae2 in 2 minutes and 3 seconds. Click for details.
- Reviewed
1386
lines of code in10
files - Skipped
0
files when reviewing. - Skipped posting
2
draft comments. View those below. - Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. pkg/modules/preference/implpreference/store.go:72
- Draft comment:
Typographical note: There appears to be a duplicated 'store.' chain before the call to BunDB(). Please verify if this is intentional or if one of the 'store.' calls should be removed. - Reason this comment was not posted:
Comment was on unchanged code.
2. pkg/types/preferencetypes/value.go:37
- Draft comment:
Typo: There's an extra space before the comma in the error message. Consider changing "min: %d , max: %d" to "min: %d, max: %d" for consistency. - 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 a valid observation about code style, it's an extremely minor formatting issue that doesn't affect functionality. The error message will work the same either way. The rules say not to make comments that are obvious or unimportant. This seems to fall into that category - it's a trivial change that could be considered nitpicking. The extra space in error messages could be seen as inconsistent with the rest of the codebase's style. Having consistent error message formatting might make logs easier to read. While consistency is good, this is too minor of an issue to warrant a PR comment. It doesn't affect functionality or significantly impact readability. The comment should be deleted as it addresses an extremely minor formatting issue that doesn't meaningfully impact the code.
Workflow ID: wflow_M1AoGtiCRFl1LE76
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
c66b137
to
92f7c4b
Compare
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.
Important
Looks good to me! 👍
Reviewed c66b137 in 1 minute and 29 seconds. Click for details.
- Reviewed
38
lines of code in3
files - Skipped
0
files when reviewing. - Skipped posting
3
draft comments. View those below. - Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. frontend/src/api/preferences/updateOrgPreference.ts:16
- Draft comment:
Changed payload key from 'preference_value' to 'value'. Ensure that the backend and API docs are updated to expect this new field, especially for object/array values. - 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 several rules: 1) It asks to "ensure" something, which is explicitly forbidden 2) It's asking about backend compatibility which requires context we don't have 3) It's asking about documentation which is outside the scope of this file 4) It's speculative about potential issues with object/array values. Maybe the API change could cause serious runtime errors if not properly coordinated with the backend. Maybe this warning could prevent a production issue. While API compatibility is important, the rules explicitly state not to make speculative comments or ask for verification. We must assume the author has properly tested their changes. The comment should be deleted as it violates multiple review rules by being speculative and asking for verification of backend compatibility.
2. frontend/src/api/preferences/updateUserPreference.ts:16
- Draft comment:
Payload key updated to 'value'. Verify consistency with backend changes and update any relevant documentation regarding support for objects and arrays. - 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 consistency with backend changes and update documentation. This falls under the rule of not asking the author to ensure behavior is intended or to update documentation.
3. pkg/modules/preference/implpreference/module.go:9
- Draft comment:
Removed outdated internal comment. Confirm that any needed guidance about using a better Organization module is documented elsewhere so that future developers aren’t left in the dark. - Reason this comment was not posted:
Confidence changes required:0%
<= threshold50%
None
Workflow ID: wflow_Wps7CCreNJlHtECE
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
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.
Important
Looks good to me! 👍
Reviewed c63f8cf in 1 minute and 21 seconds. Click for details.
- Reviewed
1362
lines of code in32
files - Skipped
0
files when reviewing. - Skipped posting
2
draft comments. View those below. - Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. pkg/types/preferencetypes/value.go:84
- Draft comment:
Consider using a canonical JSON encoder for objects to produce deterministic stringValue 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. pkg/types/preferencetypes/value_test.go:52
- Draft comment:
Use assert.JSONEq or compare unmarshaled values to avoid flakiness due to non-deterministic map key order. - 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_XRJJLnDloAjg9kfV
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
c63f8cf
to
ca25943
Compare
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.
Important
Looks good to me! 👍
Reviewed c0bba17 in 1 minute and 5 seconds. Click for details.
- Reviewed
18
lines of code in1
files - Skipped
0
files when reviewing. - Skipped posting
1
draft comments. View those below. - Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. pkg/types/preferencetypes/value.go:127
- Draft comment:
When returning the error for an invalid allowed value, consider using the type-asserted variable (goStringValue) instead of value.stringValue. This maintains consistency since the check uses goStringValue. - Reason this comment was not posted:
Comment was on unchanged code.
Workflow ID: wflow_axUXJ9rzxWHTBT45
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
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.
Important
Looks good to me! 👍
Reviewed 8706e6e in 43 seconds. Click for details.
- Reviewed
13
lines of code in1
files - Skipped
0
files when reviewing. - Skipped posting
1
draft comments. View those below. - Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. pkg/types/preferencetypes/value.go:131
- Draft comment:
Error message now displays allowedValues; consider using %q to quote the provided value (goStringValue) for clarity, ensuring it matches expected string formatting. - Reason this comment was not posted:
Confidence changes required:33%
<= threshold50%
None
Workflow ID: wflow_XGWqjXxU0eApULqL
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
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.
Important
Looks good to me! 👍
Reviewed 9b9faee in 38 seconds. Click for details.
- Reviewed
16
lines of code in1
files - Skipped
0
files when reviewing. - Skipped posting
1
draft comments. View those below. - Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. pkg/types/preferencetypes/value.go:21
- Draft comment:
Removed unused Range struct. Ensure no parts of the system still depend on it. - Reason this comment was not posted:
Comment did not seem useful. Confidence is useful =0%
<= threshold50%
The comment is asking the PR author to ensure that no parts of the system depend on the removedRange
struct. This violates the rule against asking the author to confirm or ensure things. The comment does not provide a specific suggestion or point out a specific issue.
Workflow ID: wflow_7VBm1tXnt4yRQ5VT
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
📄 Summary
Better readbility and support for objects and arrays
Important
Enhances preference handling by adding support for objects and arrays, refactoring preference management, and updating API endpoints.
pkg/types/preferencetypes/value.go
.name
instead ofkey
infrontend/src/container/Home/Home.tsx
andfrontend/src/container/OnboardingQuestionaire/index.tsx
.pkg/query-service/app/http_handler.go
to use new preference methods.implpreference/module.go
to handle preferences byname
and support new value types.implpreference/store.go
to support new preference storage methods.preference.go
to define new interfaces for preference operations.Name
,Scope
, andValueType
inpkg/types/preferencetypes/name.go
,scope.go
, andvalue.go
.NewAvailablePreference
andNewPreference
functions inpkg/types/preferencetypes/preference.go
.pkg/types/preferencetypes/preference_test.go
andvalue_test.go
with tests for new functionality.frontend/src/api/preferences/
.pkg/signoz/module.go
to initialize new preference module.This description was created by
for 9b9faee. You can customize this summary. It will automatically update as commits are pushed.