Skip to content

Create new Iterable trigger for Duo Pro post-purchase email

What does this MR do and why?

Add an iterable trigger for new Duo Pro post-purchase seat allocation email.

Related to #441506

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

How to set up and validate locally

  1. Check out the branch
  2. Create a new top level group
  3. Setup some seed records
namespace = Group.last
add_on = GitlabSubscriptions::AddOn.find_or_create_by!(name: "code_suggestions") {|e| e.description = "Test"}
add_on_purchase = GitlabSubscriptions::AddOnPurchase.create!(
  add_on: add_on, namespace: namespace, expires_on: 1.month.from_now, quantity: 5, purchase_xid: 'A-S0001'
)
add_on_purchase.to_global_id.to_s # example: "gid://gitlab/GitlabSubscriptions::AddOnPurchase/9"
namespace.users.first.to_global_id.to_s # example: "gid://gitlab/User/85"

# enable the feature flag
Feature.enable(:hamilton_seat_management)
  1. Go to graphql explorer (logged in as admin): http://gdk.test:3000/-/graphql-explorer, and use following query and variables, update the two Ids as needed

mutation {
  userAddOnAssignmentCreate(
    input: {
      userId: "gid://gitlab/User/85",
      addOnPurchaseId: "gid://gitlab/GitlabSubscriptions::AddOnPurchase/9",
    }) {
    errors
  }
}
  1. Run the query and check that response has no errors errors: []
  2. Go to /admin/sidekiq and check the Retries tab
  3. Make sure you can see CreateIterableWorker failed job: Screenshot_2024-02-23_at_10.11.22_AM
Edited by Roy Liu

Merge request reports