-
Notifications
You must be signed in to change notification settings - Fork 208
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
WD-16445 Pick product listings with the right financial quarter #14554
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #14554 +/- ##
==========================================
+ Coverage 69.64% 69.97% +0.33%
==========================================
Files 120 120
Lines 3419 3387 -32
Branches 1174 1166 -8
==========================================
- Hits 2381 2370 -11
+ Misses 1013 992 -21
Partials 25 25
|
a3ca635
to
1c608fd
Compare
@@ -70,7 +70,7 @@ export type ChannelProduct = { | |||
productID: ValidProductID; | |||
productName: string; | |||
marketplace: UserSubscriptionMarketplace; | |||
version: string; | |||
exclusion_group: string; |
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.
not sure if this is relevant here, but the exclusion group might be missing (which is the same as it being an empty string) in product listings just like it can be missing in offers. does that perhaps mean that this should be exclusion_group?: string;
, just like in the Offer type?
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.
For offer types, I considered both normal offers and channel offers. so the exclusion group should be optional for offers type, but for channel offers, I made the exclusion group to always return ""
if it doesn't exist. This also applies to product listings for channel offers, so if an offer's exclusion group is ""
(doesn't exist), it can fetch product listings with exclusion group of ""
listing?.metadata?.find((data: Metadata) => data.key === "version") | ||
?.value || "1"; // "2" | ||
return { nameWithoutVersion, version }; // ex: { nameWithoutVersion: "uai-essential-desktop-1y-channel-eur", version: "2" } | ||
const extractNameWithoutQuarter = (listing: any) => { |
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.
I think this logic should not rely on the names of the listings at all, i.e. the name of the listing should be completely ignored. There is no guarantee at all that the names of the listings will always follow the same pattern. On the other hand, all the information about the listing that you can obtain from the name can be obtained from its attributes.
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.
(An easy fix for this would be to just manually construct the keys for updatedChannelProductList
based on the attributes of the listing and remove extractNameWithoutQuarter
.)
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.
Hi @amethystant, thanks for your feedback. I thought the name would always follow the pattern (${product?.id}-${duration}y-channel-${currency}), but only the exclusion_group pattern would change.
I didn’t know the product listing included currency and duration other than the name
field. I checked the raw product listing, and it includes effectiveDays
and currency
. I'll make some changes soon so the product listing name won't matter anymore. Thank you!
4687861
to
60d9b0a
Compare
60d9b0a
to
100b756
Compare
Done
2024-Q1
or2024-quarter-2
(names can be any string). If an offer's exclusion group is2024-Q4
, only product listings with2024-Q4
should be available.QA
Issue / Card
Fixes #https://warthogs.atlassian.net/browse/WD-16445