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

Post upgrade go live #1071

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -2,9 +2,9 @@ name: Build

on:
push:
branches: [staging, master, ep-upgrade-stage, ep-upgrade-prod, ep-upgrade]
branches: [staging, master]
pull_request:
branches: [staging, master, ep-upgrade-stage, ep-upgrade-prod, ep-upgrade]
branches: [staging, master]

permissions:
id-token: write
@@ -50,9 +50,9 @@ jobs:
deploy:
runs-on: ubuntu-latest
environment:
name: ${{ (github.ref == 'refs/heads/master' && 'production') || (github.ref == 'refs/heads/ep-upgrade-stage' && 'nonprod') || (github.ref == 'refs/heads/ep-upgrade-prod' && 'preprod') || 'staging' }}
name: ${{ (github.ref == 'refs/heads/master' && 'production') || 'staging' }}
needs: [lint, test]
if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/staging' || github.ref == 'refs/heads/ep-upgrade-stage' || github.ref == 'refs/heads/ep-upgrade-prod')
if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/staging')
steps:
- uses: actions/checkout@v2

2 changes: 1 addition & 1 deletion src/app/analytics/analytics.factory.spec.js
Original file line number Diff line number Diff line change
@@ -513,7 +513,7 @@ describe('analytics factory', () => {

describe('productViewDetailsEvent', () => {
const productData = {
"path": "https://give-stage-cloud.cru.org/designations/0/6/4/3/0/0643021.html",
"path": "https://give-stage2.cru.org/designations/0/6/4/3/0/0643021.html",
"designationNumber": "0643021",
"campaignPage": null,
"replacementDesignationNumber": null,
52 changes: 0 additions & 52 deletions src/common/app.config.js
Original file line number Diff line number Diff line change
@@ -18,31 +18,12 @@ const appConfig = /* @ngInject */ function (envServiceProvider, $compileProvider
devcloud: [
'give-dev-cloud.cru.org'
],
stagecloud: [
'give-stage-cloud.cru.org'
],
prodcloud: [
'give-prod-cloud.cru.org'
],
staging: [
'give-stage2.cru.org',
'stage.cru.org',
'uatauth.aws.cru.org',
'uatpub.aws.cru.org',
'uatdisp.aws.cru.org',
'cru-givestage.s3.amazonaws.com',
'give-stage-static.cru.org'
],
nonprod: [
'give-stage2-next.cru.org',
'cru-give-web-assets-nonprod.s3.amazonaws.com',
'give-nonprod-static.cru.org'
],
preprod: [
'give-prod-static.cru.org',
'cru-give-web-assets-preprod.s3.amazonaws.com',
'give-preprod.cru.org'
],
production: []
},
vars: {
@@ -62,22 +43,6 @@ const appConfig = /* @ngInject */ function (envServiceProvider, $compileProvider
publicGive: 'https://give-dev-cloud.cru.org',
acsUrl: 'https://cru-mkt-stage1.adobe-campaign.com/lp/LP63?_uuid=f1938f90-38ea-41a6-baad-9ac133f6d2ec&service=%404k83N_C5RZnLNvwz7waA2SwyzIuP6ATcN8vJjmT5km0iZPYKUUYk54sthkZjj-hltAuOKDYocuEi5Pxv8BSICoA4uppcvU_STKCzjv9RzLpE4hqj&pkey='
},
stagecloud: {
apiUrl: 'https://give-stage-cloud.cru.org',
imgDomain: '//give-static.cru.org',
imgDomainDesignation: 'https://give-stage-cloud.cru.org',
publicCru: 'https://stage-cloud.cru.org',
publicGive: 'https://give-stage-cloud.cru.org',
acsUrl: 'https://cru-mkt-stage1.adobe-campaign.com/lp/LP63?_uuid=f1938f90-38ea-41a6-baad-9ac133f6d2ec&service=%404k83N_C5RZnLNvwz7waA2SwyzIuP6ATcN8vJjmT5km0iZPYKUUYk54sthkZjj-hltAuOKDYocuEi5Pxv8BSICoA4uppcvU_STKCzjv9RzLpE4hqj&pkey='
},
prodcloud: {
apiUrl: 'https://give-prod-cloud.cru.org',
imgDomain: '//give-static.cru.org',
imgDomainDesignation: 'https://give-prod-cloud.cru.org',
publicCru: 'https://www.cru.org',
publicGive: 'https://give-prod-cloud.cru.org',
acsUrl: 'https://cru-mkt-prod1-m.adobe-campaign.com/lp/LPEmailPrefCenter?_uuid=8831d67a-0d46-406b-8987-fd07c97c4ca7&service=%400fAlW4GPmxXExp8qlx7HDlAM6FSZUd0yYRlQg6HRsO_kglfi0gs650oHPZX6LrOvg7OHoIWWpobOeGZduxdNU_m5alc&pkey='
},
staging: {
apiUrl: 'https://give-stage2.cru.org',
imgDomain: '//give-static.cru.org',
@@ -86,23 +51,6 @@ const appConfig = /* @ngInject */ function (envServiceProvider, $compileProvider
publicGive: 'https://give-stage2.cru.org',
acsUrl: 'https://cru-mkt-stage1.adobe-campaign.com/lp/LP63?_uuid=f1938f90-38ea-41a6-baad-9ac133f6d2ec&service=%404k83N_C5RZnLNvwz7waA2SwyzIuP6ATcN8vJjmT5km0iZPYKUUYk54sthkZjj-hltAuOKDYocuEi5Pxv8BSICoA4uppcvU_STKCzjv9RzLpE4hqj&pkey='
},
nonprod: {
apiUrl: 'https://give-stage2-next.cru.org',
imgDomain: '//give-nonprod-static.cru.org',
imgDomainDesignation: 'https://give-stage2-next.cru.org',
publicCru: 'https://stage.cru.org',
publicGive: 'https://give-stage2-next.cru.org',
acsUrl: 'https://cru-mkt-stage1.adobe-campaign.com/lp/LP63?_uuid=f1938f90-38ea-41a6-baad-9ac133f6d2ec&service=%404k83N_C5RZnLNvwz7waA2SwyzIuP6ATcN8vJjmT5km0iZPYKUUYk54sthkZjj-hltAuOKDYocuEi5Pxv8BSICoA4uppcvU_STKCzjv9RzLpE4hqj&pkey=',
isBrandedCheckout: false
},
preprod: {
apiUrl: 'https://give-preprod.cru.org',
imgDomain: '//give-prod-static.cru.org',
imgDomainDesignation: 'https://give-preprod.cru.org',
publicCru: 'https://www.cru.org',
publicGive: 'https://give-preprod.cru.org',
acsUrl: 'https://cru-mkt-prod1-m.adobe-campaign.com/lp/LPEmailPrefCenter?_uuid=8831d67a-0d46-406b-8987-fd07c97c4ca7&service=%400fAlW4GPmxXExp8qlx7HDlAM6FSZUd0yYRlQg6HRsO_kglfi0gs650oHPZX6LrOvg7OHoIWWpobOeGZduxdNU_m5alc&pkey='
},
production: {
apiUrl: 'https://give.cru.org',
imgDomain: '//give-static.cru.org',
Original file line number Diff line number Diff line change
@@ -89,7 +89,7 @@ class BankAccountController {
state: 'encrypting'
}
})
const productionEnvironments = ['production', 'prodcloud', 'preprod']
const productionEnvironments = ['production']
const actualEnvironment = this.envService.get()
const ccpEnvironment = productionEnvironments.includes(actualEnvironment) ? 'production' : actualEnvironment
cruPayments.bankAccount.init(ccpEnvironment, ccpEnvironment === 'production' ? ccpKey : ccpStagingKey)
Original file line number Diff line number Diff line change
@@ -190,62 +190,6 @@ describe('bank account form', () => {
expect(self.outerScope.onPaymentFormStateChange).toHaveBeenCalledWith({ state: 'loading', payload: expectedData })
})

it('should send a request to save the bank account payment info using the prodcloud env', () => {
self.controller.bankPayment = {
accountType: 'checking',
bankName: 'First Bank',
routingNumber: '123456789',
accountNumber: '123456789012'
}
self.formController.$valid = true
self.controller.envService.set('prodcloud')
self.controller.savePayment()

expect(cruPayments.bankAccount.init).toHaveBeenCalledWith('production', ccpKey)
expect(cruPayments.bankAccount.encrypt).toHaveBeenCalledWith('123456789012')
expect(self.formController.$setSubmitted).toHaveBeenCalled()
const expectedData = {
bankAccount: {
'account-type': 'checking',
'bank-name': 'First Bank',
'encrypted-account-number': encryptedAccountNumber,
'display-account-number': '9012',
'routing-number': '123456789'
}
}

expect(self.controller.onPaymentFormStateChange).toHaveBeenCalledWith({ $event: { state: 'loading', payload: expectedData } })
expect(self.outerScope.onPaymentFormStateChange).toHaveBeenCalledWith({ state: 'loading', payload: expectedData })
})

it('should send a request to save the bank account payment info using the preprod env', () => {
self.controller.bankPayment = {
accountType: 'checking',
bankName: 'First Bank',
routingNumber: '123456789',
accountNumber: '123456789012'
}
self.formController.$valid = true
self.controller.envService.set('preprod')
self.controller.savePayment()

expect(cruPayments.bankAccount.init).toHaveBeenCalledWith('production', ccpKey)
expect(cruPayments.bankAccount.encrypt).toHaveBeenCalledWith('123456789012')
expect(self.formController.$setSubmitted).toHaveBeenCalled()
const expectedData = {
bankAccount: {
'account-type': 'checking',
'bank-name': 'First Bank',
'encrypted-account-number': encryptedAccountNumber,
'display-account-number': '9012',
'routing-number': '123456789'
}
}

expect(self.controller.onPaymentFormStateChange).toHaveBeenCalledWith({ $event: { state: 'loading', payload: expectedData } })
expect(self.outerScope.onPaymentFormStateChange).toHaveBeenCalledWith({ state: 'loading', payload: expectedData })
})

it('should send a request to save the bank account payment info with an existing payment method where the accountNumber is empty', () => {
self.controller.paymentMethod = {
'display-account-number': '9012'
Original file line number Diff line number Diff line change
@@ -138,7 +138,7 @@ class CreditCardController {
}) // Send masked card number when card number is not updated
: this.tsysService.getManifest()
.mergeMap(data => {
const productionEnvironments = ['production', 'prodcloud', 'preprod']
const productionEnvironments = ['production']
const actualEnvironment = this.envService.get()
const ccpEnvironment = productionEnvironments.includes(actualEnvironment) ? 'production' : actualEnvironment

Original file line number Diff line number Diff line change
@@ -253,38 +253,6 @@ describe('credit card form', () => {
expect(self.outerScope.onPaymentFormStateChange).toHaveBeenCalledWith({ state: 'loading', payload: expectedData })
})

it('should handle prodcloud environment properly', () => {
self.controller.envService.set('prodcloud')
self.controller.creditCardPayment = {
cardNumber: '4111111111111111',
cardholderName: 'Person Name',
expiryMonth: 12,
expiryYear: 2019,
securityCode: '123'
}
self.controller.useMailingAddress = true
self.formController.$valid = true
self.controller.savePayment()

expect(cruPayments.creditCard.init).toHaveBeenCalledWith('production', '<device id>', '<manifest>')
})

it('should handle preprod environment properly', () => {
self.controller.envService.set('preprod')
self.controller.creditCardPayment = {
cardNumber: '4111111111111111',
cardholderName: 'Person Name',
expiryMonth: 12,
expiryYear: 2019,
securityCode: '123'
}
self.controller.useMailingAddress = true
self.formController.$valid = true
self.controller.savePayment()

expect(cruPayments.creditCard.init).toHaveBeenCalledWith('production', '<device id>', '<manifest>')
})

it('should handle an error retrieving the manifest from TSYS', () => {
self.formController.$valid = true
self.controller.tsysService.getManifest.mockReturnValue(Observable.throw('some error'))
2 changes: 1 addition & 1 deletion src/common/services/api/cart.service.js
Original file line number Diff line number Diff line change
@@ -41,7 +41,7 @@ class Cart {
}

setCartCountCookie (quantity) {
if (!['give.cru.org', 'give-stage2.cru.org', 'give-stage2-next.cru.org', 'give-stage-cloud.cru.org', 'give-prod-cloud.cru.org'].includes(this.$location.host())) {
if (!['give.cru.org', 'give-stage2.cru.org', 'give-dev-cloud.cru.org'].includes(this.$location.host())) {
return
}

4 changes: 2 additions & 2 deletions src/common/services/api/designations.service.spec.js
Original file line number Diff line number Diff line change
@@ -246,7 +246,7 @@ describe('designation service', () => {
describe('ministriesList', () => {
it('should return a list of ministries', () => {
jest.spyOn(self.$location, 'protocol').mockImplementationOnce(() => 'https')
jest.spyOn(self.$location, 'host').mockImplementationOnce(() => 'give-stage-cloud.cru.org')
jest.spyOn(self.$location, 'host').mockImplementationOnce(() => 'give-stage2.cru.org')
const pagePath = 'page.html'
const ministriesResponse = {
ministries: [{
@@ -256,7 +256,7 @@ describe('designation service', () => {
extra: 'something-else'
}]
}
self.$httpBackend.expectGET(`https://give-stage-cloud.cru.org/${pagePath}/jcr:content/content-parsys/designation_search_r.json`)
self.$httpBackend.expectGET(`https://give-stage2.cru.org/${pagePath}/jcr:content/content-parsys/designation_search_r.json`)
.respond(200, ministriesResponse)

const expectedResult = {