-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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: consume the new licenses v3 structure. #6341
Conversation
Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id> |
contributes to - https://github.com/SigNoz/platform-pod/issues/304 |
Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id> |
Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id> |
contributes to - https://github.com/SigNoz/platform-pod/issues/326 ( v3 deprecation of activations from query service ) |
Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id> |
Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id> |
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 7882010 in 1 minute and 13 seconds
More details
- Looked at
661
lines of code in10
files - Skipped
0
files when reviewing. - Skipped posting
4
drafted comments based on config settings.
1. ee/query-service/integrations/signozio/signozio.go:134
- Draft comment:
Movedefer response.Body.Close()
immediately after checking for errors to ensure the body is closed in all cases. - Reason this comment was not posted:
Confidence changes required:50%
Thedefer response.Body.Close()
should be placed immediately after checking for errors to ensure the body is closed in all cases.
2. ee/query-service/license/db.go:285
- Draft comment:
The error message should be updated to reflect the correct operation:
return fmt.Errorf("update license failed: license marshal error")
- Reason this comment was not posted:
Marked as duplicate.
3. ee/query-service/app/api/api.go:173
- Draft comment:
Avoid using thecomponent/index.tsx
file structure approach, as it makes it difficult to debug and find components using global search tools like VS Code. - Reason this comment was not posted:
Comment was on unchanged code.
4. ee/query-service/app/api/license.go:95
-
Draft comment:
applyLicenseV3
is a duplicate ofapplyLicense
. Consider refactoring to handle both versions in a single function. -
function
applyLicense
(license.go) -
Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable:
The functions are similar in structure but handle different types and methods, which suggests they are not duplicates. The comment may not be valid as the functions serve different purposes despite their structural similarity.
The functions could potentially be refactored to share common logic, but the comment's suggestion of duplication might be misleading due to the different types and methods involved.
While the functions are not duplicates, there might be room for refactoring shared logic. However, the comment's suggestion of duplication is not accurate.
The comment should be deleted as it incorrectly identifies the functions as duplicates. They handle different types and methods, indicating distinct purposes.
Workflow ID: wflow_4mGfkKPlUAG29pra
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.
Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Looks good to me! Incremental review on 15d10a0 in 36 seconds
More details
- Looked at
98
lines of code in3
files - Skipped
0
files when reviewing. - Skipped posting
1
drafted comments based on config settings.
1. ee/query-service/license/manager.go:345
- Draft comment:
Do not add non-ClickHouse related functions to the ClickHouseReader interface. Use the DAO in the telemetry instance to access such information instead. - Reason this comment was not posted:
Comment was on unchanged code.
Workflow ID: wflow_pOrMMV4C438f5iCV
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Looks good to me! Incremental review on 4535e15 in 31 seconds
More details
- Looked at
15
lines of code in1
files - Skipped
0
files when reviewing. - Skipped posting
2
drafted comments based on config settings.
1. ee/query-service/license/db.go:298
- Draft comment:
The error message should reflect the update operation:
zap.L().Error("error in updating license data: ", zap.Error(err))
- Reason this comment was not posted:
Comment looked like it was already resolved.
2. ee/query-service/license/db.go:298
- Draft comment:
The error message should be consistent with the operation being performed. Consider changing it to reflect the update operation. - Reason this comment was not posted:
Marked as duplicate.
Workflow ID: wflow_gNGa4hb60xifQxml
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id> |
Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id> |
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 a745c72 in 1 minute and 9 seconds
More details
- Looked at
143
lines of code in5
files - Skipped
0
files when reviewing. - Skipped posting
2
drafted comments based on config settings.
1. ee/query-service/integrations/signozio/signozio.go:154
- Draft comment:
The error message should use 'unmarshal' instead of 'marshal' to accurately describe the operation being performed. - Reason this comment was not posted:
Comment was on unchanged code.
2. ee/query-service/integrations/signozio/signozio.go:139
- Draft comment:
Avoid using inline styles in React components. Use external stylesheets, CSS classes, or styled components instead. This is applicable in other parts of the code as well. - Reason this comment was not posted:
Comment was on unchanged code.
Workflow ID: wflow_T1TDedx2tPs2KXbd
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.
Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Looks good to me! Incremental review on d171861 in 51 seconds
More details
- Looked at
116
lines of code in3
files - Skipped
0
files when reviewing. - Skipped posting
3
drafted comments based on config settings.
1. ee/query-service/model/license.go:189
- Draft comment:
Ensure consistent handling ofvalidFrom
andvalidUntil
by checking the type and defaulting correctly. Consider using a helper function to avoid repetition. - Reason this comment was not posted:
Comment did not seem useful.
2. ee/query-service/model/license.go:253
- Draft comment:
Ensure consistent handling ofvalidFrom
andvalidUntil
by checking the type and defaulting correctly. Consider using a helper function to avoid repetition. - Reason this comment was not posted:
Marked as duplicate.
3. ee/query-service/app/api/license.go:72
- Draft comment:
Avoid using thecomponent/index.tsx
file structure approach, as it makes it difficult to debug and find components using global search tools like VS Code. - Reason this comment was not posted:
Comment was on unchanged code.
Workflow ID: wflow_Yr99eeBRxvETzkvc
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Looks good to me! Incremental review on e6cacce in 1 minute and 4 seconds
More details
- Looked at
346
lines of code in6
files - Skipped
0
files when reviewing. - Skipped posting
5
drafted comments based on config settings.
1. ee/query-service/model/license_test.go:25
- Draft comment:
The error message for invalid plan data should match the one in NewLicenseV3 function. Ensure consistency in error messages. - Reason this comment was not posted:
Comment did not seem useful.
2. ee/query-service/model/license_test.go:83
- Draft comment:
The error message for missing license id should match the one in NewLicenseV3 function. Ensure consistency in error messages. - Reason this comment was not posted:
Comment did not seem useful.
3. ee/query-service/model/license_test.go:89
- Draft comment:
The error message for missing license key should match the one in NewLicenseV3 function. Ensure consistency in error messages. - Reason this comment was not posted:
Marked as duplicate.
4. ee/query-service/model/license_test.go:95
- Draft comment:
The error message for invalid string license key should match the one in NewLicenseV3 function. Ensure consistency in error messages. - Reason this comment was not posted:
Marked as duplicate.
5. ee/query-service/app/api/api.go:40
- Draft comment:
Avoid using thecomponent/index.tsx
file structure approach, as it makes it difficult to debug and find components using global search tools like VS Code. This is applicable in other files as well. - Reason this comment was not posted:
Comment was on unchanged code.
Workflow ID: wflow_Qmck6yFEnafX7OKa
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Looks good to me! Incremental review on b3365e8 in 50 seconds
More details
- Looked at
177
lines of code in3
files - Skipped
0
files when reviewing. - Skipped posting
6
drafted comments based on config settings.
1. ee/query-service/app/api/license.go:73
- Draft comment:
Ensure thatlicense.Data
contains all necessary fields for the response, as the conversion now directly useslicense.Data
. This change should be verified against the expected API response structure. - Reason this comment was not posted:
Confidence changes required:50%
The change in theconvertLicenseV3ToListLicenseResponse
function simplifies the conversion by directly usinglicense.Data
. This is a valid change as it aligns with the new structure ofLicenseV3
. However, it is important to ensure thatlicense.Data
contains all necessary fields for the response. This change should be verified against the expected API response structure.
2. ee/query-service/app/api/license.go:138
- Draft comment:
Ensure thatrender.Success
is correctly implemented to handle the response as expected, as it replacesah.Respond
. - Reason this comment was not posted:
Confidence changes required:50%
TheapplyLicenseV3
function now usesrender.Success
instead ofah.Respond
. This change is consistent with the new approach to response handling. However, it is important to ensure that therender.Success
function is correctly implemented to handle the response as expected.
3. ee/query-service/app/api/license.go:149
- Draft comment:
Ensure thatrender.Success
is correctly implemented to handle the response as expected, as it replacesah.Respond
. - Reason this comment was not posted:
Confidence changes required:50%
TherefreshLicensesV3
function now usesrender.Success
instead ofah.Respond
. This change is consistent with the new approach to response handling. However, it is important to ensure that therender.Success
function is correctly implemented to handle the response as expected.
4. ee/query-service/model/license.go:187
- Draft comment:
Ensure that the JSON structure for plan and features matches the expected format, and that error handling is comprehensive inNewLicenseV3
. - Reason this comment was not posted:
Confidence changes required:50%
TheNewLicenseV3
function has been updated to handle plan and features data using JSON marshaling and unmarshaling. This change improves the robustness of data handling. However, it is important to ensure that the JSON structure matches the expected format and that error handling is comprehensive.
5. ee/query-service/model/license_test.go:25
- Draft comment:
Verify that all edge cases are covered in the test cases forNewLicenseV3
, and that the test data accurately represents possible inputs. - Reason this comment was not posted:
Confidence changes required:50%
The test case forNewLicenseV3
has been updated to reflect changes in error messages and expected behavior. This is necessary to ensure that the tests align with the new implementation. However, it is important to verify that all edge cases are covered and that the test data accurately represents possible inputs.
6. ee/query-service/app/api/license.go:138
- Draft comment:
Avoid using inline styles in React components. Use external stylesheets, CSS classes, or styled components instead. - Reason this comment was not posted:
Comment was on unchanged code.
Workflow ID: wflow_hw8BaMqwHS56g60i
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Looks good to me! Incremental review on aad8fe1 in 48 seconds
More details
- Looked at
219
lines of code in2
files - Skipped
0
files when reviewing. - Skipped posting
2
drafted comments based on config settings.
1. ee/query-service/model/license_test.go:160
- Draft comment:
The expected values forValidFrom
andValidUntil
should be0
and-1
respectively, as per the logic inNewLicenseV3
function. - Reason this comment was not posted:
Comment looked like it was already resolved.
2. ee/query-service/model/license.go:194
- Draft comment:
Avoid using inline styles in React components. Use external stylesheets or styled components instead. - Reason this comment was not posted:
Comment was on unchanged code.
Workflow ID: wflow_jbOwMuswZJHvtbcP
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id> |
1 similar comment
Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id> |
Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id> |
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 8e3509d in 1 minute and 14 seconds
More details
- Looked at
292
lines of code in9
files - Skipped
0
files when reviewing. - Skipped posting
5
drafted comments based on config settings.
1. ee/query-service/app/api/api.go:193
- Draft comment:
The HTTP method for the/api/v3/licenses
endpoint should be updated toPUT
to match therefreshLicensesV3
function.
Methods(http.MethodPut)
- Reason this comment was not posted:
Comment was on unchanged code.
2. ee/query-service/app/api/license.go:218
- Draft comment:
The functionconvertLicenseV3ToLicenseV2
should accept a slice directly instead of a pointer to a slice for clarity and to avoid unnecessary complexity.
func convertLicenseV3ToLicenseV2(licenses []*model.LicenseV3) []model.License {
- Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable:
The comment is no longer relevant because the suggested change has already been implemented in the diff. The function now correctly accepts a slice directly, aligning with the comment's suggestion.
I might be missing some context about why the comment was made, but based on the diff, the change has already been applied.
The diff clearly shows the change was made, so the comment is outdated and should be removed.
The comment is outdated because the suggested change has already been implemented in the diff. It should be removed.
3. ee/query-service/integrations/signozio/signozio.go:164
- Draft comment:
Avoid redundant error wrapping withfmt.Errorf
when the error message is already a string.
return nil, model.BadRequest(errors.New(string(body)))
- Reason this comment was not posted:
Comment was on unchanged code.
4. ee/query-service/license/db.go:52
- Draft comment:
Return a slice ofmodel.LicenseV3
instead of a pointer to a slice for consistency and clarity.
func (r *Repo) GetLicensesV3(ctx context.Context) ([]model.LicenseV3, error) {
- Reason this comment was not posted:
Marked as duplicate.
5. ee/query-service/model/errors.go:49
- Draft comment:
TheUnauthorized
function is correctly implemented and aligns with existing patterns. No changes needed. - Reason this comment was not posted:
Confidence changes required:0%
TheUnauthorized
function inerrors.go
is correctly implemented and aligns with the existing error handling patterns. No changes are needed here.
Workflow ID: wflow_FXQe2kCgyyeH4rEw
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.
Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Looks good to me! Incremental review on e6fa8c6 in 1 minute and 0 seconds
More details
- Looked at
338
lines of code in3
files - Skipped
0
files when reviewing. - Skipped posting
9
drafted comments based on config settings.
1. ee/query-service/model/license_test.go:25
- Draft comment:
The error message here should match the format used inextractKeyFromMapStringInterface
.
error: errors.New("id key is missing"),
- Reason this comment was not posted:
Comment looked like it was already resolved.
2. ee/query-service/model/license_test.go:31
- Draft comment:
The error message here should match the format used inextractKeyFromMapStringInterface
.
error: errors.New("id key is not a valid string"),
- Reason this comment was not posted:
Marked as duplicate.
3. ee/query-service/model/license_test.go:37
- Draft comment:
The error message here should match the format used inextractKeyFromMapStringInterface
.
error: errors.New("key key is missing"),
- Reason this comment was not posted:
Marked as duplicate.
4. ee/query-service/model/license_test.go:43
- Draft comment:
The error message here should match the format used inextractKeyFromMapStringInterface
.
error: errors.New("key key is not a valid string"),
- Reason this comment was not posted:
Marked as duplicate.
5. ee/query-service/model/license_test.go:49
- Draft comment:
The error message here should match the format used inextractKeyFromMapStringInterface
.
error: errors.New("status key is missing"),
- Reason this comment was not posted:
Marked as duplicate.
6. ee/query-service/model/license_test.go:55
- Draft comment:
The error message here should match the format used inextractKeyFromMapStringInterface
.
error: errors.New("status key is not a valid string"),
- Reason this comment was not posted:
Marked as duplicate.
7. ee/query-service/model/license_test.go:61
- Draft comment:
The error message here should match the format used inextractKeyFromMapStringInterface
.
error: errors.New("plan key is missing"),
- Reason this comment was not posted:
Marked as duplicate.
8. ee/query-service/model/license_test.go:67
- Draft comment:
The error message here should match the format used inextractKeyFromMapStringInterface
.
error: errors.New("plan key is not a valid map[string]interface {}"),
- Reason this comment was not posted:
Marked as duplicate.
9. ee/query-service/app/api/license.go:221
- Draft comment:
Avoid using inline styles in React components. Use external stylesheets, CSS classes, or styled components instead. This is also applicable at line 115 and 73. - Reason this comment was not posted:
Comment was on unchanged code.
Workflow ID: wflow_8di9XEc8XtvOzH3f
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
Summary
zeus
and refreshing the license fromzeus
post any update to the plan of the license or validity etc.Related Issues / PR's
contributes to - https://github.com/SigNoz/platform-pod/issues/304
Screenshots
NA
Affected Areas and Manually Tested Areas
Important
Introduces a new license v3 structure with endpoints, database changes, and feature toggles, ensuring backward compatibility and adding comprehensive tests.
/api/v3/licenses
endpoints inapi.go
for listing, applying, and refreshing licenses.licenses_v3
table insqlite/init.go
for storing new license structure.LicenseV3
model inmodel/license.go
.Manager
inlicense/manager.go
to handleLicenseV3
.GetLicensesV3
,InsertLicenseV3
, andUpdateLicenseV3
inlicense/db.go
.UseLicensesV3
flag inapi.go
andmain.go
to toggle between license structures.LicenseV3
inmodel/license_test.go
.This description was created by for e6fa8c6. It will automatically update as commits are pushed.