jetpack icon indicating copy to clipboard operation
jetpack copied to clipboard

AI Tiered Plans: revisit the feature endpoint to consider tiers when setting the flags

Open lhkowalski opened this issue 2 years ago • 3 comments

Example:

If the current tier is 200 and the current period usage is 201, the site-requires-upgrade should be true. Same for has-feature and all the other fields.


Some conversation about it: p1698344317896489-slack-C054LN8RNVA, at the end of the thread.

lhkowalski avatar Oct 26 '23 20:10 lhkowalski

Below is a summary of the endpoint current properties, their meaning and some comments about changing it or not:

  • has-feature
    • there is some discussion about the meaning of this field
    • currently it represents the value of wpcom_site_has_feature( 'ai-assistant' ) to mark it it has the feature provided by some plan or any other mean
    • maybe it should represent if the feature is available on the site, considering limits of the free plan/tiers and all other factors that may block the feature; in this case, it would be the opposite, negated value of is-over-limit
  • is-over-limit
    • originally represented if the site was over the free limit of requests
    • we are changing it to represent if the site is over the limit of requests that the current plan/tier provides to the site (free, unlimited, 100, 200, 500)
    • being addressed by #34151
  • requests-count
    • represents the number of requests executed by the site since the beggining (the all time count)
    • could use a better name, like allTimeRequestsCount
  • requests-limit
    • represents the number of free requests allowed to the site type
    • could use a better name, like freeRequestsLimit
  • usage-period
    • info about the current usage period (start dates and request count)
    • no changes needed so far
  • site-require-upgrade
    • represents if the site needs an upgrade to keep running requests
    • with tiered plans, the site may need an upgrade even when it already have a tier, to get a bigger one to allow more requests
    • we need to revisit it because currently it only asks for upgrades on free sites, and that is not the case anymore
    • a good value for it is the is-over-limit value; when the site is over limit, an upgrade is required
    • being addressed by #34170
  • upgrade-type
    • represents the type of the upgrade message, refering to different site types
    • no changes needed so far
  • current-tier
    • info about the current tier of the site
    • no changes needed so far
  • next-tier
    • info about the next tier the site may/will upgrade to
    • no changes needed so far
  • tier-plans
    • the list of tiers enabled for the site
    • no changes needed so far

lhkowalski avatar Nov 15 '23 21:11 lhkowalski

Updating, the last 3 fields that could deserve some changes are:

  • has-feature:
    • as described above, there is some mixed meaning attached to it, but I think we can keep the current one, that is the value of the wpcom_site_has_feature( 'ai-assistant' ) call
  • requests-count:
    • the suggestion is to rename it, but we can prioritize it later
  • requests-limit:
    • the suggestion is to rename it, but we can prioritize it later

All three are not critical for the working of the project and are considering tiers the right way, so we can stick to the current names/behavior and revisit it later.

I will move the issue back to to-do and give a lower priority to it for now.

lhkowalski avatar Nov 17 '23 15:11 lhkowalski

This issue has been marked as stale. This happened because:

  • It has been inactive for the past 6 months.
  • It hasn’t been labeled `[Pri] BLOCKER`, `[Pri] High`, `[Type] Feature Request`, `[Type] Enhancement`, `[Type] Janitorial`, `Good For Community`, `[Type] Good First Bug`, etc.

No further action is needed. But it's worth checking if this ticket has clear reproduction steps and it is still reproducible. Feel free to close this issue if you think it's not valid anymore — if you do, please add a brief explanation.

github-actions[bot] avatar May 16 '24 00:05 github-actions[bot]