Skip to content

Commit

Permalink
Remove extra environments
Browse files Browse the repository at this point in the history
  • Loading branch information
wrandall22 committed Oct 30, 2023
1 parent cc06e74 commit 6de8620
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 147 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion src/app/analytics/analytics.factory.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
49 changes: 0 additions & 49 deletions src/common/app.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,6 @@ 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',
Expand All @@ -33,16 +27,6 @@ const appConfig = /* @ngInject */ function (envServiceProvider, $compileProvider
'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: {
Expand All @@ -62,22 +46,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',
Expand All @@ -86,23 +54,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',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'))
Expand Down
2 changes: 1 addition & 1 deletion src/common/services/api/cart.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
4 changes: 2 additions & 2 deletions src/common/services/api/designations.service.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: [{
Expand All @@ -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 = {
Expand Down

0 comments on commit 6de8620

Please sign in to comment.