giseldo/neodataset huggingface dataset:
Community Programs Self-Checkout - heading-and-description component

As part of https://gitlab.com/gitlab-org/customers-gitlab-com/-/issues/2363#note_551260268 we need a `heading-and-description` (or whichever name makes sense) in multiple components

[Designs](https://gitlab.com/gitlab-org/customers-gitlab-com/-/issues/2677/designs/SaaS_-_Community_programs_checkout.png)


![image](/uploads/a3ac0614c2b3f2239c2e6da5f91469a1/image.png)


### TODO

1. Create component and consume in existing flows
1. Add to Community Programs Self-Checkout SaaS and Self-Managed

Story points: 2.0
Community Programs Self-Checkout - SaaS or Self-Managed landing page

As part of https://gitlab.com/groups/gitlab-org/-/epics/5068 users will be guided to CustomersDot where they choose Self-Managed or SaaS to redeem their code.

[User flow](https://gitlab.com/gitlab-org/customers-gitlab-com/-/issues/2677/designs/User_flow.png)


![image](/uploads/1ae0f0a8de2b44a87260bb55052ee08b/image.png)


### TODO

1. Extract [the HAML code on the current Plans](https://gitlab.com/gitlab-org/customers-gitlab-com/-/blob/d06a549e3c8bd20fc78403ed5317f85ba169776d/app/views/plans/index.html.haml#L16-17) landing page to a shared HAML partial.
1. Ensure "Claim" buttons link to correct purchase flows

Story points: 2.0
SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data

https://sentry.gitlab.net/gitlab/customersgitlabcom/issues/2508642/?referrer=gitlab_plugin

```
SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data
  at tryJsonParse (./app/frontend/javascripts/lib/try_json_parse.js:13:17)
  at apply (./app/frontend/javascripts/sessions/init_auth.js:20:23)
```

Story points: 2.0
EdCast Settlement Revenue SKU

# SKU Request Summary

<!---
Provide a brief description of what this SKU will be used for.
--->



## SKU Requirements

In order to expedite your request, please complete all of the following information.
Any questions about this template or this request can be directed to @amandarueda in the comments of this issue.

* [x] SKU Name: EdCast Settlement Revenue
* [x] SKU Code/ID: [EdCast Settlement Revenue](https://docs.google.com/spreadsheets/d/1QQ_9WmgvvrIaNPzGiODojUd2QJzLeV46JxNqHgZWTOU/edit?usp=sharing)
* [x] Zuora Plan Name: [EdCast Settlement Revenue](https://docs.google.com/spreadsheets/d/1QQ_9WmgvvrIaNPzGiODojUd2QJzLeV46JxNqHgZWTOU/edit?usp=sharing)
* [x] Zuora Plan ID: [EdCast Settlement Revenue](https://docs.google.com/spreadsheets/d/1QQ_9WmgvvrIaNPzGiODojUd2QJzLeV46JxNqHgZWTOU/edit?usp=sharing)
* [ ] Service type: add-on
* [x] Does this need to be purchase-able via CustomersDot? No
* [x] Does this service renew? No
     * [ ] If yes, what is the renewal cadence? `monthly | annually | other`
* [ ] Should an email be sent indicating the subscription is coming to an end? No 
* [ ] Is there a unit of measure, if so what? Yes Education Service
* [ ] Does this service provision anything? other
     * [ ] If yes, please describe in detail what should be provisioned including the systems affected:
* [ ] How soon do you need this SKU ? 2021-04-30
* [x] Who in Sales-Ops approved this request: @dhong cc: @Jesse @james_harrison 
* [ ] Link to originating Finance issue: https://gitlab.com/gitlab-com/Finance-Division/finance/-/issues/3924
* [ ] Apply the appropriate `BTG Priority` label to this issue.

Story points: 2.0
Investigate orders without corresponding subscription object in production

<!-- Please complete the template below as best as you can. Make sure to check if this issue has already been raised by someone else first to avoid duplication. 

For each section below, please add screenshots or links or anything that may help visual learners understand the problem better, even if this takes you an extra minute or two this is a great help to some folks.

https://www.learning-styles-online.com/style/visual-spatial/

-->

### Problem

While running the rake task to update subscriptions in Zuora with their namespace data (https://gitlab.com/gitlab-org/customers-gitlab-com/-/merge_requests/2962), some orders came through with a subscription name but there was no corresponding subscription object when trying to access `order.subscription` (relevant [method](https://gitlab.com/gitlab-org/customers-gitlab-com/-/blob/b1bb01424444a4f020dd58458e9679eb3ce970fa/app/models/order.rb#L117-135)). Because of this we didn't update the subscription in Zuora because `order.subscription&.z_subscription` was `nil`.

Not really sure if this really is a problem, but just wanted to flag it and check since there were some active SAAS non-trial orders like this.

#### Examples

I grabbed these from the task output (there were many more)

```
order1 = Order.find 114699
=> #<Order id: 114699, REDACTED >
order1.subscription_name
=> "A-S00033377"
order1.subscription
=> nil

order2 = Order.find 115401
=> #<Order id: 115401, REDACTED >
order2.subscription_name
=> "A-S00033654"
order2.subscription
=> nil
```

### Proposal

- Generate a report with all orders that do not have a subscription object.
- Trace origin of the order.
- Determine possible cause.
- Based on determination above, plan for remediation such that the order becomes correctly formed or properly cancelled.

### Result

### Next steps (if any)

### How will we measure success?

Story points: 5.0
[BE] GraphQL: Secure gitlab.com to customers-dot proxy

The current gitlab.com to customers-dot graphql proxy works fine for unauthenticated resources but we need a way to securely access customer-dot resources from gitlab.com. I can think of two possible solutions:

### Reuse email and token?

Can we use the customer email and token like we do [here](https://gitlab.com/gitlab-org/gitlab/blob/7854f0e68d6f90c98410eb4b346630dd88c1188d/ee/lib/gitlab/subscription_portal/clients/rest.rb#L23)? We might be able to just attach the headers to the payload [here](https://gitlab.com/gitlab-org/gitlab/blob/be78ccd832fd40315c5e63bb48ee1596ae146f56/app/controllers/customers_dot/proxy_controller.rb#L12)?

### Don't reauth

Since we control both gitlab.com and customers-dot and the user is presumably already authed on gitlab.com we shouldn't need to reauth on customers-dot. Can we just attach the current logged in gitlab.com user id at the gitlab.com proxy controller level and secure the api between them via SSL? Whitelist? Can we just reuse [the admin token](https://gitlab.com/gitlab-org/gitlab/blob/169404d6992f4a87910277dde16b1828bf9863e5/ee/lib/gitlab/subscription_portal/client.rb#L24)?

Story points: 3.0
Handle retries if there are SFDC errors while creating opportunity and related objects

<!-- Please complete the template below as best as you can. Make sure to check if this issue has already been raised by someone else first to avoid duplication. 

For each section below, please add screenshots or links or anything that may help visual learners understand the problem better, even if this takes you an extra minute or two this is a great help to some folks.

https://www.learning-styles-online.com/style/visual-spatial/

-->

### Problem

Sometimes we hit a locked row in SFDC when trying to create or update opportunity objects. When this happens, we get some `RestForce` errors but the transaction is left without its corresponding object in SFDC (like the opportunity or the quote).

This example from production shows two errors, first there's a [`Restforce::ErrorCode::UnableToLockRow`](https://sentry.gitlab.net/gitlab/customersgitlabcom/issues/2465506/events/40134490/) which causes a  [`Salesforce::OpportunityNotCreated`](https://sentry.gitlab.net/gitlab/customersgitlabcom/issues/2448958/events/40134492/) in `Salesforce::CreateOpportunityWorker`.

With the `create_opportunity_objects` feature flag in staging, the error appears when creating the quote. [Restforce::ErrorCode::CannotInsertUpdateActivateEntity](https://sentry.gitlab.net/gitlab/customersstggitlabcom/issues/2448888/) prevents the creation of the quote and all its related objects.

### Challenges

:balloon: The error appears to be random

:balloon: Since it's apparently random, the error is not very easy to reproduce locally

### Proposal

Rescue these Restforce errors and retry the creation of opportunity objects (`Quote`, `Quote Amendment`, `Rate Plan` and `Rate Plan Charge`) while avoiding re-creating already created ones.

### Result

We avoid having transactions missing their opportunity or quote record in SFDC.

### Next steps (if any)

### How will we measure success?

Story points: 2.0
Follow-up from "Update the info for the orphaned subs email"

The following discussion from !3062 should be addressed:

- [ ] @cwiesner started a [discussion](https://gitlab.com/gitlab-org/customers-gitlab-com/-/merge_requests/3062#note_548297479): 

    > **question:** I was wondering what would happen if the dates would be the same value - which isn't the case here. While taking a closer look into this I noticed that the expectation for `include(subscription.name)` probably matches on the customer's name instead of the actual subscription name:
    > 
    > ```
    > (byebug) customer.full_name
    > "FirstName LastName"
    > (byebug) subscription.name
    > "Name"
    > ```
    > 
    > So what do you think about testing these values with the label like
    > 
    > ```
    > expect(body).to have_content("Starts #{order.start_date.strftime('%Y-%m-%d')}", normalize_ws: true)
    > ```
    > ?

Story points: 1.0
Introduce n__ function to help with pluralization

### Problem

This is a follow-up to https://gitlab.com/gitlab-org/customers-gitlab-com/-/merge_requests/3019#note_548563215.

We've at least one instance where we hack a solution for pluralizing a word.

### Proposal

Introduce `n__` helper function as implemented in [GitLab's codebase](https://gitlab.com/gitlab-org/gitlab/-/blob/3205f3c62750db60eb94792920d2fc7c4dcb45b4/app/assets/javascripts/locale/index.js#L82) and use it in instances when we want pluralization.

### Next steps (if any)

### How will we measure success?

Story points: 2.0
Extract usage of $ as a currency to a constant

This is a follow-up from https://gitlab.com/gitlab-org/customers-gitlab-com/-/merge_requests/3019#note_548207997.

We're using the `$` symbol directly in the strings, we should create a constant to hold the USD symbol and use that constant instead of embedding the symbol within strings.

Instances of using `$` (as of 2021-04-09):

```
app/frontend/javascripts/subscription/components/dotcom_subscription_renew_form.vue
114:            ${this.discountedPlanName} at $${this.currentDiscountPrice} and receive
139:      return `Upgrade to ${this.discountedPlanName} at $${this.currentDiscountPrice}`;
216:      const discountPrices = discounts.map((discount) => formatMoney(discount, '$', 0));

app/frontend/javascripts/subscription/components/upgrade_subscription_app.vue
204:      return `Upgrade to ${this.discountedPlanName} at $${this.currentDiscountedPrice}`;
284:      const discountPrices = discounts.map((discount) => formatMoney(discount, '$', 0));
308:          'To get a new license with the correct number of users, you need to enter the current number of users over license or larger if you think you’ll need more in the future. You’ll be charged for these additional seats at a special discounted price of $6 per user per month.',
314:          'Add additional seats at a special discounted price of $6 per user per month.',

app/frontend/javascripts/subscription/components/subscription_renew_form.vue
152:            ${this.discountedPlanName} at $${this.currentDiscountPrice} and receive
177:      return `Upgrade to ${this.discountedPlanName} at $${this.currentDiscountPrice}`;
264:      const discountPrices = discounts.map((discount) => formatMoney(discount, '$', 0));

app/frontend/javascripts/purchase/components/purchase_summary_card.vue
82:      return formatMoney(this.pricePerUnit, '$', '', '', '', 0, 0);
```

To get the list I used [ripgrep](https://github.com/BurntSushi/ripgrep):

```bash
rg '(?!\.)\$(?![\.|\(|\{|emit|options|attrs| |:])' -g '*.vue' --pcre2
```

Story points: 1.0
Allow seat link to have not record counts

Related to https://gitlab.com/gitlab-org/gitlab/-/issues/326931

### Problem

We want to seat link even when the instance does not have data on active user counts. This is because the other goal of seat link, which is syncing the license, is equally important.

### Proposal

Mark `license_seat_links` table's `active_user_count` and `max_histoical_user_count` columns to be nullable.

### Result

Allow seat link to occur even when no counts information is present

### Next steps (if any)

https://gitlab.com/gitlab-org/gitlab/-/issues/326931

Story points: 1.0
Test new ProductRatePlan for the Education Enterprise Subscription (staging only)

### Summary

This came up in https://gitlab.com/gitlab-com/Finance-Division/finance/-/issues/3487#note_546727243

The Edu PnP creates a new "**Enterprise Education Subscription**" for qualifying educational institutions that allows institutions to purchase our top-tier subscriptions, at a discount, in bulk, for the entire institution without use case or seat limitations. The price point is based on the size of the institution, of which there are four size classes. Institutions may request any number of seats per one of the SKUs up to the size of their total enrollment.

The product rate plan needs to be set up as a FlatFee and therefore a Quantity of 1. The expectation is that it should provision a specific number of seats (greater than 1).  Because our current provisioning process is reliant on the quantity to be passed, it was suggested to figure out a way to have Zuora product rate plan also pass the quantity, while keeping the FlatFee charge.

For additional information about how this Zuora setup idea came about, please see [agenda notes](https://docs.google.com/document/d/1IBUJTh2qLn17OwT79kHrJ1IWY0cifRVqdNtAZx3KSFY/edit#heading=h.w1i69kcg4lck). 

### Proposal

Perform testing in Zuora Sandbox / CustomersDot Stage for the proposed new Product Rate Plan.

@mquitevis has created a test Product Rate Plan with 2 Product Rate Plan Charges under [`SaaS - Ultimate` product](https://apisandbox.zuora.com/apps/Product.do?method=view&id=2c92c0f97700a4f701770609612c2395). 
 
![image](/uploads/be88b6a0658e73eaa2fa1badb3c0e41f/image.png)

ProductRatePlanId = `2c92c0f978ac50700178ac9e4af64cdc`

We now need to add it to our configuration, and then test provisioning in stage.

Story points: 2.0
Licence or subscription  email notifications to SALs, AEs, TAM and/or SA

<!-- Please complete the template below as best as you can. Make sure to check if this issue has already been raised by someone else first to avoid duplication. 

For each section below, please add screenshots or links or anything that may help visual learners understand the problem better, even if this takes you an extra minute or two this is a great help to some folks.

https://www.learning-styles-online.com/style/visual-spatial/

-->

### Problem

When a deal sales process finishes for new or renewals, the customer gets an email with instructions to use their purchase. The customer's account team doesn't receive this email notification. 

In some or most cases in my experience, the customer asks support to activate their licenses or subscription to their account team; then the account team needs:
  - Figure out if the email was or wasn't sent.
  - If so, check who was supposed to receive the email.
  - In case the primary contact is wrong,  start an internal support process to solve it, guide the customer to open a support ticket to change the primary contact, and support the customer to activate their purchase.

### Proposal

- [x] Include  the account team in copy to the subscription/licence notifications email. 
  - [ ] Define who should receive this notification in CC.
     - [ ] SAL/AE only
     - [ ] SAL/AE + SDR
     - [ ] SA/AE + SDR + SA
     - [x] SA/AE + SDR + SA + TAM (if apply) 


### Result

As soon as we close a deal, the account team knows whether the email was sent to the correct contact or no.
If the customer asks for help, the account team has all the information to forward the email to the right persona without opening other internal processes.
In this email, the account team can guide the customer on changing the customer portal's administrator if they need it by opening a support ticket. 

### Next steps (if any)

TBD

### How will we measure success?

The account team receive in copy the email notification we usually send to our customers after we close a deal.

Story points: 2.0
Upgrade rails_admin to 2.2.0

Follow up from https://gitlab.com/gitlab-org/customers-gitlab-com/-/merge_requests/3048

We should remove that code and get the fix from upstream - https://github.com/sferik/rails_admin/commit/97ccc28940d65fee53b30c409c49032fbb0885db

We have to wait until the new gem version gets released first

Story points: 0.0
Make Salesforce::FindOrCreateLeadService work through a background job

### Problem

Part of https://gitlab.com/gitlab-org/customers-gitlab-com/-/issues/2112

Currently the `Salesforce::FindOrCreateLeadService` service is triggering an inline API call to Salesforce in order to find or create a Lead.

The service is used in the following sections:

- `CreateSalesforceLeadFromCustomerService`
  - Used in `Api::CustomersController#create`
  - Used in `RegistrationsController#create`
- `Gitlab::BaseTrialService`
  - Ingerited by `Gitlab::HostedPlans::CreateTrialService`
  - Inherited by `Gitlab::SelfHostedPlans::CreateTrialService`
  - Both services are used in `TrialsController#create`

As we can see, if there is an error with the API call, the customer registration or trial generation can be broken.

### Proposal

Perform the API call through a background job.

### Result

Performance and reliability of those endpoints will no longer be affected by an external service.

### Next steps (if any)

### How will we measure success?

### Availability & Testing

<!-- This section needs to be retained and filled in during the workflow planning breakdown phase of this feature proposal, if not earlier.

What risks does this change pose to our availability? How might it affect the quality of the product? What additional test coverage or changes to tests will be needed? Will it require cross-browser testing?

Please list the test areas (unit, integration and end-to-end) that needs to be added or updated to ensure that this feature will work as intended. Please use the list below as guidance.
* Unit test changes
* Integration test changes
* End-to-end test change

See the test engineering planning process and reach out to your counterpart Software Engineer in Test for assistance: https://about.gitlab.com/handbook/engineering/quality/test-engineering/#test-planning -->

The new Job (assuming we'll be using ActiveJob) should be accompanied by a job specification to ensure the job performs the appropriate task(s)

Story points: 3.0
Make Salesforce::CreateLeadService work through a background job

### Problem

Part of https://gitlab.com/gitlab-org/customers-gitlab-com/-/issues/2112

Currently the `Salesforce::CreateLeadService` service is triggering an inline API call through [`InstanceReviewCreateService`](https://gitlab.com/gitlab-org/customers-gitlab-com/blob/c4c6bf1d2e400456526fa92cb473a8f27c8e1d46/app/services/instance_review_create_service.rb#L36-36) -> [`InstanceReviewController#create`](https://gitlab.com/gitlab-org/customers-gitlab-com/blob/c4c6bf1d2e400456526fa92cb473a8f27c8e1d46/app/controllers/instance_review_controller.rb#L9-9). This operation is slowing down the mentioned endpoint and can break the application in case an unhandled exception from the Salesforce API is found.

### Proposal

Perform the API call through a background job.

### Result

Performance and reliability of that endpoint will no longer be affected by an external service.

### Next steps (if any)

### How will we measure success?

Story points: 2.0
CI Minutes provisioning - Trigger Purchase Identifiers syncs from CustomersDot to GitLab Minutes API

### Establish CI Minute Purchase Identifiers on CustomersDot

The following outlines requirements from the architecture proposal as defined in !3142, we've split up the tasks into separate issues along system boundaries. 

**Base components: CustomersDot**

- [x] Add a mechanism to return an object/data structure that represents 1+ minute packs purchases with a unique identifier (e.g. `RatePlanCharge ID` from Zuora) with an `expiry_date`, minutes purchased, and the namespace. 
- [x] Create a trigger for CI minutes purchases to sync/callback to GitLab CI Minutes API endpoint with Purchase Identifier data
- [x] Trigger CI Minute purchase sync/callback to GitLab minutes API with a successful purchase. 

**UI Components: CustomersDot**

- [ ] ~~Update Admin UI with a component that can trigger a callback to GitLab to sync CI Minute Purchase Data~~ Edit: moved to https://gitlab.com/gitlab-org/customers-gitlab-com/-/issues/3451


<details> 
<summary markdown="span">Previous Summary</summary>
## Summary

1. [ ] Create an API that we can fetch usage CI minutes statistics for a given namespace
1. [ ] Adapt UpdateGitlabPlanInfoWorker (UpdatePlanInfoService) or create wholly new a mechanism that can send CI Minute purchase information over to GItLab from CustomersDot.
</details>

### Availability & Testing

<!-- This section needs to be retained and filled in during the workflow planning breakdown phase of this feature proposal, if not earlier.

What risks does this change pose to our availability? How might it affect the quality of the product? What additional test coverage or changes to tests will be needed? Will it require cross-browser testing?

Please list the test areas (unit, integration and end-to-end) that needs to be added or updated to ensure that this feature will work as intended. Please use the list below as guidance.
* Unit test changes
* Integration test changes
* End-to-end test change

See the test engineering planning process and reach out to your counterpart Software Engineer in Test for assistance: https://about.gitlab.com/handbook/engineering/quality/test-engineering/#test-planning -->

In addition to any unit specs, we also should write integration tests between the the GitLab Minutes API and CustomersDot.  These integration tests can use mock APIs.

Additionally, an end-to-end test would also be recommended for executing the flow of provisioning more CI minutes and being reflected in both CustomersDot and GitLab.

Story points: 5.0