diff --git a/.circleci/config.yml b/.circleci/config.yml index 8b3ad0857b..dd8b6fbf05 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -28,9 +28,9 @@ workflows: # unpackaged source test, we do not want a package installed here - mbianco+standardcpq@stripe.com # 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 - mbianco+cpqmulticurrency@stripe.com @@ -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: @@ -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" @@ -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" diff --git a/README.md b/README.md index d49d427ab1..94975a98cb 100644 --- a/README.md +++ b/README.md @@ -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 mbianco+standardcpq@stripe.com -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 mbianco+standardcpq@stripe.com ``` @@ -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 diff --git a/sfdx/bin/generate-cpq-scratch-org b/sfdx/bin/generate-cpq-scratch-org index 2c0e50c0bf..e20133a6d5 100755 --- a/sfdx/bin/generate-cpq-scratch-org +++ b/sfdx/bin/generate-cpq-scratch-org @@ -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' diff --git a/test/support/common_helpers.rb b/test/support/common_helpers.rb index 1d6d0a3a11..8aa67a9d33 100644 --- a/test/support/common_helpers.rb +++ b/test/support/common_helpers.rb @@ -76,9 +76,12 @@ def make_user(sandbox: true, save: false, random_user_id: false, livemode: false user.enable_feature(FeatureFlags::SF_CACHING) end - # mbianco+cpqpackage@stripe.com - if user.salesforce_account_id == "00D8c000006J9X9EAK" + if user.salesforce_account_id == "00DHo0000007HgXMAU" + # platform-integrations-eng+qapackage@stripe.com user.connector_settings[CONNECTOR_SETTING_SALESFORCE_NAMESPACE] = SalesforceNamespaceOptions::QA.serialize + elsif user.salesforce_account_id == "00D6e000000qb1uEAA" + # platform-integrations-eng+prodpackage@stripe.com + user.connector_settings[CONNECTOR_SETTING_SALESFORCE_NAMESPACE] = SalesforceNamespaceOptions::PRODUCTION.serialize else user.connector_settings[CONNECTOR_SETTING_SALESFORCE_NAMESPACE] = SalesforceNamespaceOptions::NONE.serialize end