From 2261ddba89caa5d347ec9a8a02c28238968e66fb Mon Sep 17 00:00:00 2001 From: Smulligan Date: Fri, 6 Sep 2024 14:43:57 -0400 Subject: [PATCH 1/4] adds environment changes needed to run integrations locally now that migration to kubernetes is complete --- .gitignore | 1 + config/activity_insight.yml | 17 +++++++++++++++++ config/integration_passcode.yml | 2 ++ docker-compose.yml | 13 ++++++++++++- 4 files changed, 32 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index e04ef33..4629991 100644 --- a/.gitignore +++ b/.gitignore @@ -42,3 +42,4 @@ spec/examples.txt .env .cache .bash_history +.envrc diff --git a/config/activity_insight.yml b/config/activity_insight.yml index de242ad..bfc5829 100644 --- a/config/activity_insight.yml +++ b/config/activity_insight.yml @@ -1,4 +1,21 @@ production: + main: + :username: "<%= ENV.fetch('FAMS_MAIN_USERNAME') %>" + :password: "<%= ENV.fetch('FAMS_MAIN_PASSWORD') %>" + webservices: + :username: "<%= ENV.fetch('FAMS_WEBSERVICES_USERNAME') %>" + :password: "<%= ENV.fetch('FAMS_WEBSERVICES_PASSWORD') %>" + backups_service: + :username: "<%= ENV.fetch('FAMS_BACKUPS_SERVICE_USERNAME') %>" + :password: "<%= ENV.fetch('FAMS_BACKUPS_SERVICE_PASSWORD') %>" + metadata_db: + :key: "<%= ENV.fetch('FAMS_METADATA_DB_KEY') %>" + s3_bucket: + api_key: "<%= ENV.fetch('FAMS_S3_BUCKET_API_KEY') %>" + lp_sftp: + username: "<%= ENV.fetch('FAMS_LP_SFTP_USERNAME') %>" + host: "<%= ENV.fetch('FAMS_LP_SFTP_HOST') %>" +development: main: :username: "<%= ENV.fetch('FAMS_MAIN_USERNAME') %>" :password: "<%= ENV.fetch('FAMS_MAIN_PASSWORD') %>" diff --git a/config/integration_passcode.yml b/config/integration_passcode.yml index 988a937..ddcae7e 100644 --- a/config/integration_passcode.yml +++ b/config/integration_passcode.yml @@ -1,2 +1,4 @@ production: + :passcode: "<%= ENV.fetch('FAMS_PASSCODE') %>" +development: :passcode: "<%= ENV.fetch('FAMS_PASSCODE') %>" \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index fb18e18..5bef73f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -12,7 +12,18 @@ services: environment: # RAILS_ENV: production # The startup script defaults to development, change to production if need be MYSQL_HOST: db - MYSQL_PASSWORD: ai_integration + MYSQL_PASSWORD: ai_integration + FAMS_PASSCODE: aisupport + FAMS_MAIN_USERNAME: ${FAMS_MAIN_USERNAME} + FAMS_MAIN_PASSWORD: ${FAMS_MAIN_PASSWORD} + FAMS_WEBSERVICES_USERNAME: ${FAMS_WEBSERVICES_USERNAME} + FAMS_WEBSERVICES_PASSWORD: ${FAMS_WEBSERVICES_PASSWORD} + FAMS_BACKUPS_SERVICE_USERNAME: ${FAMS_BACKUPS_SERVICE_USERNAME} + FAMS_BACKUPS_SERVICE_PASSWORD: ${FAMS_BACKUPS_SERVICE_PASSWORD} + FAMS_METADATA_DB_KEY: ${FAMS_METADATA_DB_KEY} + FAMS_S3_BUCKET_API_KEY: ${FAMS_S3_BUCKET_API_KEY} + FAMS_LP_SFTP_USERNAME: ${FAMS_LP_SFTP_USERNAME} + FAMS_LP_SFTP_HOST: ${FAMS_LP_SFTP_HOST} build: args: UID: "${UID:-1001}" From 516db70dc9dc6be0928f5ae65c9263b576ce8ca4 Mon Sep 17 00:00:00 2001 From: Smulligan Date: Fri, 6 Sep 2024 15:07:58 -0400 Subject: [PATCH 2/4] add config for test environment as well --- config/activity_insight.yml | 17 +++++++++++++++++ config/integration_passcode.yml | 2 ++ 2 files changed, 19 insertions(+) diff --git a/config/activity_insight.yml b/config/activity_insight.yml index bfc5829..766ba82 100644 --- a/config/activity_insight.yml +++ b/config/activity_insight.yml @@ -16,6 +16,23 @@ production: username: "<%= ENV.fetch('FAMS_LP_SFTP_USERNAME') %>" host: "<%= ENV.fetch('FAMS_LP_SFTP_HOST') %>" development: + main: + :username: "<%= ENV.fetch('FAMS_MAIN_USERNAME') %>" + :password: "<%= ENV.fetch('FAMS_MAIN_PASSWORD') %>" + webservices: + :username: "<%= ENV.fetch('FAMS_WEBSERVICES_USERNAME') %>" + :password: "<%= ENV.fetch('FAMS_WEBSERVICES_PASSWORD') %>" + backups_service: + :username: "<%= ENV.fetch('FAMS_BACKUPS_SERVICE_USERNAME') %>" + :password: "<%= ENV.fetch('FAMS_BACKUPS_SERVICE_PASSWORD') %>" + metadata_db: + :key: "<%= ENV.fetch('FAMS_METADATA_DB_KEY') %>" + s3_bucket: + api_key: "<%= ENV.fetch('FAMS_S3_BUCKET_API_KEY') %>" + lp_sftp: + username: "<%= ENV.fetch('FAMS_LP_SFTP_USERNAME') %>" + host: "<%= ENV.fetch('FAMS_LP_SFTP_HOST') %>" +test: main: :username: "<%= ENV.fetch('FAMS_MAIN_USERNAME') %>" :password: "<%= ENV.fetch('FAMS_MAIN_PASSWORD') %>" diff --git a/config/integration_passcode.yml b/config/integration_passcode.yml index ddcae7e..d12fa9d 100644 --- a/config/integration_passcode.yml +++ b/config/integration_passcode.yml @@ -1,4 +1,6 @@ production: :passcode: "<%= ENV.fetch('FAMS_PASSCODE') %>" development: + :passcode: "<%= ENV.fetch('FAMS_PASSCODE') %>" +test: :passcode: "<%= ENV.fetch('FAMS_PASSCODE') %>" \ No newline at end of file From 064411cebe72753a1512dc743eb981962d83aec1 Mon Sep 17 00:00:00 2001 From: Smulligan Date: Fri, 6 Sep 2024 15:10:25 -0400 Subject: [PATCH 3/4] remove faculty college conditional on status. originally added before all colleges were onboarded and would throw an error if not yet onboarded. no longer needed now that all colleges are onboarded and causing status not to be added when it should be --- app/importers/osp_data/osp_xml_builder.rb | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/app/importers/osp_data/osp_xml_builder.rb b/app/importers/osp_data/osp_xml_builder.rb index 9410586..d37c56a 100644 --- a/app/importers/osp_data/osp_xml_builder.rb +++ b/app/importers/osp_data/osp_xml_builder.rb @@ -124,7 +124,7 @@ def build_xml(batch) end end xml.AMOUNT_REQUEST_ contract.requested, access: 'READ_ONLY' - if college_list.include?(faculty.college) && contract.status + if contract.status xml.STATUS_ contract.status, access: 'READ_ONLY' end if contract.start_date @@ -169,9 +169,4 @@ def build_xml(batch) end builder.to_xml end - - def college_list - %w[AG ED CA LA BK SC AA UL BA BC CM LW EM GV HH IST MD NR UC - AB AL UE EN] - end end From 5d1408450857aeafec0feed4ff04c8d62098b2ee Mon Sep 17 00:00:00 2001 From: Smulligan Date: Mon, 9 Sep 2024 09:15:15 -0400 Subject: [PATCH 4/4] switch test config to fake values --- config/activity_insight.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/config/activity_insight.yml b/config/activity_insight.yml index 766ba82..3007654 100644 --- a/config/activity_insight.yml +++ b/config/activity_insight.yml @@ -34,18 +34,18 @@ development: host: "<%= ENV.fetch('FAMS_LP_SFTP_HOST') %>" test: main: - :username: "<%= ENV.fetch('FAMS_MAIN_USERNAME') %>" - :password: "<%= ENV.fetch('FAMS_MAIN_PASSWORD') %>" + :username: fake + :password: fake webservices: - :username: "<%= ENV.fetch('FAMS_WEBSERVICES_USERNAME') %>" - :password: "<%= ENV.fetch('FAMS_WEBSERVICES_PASSWORD') %>" + :username: fake + :password: fake backups_service: - :username: "<%= ENV.fetch('FAMS_BACKUPS_SERVICE_USERNAME') %>" - :password: "<%= ENV.fetch('FAMS_BACKUPS_SERVICE_PASSWORD') %>" + :username: fake + :password: fake metadata_db: - :key: "<%= ENV.fetch('FAMS_METADATA_DB_KEY') %>" + :key: fake s3_bucket: - api_key: "<%= ENV.fetch('FAMS_S3_BUCKET_API_KEY') %>" + api_key: fake lp_sftp: - username: "<%= ENV.fetch('FAMS_LP_SFTP_USERNAME') %>" - host: "<%= ENV.fetch('FAMS_LP_SFTP_HOST') %>" \ No newline at end of file + username: fake + host: fake \ No newline at end of file