Skip to content

Commit

Permalink
Merge branch 'main' into B-22561-Add-Col-Filtering-Office-Users-MAIN
Browse files Browse the repository at this point in the history
  • Loading branch information
KonstanceH committed Mar 7, 2025
2 parents 1a8c561 + dca9ab2 commit 08822de
Show file tree
Hide file tree
Showing 125 changed files with 5,393 additions and 2,238 deletions.
107 changes: 84 additions & 23 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ variables:
RUNNER_TAG: &runner_tag milmove
DOCKER_RUNNER_TAG: &docker_runner_tag eks_cluster_runner

postgres: &postgres postgres:16.4
postgres: &postgres harbor.csde.caci.com/docker.io/postgres:16.4
#postgres: &postgres postgres:16.4
redis: &redis redis:5.0.6
redis: &redis harbor.csde.caci.com/docker.io/redis:5.0.6

stages:
- pre_checks
Expand Down Expand Up @@ -86,6 +86,10 @@ stages:
.setup_aws_vars_dp3: &setup_aws_vars_dp3
- export SERVICE_RESERVATION_CPU=2048
- export SERVICE_RESERVATION_MEM=4096
- unset AWS_ACCESS_KEY_ID
- unset AWS_SECRET_ACCESS_KEY
- unset AWS_ACCOUNT_ID
- unset AWS_DEFAULT_REGION
- |
if [[ "$DP3_ENV" == "exp" || "$DP3_ENV" == "loadtest" || "$DP3_ENV" == "demo" ]]; then
export ENV=$(echo ${DP3_ENV} | tr '[:lower:]' '[:upper:]');
Expand All @@ -108,12 +112,21 @@ stages:
fi
.setup_aws_vars_com_dev: &setup_aws_vars_com_dev
- export AWS_DEFAULT_REGION=$COM_REGION
- unset AWS_ACCESS_KEY_ID
- unset AWS_SECRET_ACCESS_KEY
- unset AWS_ACCOUNT_ID
- unset AWS_DEFAULT_REGION
- unset AWS_REGION
- export AWS_REGION=$COM_REGION
- export AWS_ACCOUNT_ID=$DEV_ACCOUNT_ID
- export AWS_ACCESS_KEY_ID=$DEV_ACCESS_KEY_ID
- export AWS_SECRET_ACCESS_KEY=$DEV_SECRET_KEY

.setup_aws_vars_stg: &setup_aws_vars_stg
- unset AWS_ACCESS_KEY_ID
- unset AWS_SECRET_ACCESS_KEY
- unset AWS_ACCOUNT_ID
- unset AWS_DEFAULT_REGION
- export AWS_DEFAULT_REGION=$STG_REGION
- export AWS_ACCOUNT_ID=$STG_ACCOUNT_ID
- export AWS_ACCESS_KEY_ID=$STG_ACCESS_KEY_ID
Expand All @@ -127,6 +140,10 @@ stages:
- export TLS_CA=$STG_MOVE_MIL_DOD_TLS_CA

.setup_aws_vars_prd: &setup_aws_vars_prd
- unset AWS_ACCESS_KEY_ID
- unset AWS_SECRET_ACCESS_KEY
- unset AWS_ACCOUNT_ID
- unset AWS_DEFAULT_REGION
- export AWS_DEFAULT_REGION=$PRD_REGION
- export AWS_ACCOUNT_ID=$PRD_ACCOUNT_ID
- export AWS_ACCESS_KEY_ID=$PRD_ACCESS_KEY_ID
Expand Down Expand Up @@ -405,7 +422,7 @@ golang_lint:
interruptible: true
tags:
- $DOCKER_RUNNER_TAG
image: golangci/golangci-lint:latest # Refer to https://hub.docker.com/r/golangci/golangci-lint
image: harbor.csde.caci.com/docker.io/golangci/golangci-lint:latest # Refer to https://hub.docker.com/r/golangci/golangci-lint
script:
- golangci-lint run --print-issued-lines=false --timeout=25m --out-format code-climate:gl-code-quality-report.json,line-number
artifacts:
Expand Down Expand Up @@ -750,7 +767,6 @@ pre_test:
- yarn danger ci --failOnErrors
- echo "Run spectral linter on all files"
- ./scripts/ensure-spectral-lint /tmp/spectral_baseline spectral
allow_failure: true
after_script:
- *announce_failure
artifacts:
Expand All @@ -761,8 +777,12 @@ pre_test:
- tmp/spectral_baseline/*.json #what do we need to store for review?
- spectral/*.json #what do we need to store for review?
when: always
# rules:
# - *check_server_ignore_branch
rules:
- if: '$PRE_TEST_ALLOW_FAILURE == "true"'
allow_failure: true
- if: '$PRE_TEST_ALLOW_FAILURE == "false"'
allow_failure: false
# - *check_server_ignore_branch all branches for now

server_test:
stage: test
Expand Down Expand Up @@ -834,8 +854,7 @@ server_test:
- make bin/swagger
- echo "server test -- build gotestsum and run scripts for report"
- make -j 2 bin/milmove bin/gotestsum
- make server_test for app
allow_failure: true #leaving true until 5 tests failing tests are working
- make server_test
artifacts:
paths:
- /builds/milmove/mymove/bin/gotestsum
Expand All @@ -845,9 +864,12 @@ server_test:
junit: /builds/milmove/mymove/tmp/test-results/gotest/app/go-test-report.xml
after_script:
- *announce_failure
# we want to make this run on every branch bc webhooks don't exist currently
# rules:
# - *check_server_ignore_branch
rules:
- if: '$SERVER_TEST_ALLOW_FAILURE == "true"'
allow_failure: true
- if: '$SERVER_TEST_ALLOW_FAILURE == "false"'
allow_failure: false
# - *check_server_ignore_branch # we want to make this run on every branch bc webhooks don't exist currently

server_test_coverage:
stage: test
Expand All @@ -867,10 +889,13 @@ server_test_coverage:
./scripts/ensure-go-test-coverage \
tmp/baseline-go-coverage/go-coverage.txt \
tmp/test-results/gotest/app/go-coverage.txt
allow_failure: true
after_script:
- *announce_failure
rules:
- if: '$SERVER_TEST_ALLOW_FAILURE == "true"'
allow_failure: true
- if: '$SERVER_TEST_ALLOW_FAILURE == "false"'
allow_failure: true #allow failure for now
- *check_server_ignore_branch
###may need to rethink the logic and intent of this they save per the following and do some PR interaction
# only save the cache on default branch builds because we only want to
Expand Down Expand Up @@ -914,9 +939,12 @@ client_test:
- /builds/milmove/mymove/jest-junit-reports
after_script:
- *announce_failure
# we want to make this run on every branch bc webhooks don't exist currently
# rules:
# - *check_client_ignore_branch
rules:
- if: '$CLIENT_TEST_ALLOW_FAILURE == "true"'
allow_failure: true
- if: '$CLIENT_TEST_ALLOW_FAILURE == "false"'
allow_failure: false
# - *check_client_ignore_branch # we want to make this run on every branch bc webhooks don't exist currently

client_test_coverage:
stage: test
Expand All @@ -940,6 +968,10 @@ client_test_coverage:
after_script:
- *announce_failure
rules:
- if: '$CLIENT_TEST_ALLOW_FAILURE == "true"'
allow_failure: true
- if: '$CLIENT_TEST_ALLOW_FAILURE == "false"'
allow_failure: true #allow failure for now
- *check_client_ignore_branch

integration_test_devseed:
Expand Down Expand Up @@ -995,10 +1027,13 @@ integration_test_devseed:
export MOVE_MIL_DOD_TLS_CERT=$(cat config/tls/devlocal-https.pem)
export MOVE_MIL_DOD_TLS_KEY=$(cat config/tls/devlocal-https.key)
- make db_dev_fresh
allow_failure: true
after_script:
- *announce_failure
rules:
- if: '$INTEGRATION_TEST_ALLOW_FAILURE == "true"'
allow_failure: true
- if: '$INTEGRATION_TEST_ALLOW_FAILURE == "false"'
allow_failure: false
- *check_integration_ignore_branch

integration_tests:
Expand All @@ -1020,10 +1055,13 @@ integration_tests:
script:
- echo "TODO Add steps"
- echo "integration_tests"
allow_failure: true
after_script:
- *announce_failure
rules:
- if: '$INTEGRATION_TEST_ALLOW_FAILURE == "true"'
allow_failure: true
- if: '$INTEGRATION_TEST_ALLOW_FAILURE == "false"'
allow_failure: true # allow failure for now
- *check_integration_ignore_branch

integration_test_mtls:
Expand Down Expand Up @@ -1082,10 +1120,13 @@ integration_test_mtls:
paths:
- test-results/
when: always
allow_failure: true
after_script:
- *announce_failure
rules:
- if: '$INTEGRATION_TEST_ALLOW_FAILURE == "true"'
allow_failure: true
- if: '$INTEGRATION_TEST_ALLOW_FAILURE == "false"'
allow_failure: true # allow failure for now
- *check_integration_mtls_ignore_branch

integration_test_admin:
Expand Down Expand Up @@ -1149,10 +1190,13 @@ integration_test_admin:
- complete-playwright-report.zip
- playwright-results.xml
when: always
allow_failure: true
after_script:
- *announce_failure
rules:
- if: '$INTEGRATION_TEST_ALLOW_FAILURE == "true"'
allow_failure: true
- if: '$INTEGRATION_TEST_ALLOW_FAILURE == "false"'
allow_failure: true # allow failure for now
- *check_integration_ignore_branch

integration_test_my:
Expand Down Expand Up @@ -1217,10 +1261,13 @@ integration_test_my:
- complete-playwright-report.zip
- playwright-results.xml
when: always
allow_failure: true
after_script:
- *announce_failure
rules:
- if: '$INTEGRATION_TEST_ALLOW_FAILURE == "true"'
allow_failure: true
- if: '$INTEGRATION_TEST_ALLOW_FAILURE == "false"'
allow_failure: true # allow failure for now
- *check_integration_ignore_branch

integration_test_office:
Expand Down Expand Up @@ -1283,10 +1330,13 @@ integration_test_office:
- complete-playwright-report.zip
- playwright-results.xml
when: always
allow_failure: true
after_script:
- *announce_failure
rules:
- if: '$INTEGRATION_TEST_ALLOW_FAILURE == "true"'
allow_failure: true
- if: '$INTEGRATION_TEST_ALLOW_FAILURE == "false"'
allow_failure: true # allow failure for now
- *check_integration_ignore_branch


Expand Down Expand Up @@ -1560,7 +1610,6 @@ deploy_app_dp3:
########################################################
## STG push and deploy stages all off of main only ##
########################################################

build_push_app_stg:
stage: push
interruptible: true
Expand All @@ -1573,6 +1622,10 @@ build_push_app_stg:
needs:
- compile_app_client
- compile_app_server
- client_test_coverage
- server_test_coverage
- pre_test
- integration_tests
before_script:
- *setup_aws_vars_stg
- *setup_release_stg
Expand All @@ -1597,6 +1650,10 @@ build_push_migrations_stg:
needs:
- compile_app_server
- compile_app_client
- client_test_coverage
- server_test_coverage
- pre_test
- integration_tests
before_script:
- *setup_aws_vars_stg
- *setup_release_stg
Expand All @@ -1621,6 +1678,10 @@ build_push_tasks_stg:
needs:
- compile_app_server
- compile_app_client
- client_test_coverage
- server_test_coverage
- pre_test
- integration_tests
before_script:
- *setup_aws_vars_stg
- *setup_release_stg
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
--B-21966 Konstance Haffaney Add column to office_users

ALTER TABLE public.office_users
ADD COLUMN IF NOT EXISTS rejected_on timestamptz;

COMMENT on COLUMN office_users.rejected_on IS 'Date requested office users were rejected.';
1 change: 1 addition & 0 deletions migrations/app/ddl_tables_manifest.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# This is the tables migrations manifest.
# If a migration is not recorded here, then it will error.
# Naming convention: tbl_some_table.up.sql running <generate-ddl-migration some_table tables> will create this file.
20250221195633_tbl_alter_office_users_B-21966.up.sql
20250221195354_tbl_alter_entitlements_B-22651.up.sql
20250224162949_B-22706_tbl_update_moves.up.sql
20250224200700_tbl_ppm_shipments.up.sql
Expand Down
1 change: 1 addition & 0 deletions migrations/app/dml_migrations_manifest.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# This is the migrations manifest.
# If a migration is not recorded here, then it will error.
# Naming convention: 202502201325_B-123456_update_some_table.up.sql running <milmove gen migration -n B-123456_update_some_table> will create this file.
20250227160358_B-21966_add_data_to_office_users.up.sql
20250227211521_update_re_countries.up.sql
20250227211534_update_re_country_prn_divisions.up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
-- Adds rejectedOn date to pre-existing rejected office users.
UPDATE office_users
SET rejected_on = updated_at
WHERE
status ='REJECTED'::public."office_user_status" AND rejected_on is null;
13 changes: 11 additions & 2 deletions pkg/assets/notifications/templates/move_counseled_template.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,17 @@

<p>This is a confirmation that your counselor has approved move details for the assigned move code{{if .Locator}} {{.Locator}}{{end}}{{if .OriginDutyLocation}} from {{.OriginDutyLocation}}{{end}}{{if .DestinationLocation}} to {{.DestinationLocation}}{{end}} in the MilMove system.</p>

{{if .WeightRestriction}}
<p>Your move has been identified as going to an administratively restricted HHG weight location. Your weight restriction is {{.WeightRestriction}}lbs.</p>
{{if and .UbWeightRestriction .WeightRestriction}}
<p>Your move has been identified as going to an administratively restricted weight location. Your HHG weight restriction
is {{.WeightRestriction}} lbs and UB weight restriction is {{.UbWeightRestriction}} lbs.</p>
<p>Be advised, you may be required to pay excess cost if you choose to move more than your weight restriction. </p>
{{else if .WeightRestriction}}
<p>Your move has been identified as going to an administratively restricted HHG weight location. Your weight restriction
is {{.WeightRestriction}} lbs.</p>
<p>Be advised, you may be required to pay excess cost if you choose to move more than your weight restriction. </p>
{{else if .UbWeightRestriction}}
<p>Your move has been identified as going to an administratively restricted UB weight location. Your weight restriction
is {{.UbWeightRestriction}} lbs.</p>
<p>Be advised, you may be required to pay excess cost if you choose to move more than your weight restriction. </p>
{{end}}
<p>What this means to you:</br>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
*** DO NOT REPLY directly to this email ***

This is a confirmation that your counselor has approved move details for the assigned move code {{.Locator}}{{if .OriginDutyLocation}} from {{.OriginDutyLocation}}{{end}}{{if .DestinationLocation}} to {{.DestinationLocation}}{{end}} in the MilMove system.
{{if .WeightRestriction}}
<p>Your move has been identified as going to an administratively restricted HHG weight location. Your weight restriction is {{.WeightRestriction}}lbs. Be advised, you may be required to pay excess cost if you choose to move more than your weight restriction. </p>
{{if and .UbWeightRestriction .WeightRestriction}}
<p>Your move has been identified as going to an administratively restricted weight location. Your HHG weight restriction is {{.WeightRestriction}} lbs and UB weight restriction is {{.UbWeightRestriction}} lbs. Be advised, you may be required to pay excess cost if you choose to move more than your weight restriction. </p>
{{else if .WeightRestriction}}
<p>Your move has been identified as going to an administratively restricted HHG weight location. Your weight restriction is {{.WeightRestriction}} lbs. Be advised, you may be required to pay excess cost if you choose to move more than your weight restriction. </p>
{{else if .UbWeightRestriction}}
<p>Your move has been identified as going to an administratively restricted UB weight location. Your weight restriction is {{.UbWeightRestriction}} lbs. Be advised, you may be required to pay excess cost if you choose to move more than your weight restriction. </p>
{{end}}
What this means to you:
If you are doing a Personally Procured Move (PPM), you can start moving your personal property.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<strong>Your standard weight allowance: {{.WeightAllowance}} pounds.</strong>
That is how much combined weight the government will pay for all movements between authorized locations under your
orders.</p>
<p>Be advised, if you are moving to an administratively restricted HHG weight location this amount could be less.</p>
<p>Be advised, if you are moving to an administratively restricted weight location this amount could be less.</p>


<p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ We have assigned you a move code: {{.Locator}}. You can use this code when talki

{{ if .OriginDutyLocationPhoneLine -}} To change any information about your move, or to add or cancel shipments, you should contact {{.OriginDutyLocationPhoneLine}} or visit your local transportation office ({{.OneSourceTransportationOfficeLink}}) . {{- end }} {{- if not .OriginDutyLocationPhoneLine }} To change any information about your move, or to add or cancel shipments, you should contact your nearest transportation office. You can find the contact information using the directory of PCS-related contacts ({{.OneSourceTransportationOfficeLink}}) . {{- end }}

Your standard weight allowance: {{.WeightAllowance}} pounds. That is how much combined weight the government will pay for all movements between authorized locations under your orders. Be advised, if you are moving to an administratively restricted HHG weight location this amount could be less.
Your standard weight allowance: {{.WeightAllowance}} pounds. That is how much combined weight the government will pay for all movements between authorized locations under your orders. Be advised, if you are moving to an administratively restricted weight location this amount could be less.

If you move more than {{.WeightAllowance}} pounds or ship to/from an other than authorized location, you may owe the government the difference in cost between what you are authorized and what you decide to move.

Expand Down
15 changes: 15 additions & 0 deletions pkg/factory/office_user_factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package factory
import (
"fmt"
"strings"
"time"

"github.com/gobuffalo/pop/v6"
"github.com/gofrs/uuid"
Expand Down Expand Up @@ -340,3 +341,17 @@ func GetTraitRequestedOfficeUser() []Customization {
},
}
}

// GetTraitRejectedOfficeUser sets the OfficeUser in an REJECTED status
func GetTraitRejectedOfficeUser() []Customization {
rejectedStatus := models.OfficeUserStatusREJECTED
rejectedOn := time.Now()
return []Customization{
{
Model: models.OfficeUser{
Status: &rejectedStatus,
RejectedOn: &rejectedOn,
},
},
}
}
Loading

0 comments on commit 08822de

Please sign in to comment.