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

Have the CLI Reuse and Cleanup the test data it creates (i.e. clean up your own mess) #1092

Open
hades200082 opened this issue Jul 2, 2023 · 7 comments
Labels
enhancement New feature or request

Comments

@hades200082
Copy link

Problem

Use the Stripe CLI to build out integrations without interfering with other users creating test products that are effectively "drafts" waiting to move to production or getting in their way.

As it stands the Stripe CLI can create hundreds or thousands of products, customers, etc. in a single day of development and testing. It's unacceptable that this test data is left in my test account with no simple way to remove it without also removing the test data I created manually (i.e. the drafts of what will be my live plans/products eventually)

Feature

  1. Stripe CLI should re-use the products, customers, etc. that it creates rather than creating new ones on every trigger command.
  2. Stripe CLI should keep track of the things (maybe using metadata on the items or something, or storing it locally if required) it creates and provide a mechanism to delete all of the CLI-created test data at the end of a session or on-demand.

As I see it the stripe CLI is creating a mess in my test account. It's the CLIs responsibility to clean up after itself.

Also see:

@hades200082 hades200082 added the enhancement New feature or request label Jul 2, 2023
@jsteele-stripe
Copy link
Contributor

Thanks for the suggestion! In the meantime, you can delete all test data on the account with a single click via the Dashboard.

@hades200082
Copy link
Author

The problem I'm facing is that I have products in the test environment that I need to keep. Deleting the test data manually is at best tedious and at worst impossible.

@chpmrc
Copy link

chpmrc commented Jul 9, 2023

Yeah this is quite the disappointment. Deleting all your test data also deletes all the products etc. that you carefully crafted, not just the mock products created by the CLI. Found out the hard way...

@ginjo
Copy link

ginjo commented Jul 19, 2023

Doing a google search for stripe test webhooks, I discovered the stripe-cli 'trigger' function and merrily went about developing and refining my webhook integration. I even created a handy wrapper script to display both sides of the operation in a split-pane screen session. Later, I went to my dashboard to change some settings and discovered the awful mess I'd made (Vat of Acid episode, Rick & Morty). Doing a full-wipe of my test-mode environment is not an option, as I have valuable prototype and longer-term test data that I need to keep.

If stripe-cli won't track and clean up the data it creates, we need some other options. Here are some suggestions.

  • Allow our stripe account to instantiate multiple test environments. Currently, test-mode is misleading. It's not really a mode, it's an environment. If we could create/delete test environments on-the-fly, we could avoid making a mess in our "main" development environment.
  • Give us a dashboard feature to allow batch/bulk/multiple deletions of data.
  • Include a sentence or two in the documentation, warning that the current implementation of the cli's stripe trigger will create a lot of data in the test environment with the only remedy being to delete ALL data.

@hades200082
Copy link
Author

I've stopped using trigger now.

Instead I create the event by using the checkout, then I replay the events that created as needed.

@ginjo
Copy link

ginjo commented Jul 21, 2023

@hades200082 Cool, are you using the CLI to replay, or is that a dashboard-only function?

@hades200082
Copy link
Author

I use the CLI to replay it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants