Skip to content

Commit

Permalink
Merge branch 'dev' into USAGOV-1870
Browse files Browse the repository at this point in the history
  • Loading branch information
akf authored Nov 7, 2024
2 parents 6590d37 + 9fb8be8 commit 2df663a
Show file tree
Hide file tree
Showing 77 changed files with 2,390 additions and 826 deletions.
55 changes: 46 additions & 9 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -625,6 +625,23 @@ jobs:
- deploy-cloudgov-cron:
envname: prod

deploy-to-cloudgov-dr-cron-tools:
machine:
image: ubuntu-2204:current
environment:
BASH_ENV: /home/circleci/project/env.local
steps:
- deploy-cloudgov-cron:
envname: tools

deploy-to-cloudgov-dr-cron-shared-egress:
machine:
image: ubuntu-2204:current
environment:
BASH_ENV: /home/circleci/project/env.local
steps:
- deploy-cloudgov-cron:
envname: shared-egress

workflows:
version: 2
Expand Down Expand Up @@ -751,7 +768,6 @@ workflows:
- dev
- stage
- prod
- USAGOV-1557-cf-logs-to-new-relic
- build-and-push-container:
requires:
- approve-build-and-push-container
Expand All @@ -762,7 +778,6 @@ workflows:
- dev
- stage
- prod
- USAGOV-1557-cf-logs-to-new-relic
- approve-dev-deployment:
type: approval
requires:
Expand All @@ -779,23 +794,20 @@ workflows:
branches:
only:
- dr
- USAGOV-1557-cf-logs-to-new-relic
- deploy-to-cloudgov-dev:
requires:
- approve-dev-deployment
filters:
branches:
only:
- dev
- USAGOV-1943-govloan-redirect-corrections
- deploy-to-cloudgov-dr:
requires:
- approve-dr-deployment
filters:
branches:
only:
- dr
- USAGOV-1557-cf-logs-to-new-relic
- approve-stage-deployment:
type: approval
requires:
Expand Down Expand Up @@ -841,7 +853,7 @@ workflows:
- dev
- stage
- prod
- USAGOV-1753-generic-cron-app-alpine

- build-and-push-container-cron:
requires:
- approve-build-and-push-container-cron
Expand All @@ -852,7 +864,6 @@ workflows:
- dev
- stage
- prod
- USAGOV-1753-generic-cron-app-alpine
- approve-dev-deployment-cron:
type: approval
requires:
Expand All @@ -869,7 +880,6 @@ workflows:
branches:
only:
- dr
- USAGOV-1753-generic-cron-app-alpine
- deploy-to-cloudgov-dev-cron:
requires:
- approve-dev-deployment-cron
Expand All @@ -884,7 +894,6 @@ workflows:
branches:
only:
- dr
- USAGOV-1753-generic-cron-app-alpine
- approve-stage-deployment-cron:
type: approval
requires:
Expand Down Expand Up @@ -918,3 +927,31 @@ workflows:
filters:
branches:
only: prod

- really-approve-dr-deployment-cron-tools:
type: approval
requires:
- approve-dr-deployment-cron
filters:
branches:
only: dr
- deploy-to-cloudgov-dr-cron-tools:
requires:
- really-approve-dr-deployment-cron-tools
filters:
branches:
only: dr

- really-approve-dr-deployment-cron-shared-egress:
type: approval
requires:
- approve-dr-deployment-cron
filters:
branches:
only: dr
- deploy-to-cloudgov-dr-cron-shared-egress:
requires:
- really-approve-dr-deployment-cron-shared-egress
filters:
branches:
only: dr
63 changes: 51 additions & 12 deletions .docker/src-cron/opt/callcenter/call-center-update
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,63 @@ source ~/.profile $SPACE callwait &> /dev/null

waitTimeFile="waittime.json"

#echo "Getting access token."
tokenResponse=$(curl -s -X POST https://login.$CALL_CENTER_ENVIRONMENT/oauth/token -H "Content-Type: application/x-www-form-urlencoded" -d "grant_type=client_credentials&client_id=$CALL_CENTER_CLIENT_ID&client_secret=$CALL_CENTER_CLIENT_SECRET")
# echo "Getting access token."
tokenResponse=$(
curl -s -X POST https://login.$CALL_CENTER_ENVIRONMENT/oauth/token \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=client_credentials&client_id=$CALL_CENTER_CLIENT_ID&client_secret=$CALL_CENTER_CLIENT_SECRET"
)
token=$(echo "$tokenResponse" | jq -r '.access_token')

#echo "Getting en wait time."
enWaitTime=$(curl -s -X GET https://api.$CALL_CENTER_ENVIRONMENT/api/v2/routing/queues/$CALL_CENTER_EN_QUEUE_ID/estimatedwaittime -H "Authorization:Bearer $token" | jq -r '.results[].estimatedWaitTimeSeconds');
# echo "Getting en wait time."
enWaitTimeResponse=$(
curl -s -X GET https://api.$CALL_CENTER_ENVIRONMENT/api/v2/routing/queues/$CALL_CENTER_EN_QUEUE_ID/mediatypes/call/estimatedwaittime \
-H "Authorization:Bearer $token"
);
enWaitTime=$(echo "$enWaitTimeResponse" | jq -r '.results[].estimatedWaitTimeSeconds')

#echo "Getting sp wait time."
spWaitTime=$(curl -s -X GET https://api.$CALL_CENTER_ENVIRONMENT/api/v2/routing/queues/$CALL_CENTER_SP_QUEUE_ID/estimatedwaittime -H "Authorization:Bearer $token" | jq -r '.results[].estimatedWaitTimeSeconds');
# echo "Getting en chat wait time."
enChatWaitTimeResponse=$(
curl -s -X GET https://api.$CALL_CENTER_ENVIRONMENT/api/v2/routing/queues/$CALL_CENTER_EN_QUEUE_ID/mediatypes/chat/estimatedwaittime \
-H "Authorization:Bearer $token"
);
enChatWaitTime=$(echo "$enChatWaitTimeResponse" | jq -r '.results[].estimatedWaitTimeSeconds')

# echo "Getting sp wait time."
spWaitTimeResponse=$(
curl -s -X GET https://api.$CALL_CENTER_ENVIRONMENT/api/v2/routing/queues/$CALL_CENTER_SP_QUEUE_ID/mediatypes/call/estimatedwaittime \
-H "Authorization:Bearer $token"
);
spWaitTime=$(echo "$spWaitTimeResponse" | jq -r '.results[].estimatedWaitTimeSeconds')

# echo "Getting sp chat wait time."
spChatWaitTimeResponse=$(
curl -s -X GET https://api.$CALL_CENTER_ENVIRONMENT/api/v2/routing/queues/$CALL_CENTER_SP_QUEUE_ID/mediatypes/chat/estimatedwaittime \
-H "Authorization:Bearer $token"
);
spChatWaitTime=$(echo "$spChatWaitTimeResponse" | jq -r '.results[].estimatedWaitTimeSeconds')

timestamp=$(date +%s)
combinedWaitTimes='{ "enEstimatedWaitTimeSeconds": '$enWaitTime',
"spEstimatedWaitTimeSeconds": '$spWaitTime',
"timestamp": '$timestamp'}'
combinedWaitTimes='{
"call": {
"estimatedWaitTimeSeconds": {
"en": '$enWaitTime',
"sp": '$spWaitTime'
}
},
"chat": {
"estimatedWaitTimeSeconds": {
"en": '$enChatWaitTime',
"sp": '$spChatWaitTime'
}
},
"timestamp": '$timestamp'
}'

#echo "Setting wait time file."
# echo "Setting wait time file."
# echo "$combinedWaitTimes" >&2
echo "$combinedWaitTimes" > $waitTimeFile

# # Upload file to S3 bucket
#echo "uploading waittime.json to S3."
# Upload file to S3 bucket
# echo "uploading waittime.json to S3."
aws_cp waittime.json s3://$S3_BUCKET/$VERSION/waittime.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
const paths = ["/site-issue-report-form", "/es/reporte-problemas-en-este-sitio-web"];

paths.forEach(path => {
let lang;
let thank_you;
let recordType;

if (path === "/site-issue-report-form") {
lang = "English";
thank_you = "https://www.usa.gov/thank-you-issue-report"
recordType = "012U00000001eYv";
} else {
lang = "Español";
thank_you = "https://www.usa.gov/es/gracias-por-reportar-problemas-en-este-sitio-web";
recordType = "012U00000001eYr";
}

describe(`Report a Problem ${lang}`, () => {
beforeEach(() => {
cy.visit(path)
})
it('Test Salesforce hidden fields are present and valid', () => {
cy.get('input[name="orgid"]')
.should('have.value', '00DU0000000Leux')
cy.get('input[name="retURL"]')
.should('have.value', thank_you)
cy.get('input[name="recordType"]')
.should('have.value', recordType)
cy.get('input[name="Sender_IP__c"]')
.should('have.value', '192.168.1.1')
cy.get('input[name="Site_Version__c"]')
.should('have.value', 'New')
cy.get('input[name="Call_Topic__c"]')
.should('have.value', 'About USAGov')
cy.get('input[name="Case_Topic_Other__c"]')
.should('have.value', 'From USAGov Issue Form')
cy.get('input[name="Gender__c"]')
.should('have.value', 'Unknown')
cy.get('input[name="external"]')
.should('have.value', '1')
})
})

})
22 changes: 22 additions & 0 deletions bin/cloudgov/gsaauth-filegen.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env bash

SPACE=$(cf target | grep space: | awk '{print $2}');
if [ -z "$SPACE" ]; then
echo "You must choose a space before procesing ./bin/cloudgov/space (personal|dev|stage|prod|shared-egress)"
exit 1
fi;

SECAUTHSECRETS=$(cf curl /v2/user_provided_service_instances/$(cf service secauthsecrets --guid) | jq -r '.entity | select(.name == "secauthsecrets") | .credentials' )
SP_KEY=$(echo -E "$SECAUTHSECRETS" | jq -r '.spkey')
SP_CRT=$(echo -E "$SECAUTHSECRETS" | jq -r '.spcrt')

BASENAME=gsaauth.cms-${SPACE}.usa.gov

echo "$SP_KEY" > prvkey
chmod go-rwx prvkey
ssh-keygen -y -f prvkey > ${BASENAME}.pub
rm prvkey

echo "$SP_CRT" > ${BASENAME}.crt

ls -l ${BASENAME}*
2 changes: 1 addition & 1 deletion bin/src/newrelic.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# TODO: why the [ $(uname -m) != 'aarch64' ] clause? Was this meant to exclude local install?
if [ "$(uname -m)" != 'aarch64' ]; then
export NR_VERSION_NUMBER='10.22.0.12'
export NR_VERSION_NUMBER='11.2.0.15'

NR_VERSION="newrelic-php5-$NR_VERSION_NUMBER-linux-musl"
export NR_VERSION
Expand Down
7 changes: 6 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
"drupal/samlauth": "^3.9",
"drupal/simple_sitemap": "^4.1",
"drupal/simplify_menu": "^3.1",
"drupal/sortableviews": "^1.3",
"drupal/tome": "^1.6",
"drupal/twig_tweak": "^3.1",
"drupal/uswds_base": "^2.4",
Expand Down Expand Up @@ -137,7 +138,8 @@
"drupal/tome": {
"CSS on Amazon S3 via Flysystem not processing properly": "https://www.drupal.org/files/issues/2020-08-06/3161384-4.patch",
"De-duplicate invoke paths in StaticCommand's exportPaths": "./patches/drupal/deduplicateTomeInvokePaths.patch",
"Make tome work with drush 12": "https://www.drupal.org/files/issues/2023-08-02/tome_drush12-support.patch"
"Make tome work with drush 12": "https://www.drupal.org/files/issues/2023-08-02/tome_drush12-support.patch",
"Make tome work with path count > 1 without re-exporting pages multiple times" : "./patches/drupal/tomePathCountFixes.patch"
},
"drupal/core": {
"Enable MenuActiveTrail to find the original menu item created by node_menus": "./patches/drupal/correctActiveTrail_d10.patch",
Expand All @@ -150,6 +152,9 @@
},
"drupal/views_menu_children_filter": {
"Use the technique from correctActiveTrail.patch to return the original menu item": "./patches/drupal/correctMenuChildren_d10.patch"
},
"drupal/menu_breadcrumb": {
"Add url.path to cache context for menu breadcrumb": "https://www.drupal.org/files/issues/2024-09-11/menu_breadcrumb-3230481-fix-cache-context-mr22.patch"
}
},
"drupal-lenient": {
Expand Down
50 changes: 49 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion config/sync/block.block.englishbannercode.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ dependencies:
id: englishbannercode
theme: usagov
region: header_top
weight: -16
weight: -18
provider: null
plugin: 'block_content:d61595f0-7e1c-4081-9eef-cdc5ebbf822b'
settings:
Expand Down
2 changes: 1 addition & 1 deletion config/sync/block.block.languageswitcher.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ dependencies:
id: languageswitcher
theme: usagov
region: header_top
weight: -12
weight: -9
provider: null
plugin: 'language_block:language_interface'
settings:
Expand Down
Loading

0 comments on commit 2df663a

Please sign in to comment.