Skip to content
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

chore: move away from parallel usages of licenses v2 and v3 #6527

Merged
merged 4 commits into from
Nov 25, 2024

Conversation

vikrantgupta25
Copy link
Collaborator

@vikrantgupta25 vikrantgupta25 commented Nov 25, 2024

Summary

  • in the current approach we were running both licenses v2 and license v3 in parallel which can cause stale keys to be applied to usage and gateway.
  • moving away from all the usages of licenses v2 when we toggle the flag.
  • added logging at places necessary for debugging if something goes crazy!

Related Issues / PR's

contributes to - https://github.com/SigNoz/platform-pod/issues/304

@github-actions github-actions bot added the chore label Nov 25, 2024
Copy link

Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id>

@vikrantgupta25 vikrantgupta25 marked this pull request as ready for review November 25, 2024 16:00
Copy link

Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id>

2 similar comments
Copy link

Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id>

Copy link

Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id>

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Looks good to me! Reviewed everything up to db0fefa in 1 minute and 18 seconds

More details
  • Looked at 170 lines of code in 4 files
  • Skipped 0 files when reviewing.
  • Skipped posting 6 drafted comments based on config settings.
1. ee/query-service/license/db.go:114
  • Draft comment:
    The ctx parameter is not used in GetActiveLicense. Consider passing it to database operations for better context management.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The function GetActiveLicense in db.go is not using the context parameter effectively. The context should be passed to any database operations to allow for better control over request lifecycles.
2. ee/query-service/license/db.go:137
  • Draft comment:
    The ctx parameter is not used in GetActiveLicenseV3. Consider passing it to database operations for better context management.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The function GetActiveLicenseV3 in db.go is not using the context parameter effectively. The context should be passed to any database operations to allow for better control over request lifecycles.
3. ee/query-service/license/db.go:83
  • Draft comment:
    The ctx parameter is not used in GetActiveLicenseV2. Consider passing it to database operations for better context management.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The function GetActiveLicenseV2 in db.go is not using the context parameter effectively. The context should be passed to any database operations to allow for better control over request lifecycles.
4. ee/query-service/app/api/license.go:96
  • Draft comment:
    Consider closing the request body after decoding to prevent resource leaks. Use defer r.Body.Close() after checking for errors.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The applyLicense function in license.go uses json.NewDecoder(r.Body).Decode(&l) without closing the request body. This can lead to resource leaks. The request body should be closed after decoding.
5. ee/query-service/app/api/license.go:90
  • Draft comment:
    Avoid using inline styles in React components. Use external stylesheets or styled components instead. This is also applicable at line 91.
  • Reason this comment was not posted:
    Comment was on unchanged code.
6. ee/query-service/license/db.go:114
  • 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. This is also applicable at line 83.
  • Reason this comment was not posted:
    Comment was on unchanged code.

Workflow ID: wflow_Gd0ICVHWQZZqHnAj


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

@vikrantgupta25 vikrantgupta25 merged commit 24ab18d into develop Nov 25, 2024
16 checks passed
@vikrantgupta25 vikrantgupta25 deleted the migrate-usage-ff-gateway branch November 25, 2024 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants