This PR updates `StripeBilling` to use the `StripeClient` trait to
retrieve prices and meters from Stripe instead of using the
`stripe::Client` directly.
Release Notes:
- N/A
This PR introduces a new `StripeClient` trait to abstract over
interacting with the Stripe API.
This will allow us to more easily test our billing code.
This initial cut is small and focuses just on making
`StripeBilling::find_or_create_customer_by_email` testable. I'll follow
up with using the `StripeClient` in more places.
Release Notes:
- N/A
This PR downgrades a number of database queries that aren't part of the
actual collaboration from `SERIALIZABLE` to `READ COMMITTED`.
The serializable isolation level is overkill for these queries.
Release Notes:
- N/A
- Rename current_user_account_too_young to account_too_young for
consistency
- Add has_overdue_invoices field to track billing status
- Block edit predictions when user has overdue invoices
- Add overdue invoice warning to inline completion menu
Release Notes:
- N/A
---------
Co-authored-by: Marshall Bowers <git@maxdeviant.com>
This PR makes it so the Zed Free plan cannot be canceled.
We were already preventing this on the zed.dev side, but this will make
it more airtight.
Release Notes:
- N/A
This PR replaces some `update()` calls with either `read()` or
`read_with()` when the `update()` call performed read-only operations on
the entity.
Many more likely exist, will follow-up with more PRs.
Release Notes:
- N/A
Right now you find this out the first time you try and submit a
completion.
These changes communicate much earlier to the user what the issue is
with their account and what they can do about it.
Release Notes:
- N/A
---------
Co-authored-by: Antonio Scandurra <me@as-cii.com>
This PR allows DAPs to define their own schema so users can see
completion items when editing their debug.json files.
Users facing this aren’t the biggest chance, but behind the scenes, this
affected a lot of code because we manually translated common fields from
Zed's config format to be adapter-specific. Now we store the raw JSON
from a user's configuration file and just send that.
I'm ignoring the Protobuf CICD error because the DebugTaskDefinition
message is not yet user facing and we need to deprecate some fields in
it.
Release Notes:
- debugger beta: Show completion items when editing debug.json
- debugger beta: Breaking change, debug.json schema now relays on what
DAP you have selected instead of always having the same based values.
---------
Co-authored-by: Remco Smits <djsmits12@gmail.com>
Co-authored-by: Cole Miller <m@cole-miller.net>
Co-authored-by: Cole Miller <cole@zed.dev>
This PR makes it so we always prefer the plan on the subscription.
The plan stored on the subscription usage is informational only.
Release Notes:
- N/A
This PR adds a new `GET /users/look_up` endpoint for retrieving users by
various identifiers.
This endpoint can look up users by the following identifiers:
- Zed user ID
- Stripe Customer ID
- Stripe Subscription ID
- Email address
- GitHub login
Release Notes:
- N/A
https://github.com/zed-industries/zed/issues/30972 brought up another
case where our context is not enough to track the actual source of the
issue: we get a general top-level error without inner error.
The reason for this was `.ok_or_else(|| anyhow!("failed to read HEAD
SHA"))?; ` on the top level.
The PR finally reworks the way we use anyhow to reduce such issues (or
at least make it simpler to bubble them up later in a fix).
On top of that, uses a few more anyhow methods for better readability.
* `.ok_or_else(|| anyhow!("..."))`, `map_err` and other similar error
conversion/option reporting cases are replaced with `context` and
`with_context` calls
* in addition to that, various `anyhow!("failed to do ...")` are
stripped with `.context("Doing ...")` messages instead to remove the
parasitic `failed to` text
* `anyhow::ensure!` is used instead of `if ... { return Err(...); }`
calls
* `anyhow::bail!` is used instead of `return Err(anyhow!(...));`
Release Notes:
- N/A
This PR makes it so we only create a Zed Free subscription if there is
no other active subscription, rather than just having another Zed Free
subscription.
Release Notes:
- N/A
Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
This PR makes it so we create a Zed Free subscription when issuing an
LLM token, if one does not already exist.
Release Notes:
- N/A
---------
Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
This mostly affects local development. It fixes a bug where we would
only process one Stripe event per polling period (5 seconds) when
hitting old events.
Release Notes:
- N/A
Co-authored-by: Marshall Bowers <git@maxdeviant.com>
This PR makes it so a user can initiate a checkout session for a Zed Pro
trial while on the Zed Free plan.
Release Notes:
- N/A
Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
This PR adds a sanity check to ensure that we only subscribe the user to
Zed Free if they don't already have an active subscription.
Release Notes:
- N/A
This PR makes the `product` field required in the request body for `POST
/billing/subscriptions`.
We were already passing this everywhere, in practice.
Release Notes:
- N/A
This PR adds a new `POST /billing/subscriptions/sync` endpoint that can
be used to sync a user's billing subscriptions from Stripe.
Release Notes:
- N/A
- Adds a new smoke test for the use of the read_file tool by the agent
in an SSH project
- Fixes the SSH shutdown sequence to use a timer from the app's executor
instead of always using a real timer
- Changes the main executor loop for tests to advance the clock
automatically instead of panicking with `parked with nothing left to
run` when there is a delayed task
Release Notes:
- N/A
This PR removes some legacy claims related to the old billing from the
LLM token.
We already stopped reading this in the LLM Worker.
Also removed an outdated feature flag check that restricted access to
obtaining an LLM token.
Release Notes:
- N/A