Skip to content

Commit

Permalink
swapped accounts (#1125)
Browse files Browse the repository at this point in the history
Co-authored-by: Brennen Ryder <[email protected]>
  • Loading branch information
brennen-stripe and btryder authored Jul 10, 2023
1 parent 148fa37 commit 618b3a0
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 26 deletions.
39 changes: 21 additions & 18 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ workflows:
# unpackaged source test, we do not want a package installed here
- [email protected]
# QA package test, all of the fields/rest endpoints/etc have a prefix
#- platform-integrations-bots+cpqqapackage@stripe.com
- platform-integrations-bots+qapackage@stripe.com
# production package test, has a different prefix from QA
# - brennen+prodtest@stripe.com
- platform-integrations-bots+prodpackage@stripe.com
# unpackaged source test, on an org with multi-currency enabled
- [email protected]

Expand Down Expand Up @@ -259,24 +259,27 @@ jobs:
# the current code should *always* be able to be deployed against the packaging org, if it can't be, this should block the build
deploySource "$SF_QA_PACKAGING_EMAIL"
# - run:
# name: "CPQ Prod Package Deployment Version"
# command: |
# if [ "$CIRCLE_BRANCH" != "main" ]; then
# echo "Not on main, will not deploy produciton package."
# exit 0
# fi
- run:
name: "CPQ Prod Package Deployment Version"
command: |
source ./sfdx/bin/run-tests-helpers
cd sfdx
# authorize before checking if on main so that the later steps have it auth'd
authorizeSalesforceAccount "$SF_PROD_PACKAGING_EMAIL"
# source ./sfdx/bin/run-tests-helpers
# cd sfdx
if [ "$CIRCLE_BRANCH" != "main" ]; then
echo "Not on main, will not deploy produciton package."
exit 0
fi
# authorizeSalesforceAccount "$SF_PROD_PACKAGING_EMAIL"
authorizeSalesforceAccount "$SF_PROD_PACKAGING_EMAIL"
# # make sure the same API version is used for local deployments, otherwise you'll run into weird errors
# # for some reason, the `sfdx config:set apiVersion=52.0` doesn't work and gets overwritten
# make sure the same API version is used for local deployments, otherwise you'll run into weird errors
# for some reason, the `sfdx config:set apiVersion=52.0` doesn't work and gets overwritten
# # the current code should *always* be able to be deployed against the packaging org, if it can't be, this should block the build
# deploySource $SF_PROD_PACKAGING_EMAIL
# the current code should *always* be able to be deployed against the packaging org, if it can't be, this should block the build
deploySource $SF_PROD_PACKAGING_EMAIL
# https://jira.corp.stripe.com/browse/PLATINT-1499
- run:
Expand All @@ -287,7 +290,7 @@ jobs:
exit 0
fi
SF_ACCOUNT_WITH_QA_PACKAGE_INSTALLED=mbianco+cpqpackage@stripe.com
SF_ACCOUNT_WITH_QA_PACKAGE_INSTALLED=platform-integrations-eng+qapackage@stripe.com
if [ "$SF_USERNAME" != "$SF_ACCOUNT_WITH_QA_PACKAGE_INSTALLED" ]; then
echo "Not the QA packaged org, exiting"
Expand Down Expand Up @@ -327,7 +330,7 @@ jobs:
exit 0
fi
SF_ACCOUNT_WITH_PROD_PACKAGE_INSTALLED=brennen+prodtest@stripe.com
SF_ACCOUNT_WITH_PROD_PACKAGE_INSTALLED=platform-integrations-bots+prodpackage@stripe.com
if [ "$SF_USERNAME" != "$SF_ACCOUNT_WITH_PROD_PACKAGE_INSTALLED" ]; then
echo "Not the production packaged org, exiting"
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,12 +190,12 @@ Note: The user can't assign the "Stripe Connector Coupon User" permission set wi
Here's how to manually clear our test data. This may be fixed with `SBQQ.TriggerControl.disable()` in the delete script, can remove this later if this is the case!

```shell
sfdx force:org:open -u platform-integrations-bots+cpqqapackage@stripe.com -p "/lightning/setup/ImportedPackage/home" > /dev/null
sfdx force:org:open -u platform-integrations-bots+qapackage@stripe.com -p "/lightning/setup/ImportedPackage/home" > /dev/null
sfdx force:org:open -u [email protected] -p "/lightning/setup/ImportedPackage/home" > /dev/null

# disable apex triggers

sfdx/bin/sfdx-wipe-account platform-integrations-bots+cpqqapackage@stripe.com
sfdx/bin/sfdx-wipe-account platform-integrations-bots+qapackage@stripe.com
sfdx/bin/sfdx-wipe-account [email protected]
```

Expand Down Expand Up @@ -296,18 +296,18 @@ Manual steps that need to be taken for the release to be verified by Salesforce:
- We only wish to test the currently deployed production package. Therefore we do NOT run the salesforce tests like we do in QA, this is because those tests involve pushing a new source install.
- If you accidentally run these tests against production, you must follow the below steps to clean up the prod test account:

- `sfdx force:source:delete -p force-app/main/default/ --apiversion=54.0 -u brennen+prodtest@stripe.com`
- `sfdx force:source:delete -p force-app/main/default/ --apiversion=54.0 -u platform-integrations-bots+prodpackage@stripe.com`
- If you are running into issues, try deleting the conflicts via the salesforce UI or via SFDX but specify down the path to just the problematic files.
- Some records may need to be manually altered:
- Go to the [Lightning App Builder](https://productiontest2-dev-ed.lightning.force.com/lightning/setup/FlexiPageList/page?address=%2F_ui%2Fflexipage%2Fui%2FFlexiPageFilterListPage) and select the 'Sync Record Record Page' that lacks a Namespace Prefix and has an 'Edit' button. Click edit and then 'Activation' in the top right hand corner. Under 'Org Default' click 'Remove as Org Default' and select both Desktop and Phone. Then click Save.

- If you are running into permission errors related to Orders, you are most likely missing the standard CPQ setup permissions that a real account would have. We have some permission sets created for us in the force-app/main/scratchSetup folder. If you are creating a new testing environment you will have to deploy this folder and assign the permissions to your test user.

- ie: `sfdx force:source:deploy -p force-app/main/scratchSetup -u brennen+prodtest@stripe.com` followed by `sfdx force:user:permset:assign -n "Order_Permissions" -u brennen`+prodtest@stripe.com
- ie: `sfdx force:source:deploy -p force-app/main/scratchSetup/permissionsets -u platform-integrations-bots+prodpackage@stripe.com` followed by `sfdx force:user:permset:assign -n "Order_Permissions" -u platform-integrations-bots+prodpackage@stripe.com`
- Right now, OrderPermissions is the only permission set we have defined but there may be additional ones in the future.

- If you are seeing Order upsert failures like "Can't save order products with negative quantities: Quantity"
- Check the following boxes on this page: `sfdx force:org:open -u brennen+prodtest@stripe.com -p "/lightning/setup/OrderSettings/home"`
- Check the following boxes on this page: `sfdx force:org:open -u platform-integrations-bots+prodpackage@stripe.com -p "/lightning/setup/OrderSettings/home"`
- Enable Negative Quantity
- Enable Zero Quantity

Expand Down
2 changes: 1 addition & 1 deletion sfdx/bin/generate-cpq-scratch-org
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ fi
echo "# CPQ Setup"
echo "Manual step: Installed Packages > Configure > Pricing & Calculation > Authorize"
echo "Manual step: Installed Packages > Configure > Pricing & Calculation > Enable Usage Based Pricing"
echo "Manual step: Installed Packages > Configure > Subscription & Renewals > Subscription Prorate Precision: Month"
echo "Manual step: Installed Packages > Configure > Subscription & Renewals > Subscription Prorate Precision: Monthly + Daily"
echo "Manual step: Installed Packages > Configure > Subscription & Renewals > Contract in Foreground"
echo "Manual step: Installed Packages > Configure > Order > Default Order Start Date > Quote Start Date"
echo $'\n\n'
Expand Down
7 changes: 5 additions & 2 deletions test/support/common_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,12 @@ def make_user(sandbox: true, save: false, random_user_id: false, livemode: false
user.enable_feature(FeatureFlags::SF_CACHING)
end

# [email protected]
if user.salesforce_account_id == "00D8c000006J9X9EAK"
if user.salesforce_account_id == "00DHo0000007HgXMAU"
# [email protected]
user.connector_settings[CONNECTOR_SETTING_SALESFORCE_NAMESPACE] = SalesforceNamespaceOptions::QA.serialize
elsif user.salesforce_account_id == "00D6e000000qb1uEAA"
# [email protected]
user.connector_settings[CONNECTOR_SETTING_SALESFORCE_NAMESPACE] = SalesforceNamespaceOptions::PRODUCTION.serialize
else
user.connector_settings[CONNECTOR_SETTING_SALESFORCE_NAMESPACE] = SalesforceNamespaceOptions::NONE.serialize
end
Expand Down

0 comments on commit 618b3a0

Please sign in to comment.