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: exactly match the list licenses v2 structure with FF on #6481

Merged
merged 1 commit into from
Nov 19, 2024

Conversation

vikrantgupta25
Copy link
Collaborator

@vikrantgupta25 vikrantgupta25 commented Nov 19, 2024

Summary

  • the plan key in the new structure was missing PLAN in the string end
  • added the valid until of 1 year similar to previous flow

Related Issues / PR's

Screenshots

NA

Affected Areas and Manually Tested Areas


Important

Align license structure with feature flag by mapping old plan keys to new names and setting default validity in license.go and manager.go.

  • Behavior:
    • In convertLicenseV3ToLicenseV2 in license.go, map old plan keys to new plan names using MapOldPlanKeyToNewPlanName.
    • In GetLicensesV3 in manager.go, set ValidUntil to one year from ValidFrom if ValidUntil is -1.
  • Models:
    • Add MapOldPlanKeyToNewPlanName in plans.go to map old plan keys to new plan names.
  • Misc:
    • Ensure PlanKey in LicensePlan is correctly set in convertLicenseV3ToLicenseV2.

This description was created by Ellipsis for ba2e84b. It will automatically update as commits are pushed.

Copy link

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

@github-actions github-actions bot added the chore label Nov 19, 2024
@vikrantgupta25 vikrantgupta25 marked this pull request as ready for review November 19, 2024 13:17
Copy link

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

1 similar comment
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 ba2e84b in 48 seconds

More details
  • Looked at 57 lines of code in 3 files
  • Skipped 0 files when reviewing.
  • Skipped posting 3 drafted comments based on config settings.
1. ee/query-service/app/api/license.go:221
  • Draft comment:
    Ensure consistent use of MapOldPlanKeyToNewPlanName for plan name to plan key conversion across the codebase to avoid potential bugs.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The code in convertLicenseV3ToLicenseV2 function in license.go is correctly mapping the plan name to the plan key using the MapOldPlanKeyToNewPlanName map. However, the map is defined in plans.go and is not used consistently across the codebase. It would be better to ensure that this mapping is used wherever plan names are converted to plan keys to maintain consistency and avoid potential bugs.
2. ee/query-service/license/manager.go:256
  • Draft comment:
    Consider refactoring the logic for setting default validity period into a separate function to avoid code duplication and potential inconsistencies. This applies to both GetLicenses and GetLicensesV3.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The code in GetLicensesV3 function in manager.go is correctly setting a default validity period of one year for licenses with ValidUntil set to -1. This logic is repeated in GetLicenses function as well. It would be better to refactor this logic into a separate function to avoid code duplication and potential inconsistencies.
3. ee/query-service/model/plans.go:20
  • Draft comment:
    Use predefined constants for plan names and features instead of hardcoding values. This is correctly done here and should be maintained throughout the codebase.
  • Reason this comment was not posted:
    Confidence changes required: 0%
    The code in ee/query-service/model/plans.go is correctly using predefined constants for plan names and features, which aligns with the principle of using design tokens or predefined constants instead of hardcoding values.

Workflow ID: wflow_iD0NcRfB1SX20ssK


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

@vikrantgupta25
Copy link
Collaborator Author

@vikrantgupta25 vikrantgupta25 merged commit 0b03ff0 into develop Nov 19, 2024
15 of 18 checks passed
@vikrantgupta25 vikrantgupta25 deleted the list-licenses-v2-match-response branch November 19, 2024 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants