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

Remove references to "_aks" environment names #4693

Merged
merged 3 commits into from
Nov 21, 2024
Merged
Show file tree
Hide file tree
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
14 changes: 7 additions & 7 deletions .github/actions/smoke-test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,22 +32,22 @@ runs:
run: |
if [ ! -z "${{ inputs.pr-number }}" ]; then
PR_NUMBER=${{ inputs.pr-number }}
echo "base_url: https://publish-review-$PR_NUMBER.test.teacherservices.cloud" >> config/settings/review_aks.yml
echo "publish_api_url: https://publish-review-$PR_NUMBER.test.teacherservices.cloud" >> config/settings/review_aks.yml
echo "base_url: https://publish-review-$PR_NUMBER.test.teacherservices.cloud" >> config/settings/review.yml
echo "publish_api_url: https://publish-review-$PR_NUMBER.test.teacherservices.cloud" >> config/settings/review.yml
fi;

- name: Smoke Tests ${{ inputs.environment }}
shell: bash
run: RAILS_ENV=${{ inputs.environment }}_aks ./bin/bundle exec rspec spec/smoke --format documentation
run: RAILS_ENV=${{ inputs.environment }} ./bin/bundle exec rspec spec/smoke --format documentation

- name: 'Notify #twd_findpub_tech on failure'
- name: "Notify #twd_findpub_tech on failure"
if: ${{ failure() && inputs.environment != 'review' }}
uses: rtCamp/action-slack-notify@master
env:
SLACK_CHANNEL: twd_findpub_tech
SLACK_COLOR: '#ef5343'
SLACK_ICON_EMOJI: ':github-logo:'
SLACK_COLOR: "#ef5343"
SLACK_ICON_EMOJI: ":github-logo:"
SLACK_USERNAME: Publish Teacher Training
SLACK_TITLE: Smoke tests failure
SLACK_MESSAGE: ':alert: <!channel> Smoke tests failure on ${{ inputs.environment }} :sadparrot:'
SLACK_MESSAGE: ":alert: <!channel> Smoke tests failure on ${{ inputs.environment }} :sadparrot:"
SLACK_WEBHOOK: ${{ inputs.slack-webhook }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Find & Publish Teacher Training

[![View performance data on Skylight](https://badges.skylight.io/status/OSMheTARjT6C.svg)](https://oss.skylight.io/app/applications/OSMheTARjT6C)
[![View performance data on Skylight](https://badges.skylight.io/status/NXAwzyZjkp2m.svg)](https://oss.skylight.io/app/applications/NXAwzyZjkp2m)

This repo is home to three services:

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/find/feature_flags_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def index; end
def update
FeatureFlag.send(action, feature_name)

if Rails.env.production_aks?
if Rails.env.production?
SlackNotificationJob.perform_now(
":flags: Feature ‘#{feature_name}‘ was #{action}d",
find_feature_flags_path
Expand Down
2 changes: 1 addition & 1 deletion app/services/find/cycle_timetable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def self.next_cycle_year_range(year = current_year)

def self.current_cycle_schedule
# Make sure this setting only has effect on non-production environments
return :real if Rails.env.production_aks?
return :real if Rails.env.production?

SiteSetting.cycle_schedule
end
Expand Down
2 changes: 1 addition & 1 deletion app/views/find/switcher/cycles.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<%= content_for :page_title, "Recruitment cycles" %>
<% unless Rails.env.production_aks? %>
<% unless Rails.env.production? %>
<h1 class="govuk-heading-xl">Recruitment cycles</h1>
<%= form_with model: Find::ChangeCycleForm.new, url: find_switch_cycle_schedule_path, method: :post do |f| %>
<%= f.govuk_radio_buttons_fieldset :cycle_schedule_name,
Expand Down
2 changes: 1 addition & 1 deletion config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class Application < Rails::Application
config.view_component.preview_route = '/support/view_components'
config.view_component.default_preview_layout = 'component_preview'
config.view_component.preview_controller = 'Support::ComponentPreviewsController'
config.view_component.show_previews = !Rails.env.production_aks?
config.view_component.show_previews = !Rails.env.production?

config.analytics = config_for(:analytics)

Expand Down
3 changes: 0 additions & 3 deletions config/environments/production_aks.rb

This file was deleted.

3 changes: 0 additions & 3 deletions config/environments/qa_aks.rb

This file was deleted.

3 changes: 0 additions & 3 deletions config/environments/review_aks.rb

This file was deleted.

3 changes: 0 additions & 3 deletions config/environments/sandbox_aks.rb

This file was deleted.

3 changes: 0 additions & 3 deletions config/environments/staging_aks.rb

This file was deleted.

4 changes: 2 additions & 2 deletions config/initializers/console.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ def start

# https://api.rubyonrails.org/classes/ActiveRecord/Core.html#method-i-inspect
def set_attributes_for_inspect
ActiveRecord::Base.attributes_for_inspect = :all unless Rails.env.production_aks?
ActiveRecord::Base.attributes_for_inspect = :all unless Rails.env.production?
end

def show_warning_message_about_environments
if Rails.env.production_aks?
if Rails.env.production?
puts ('*' * 50).red
puts '** You are in the Rails console for PRODUCTION! **'.red
puts ('*' * 50).red
Expand Down
64 changes: 31 additions & 33 deletions config/rubocop/rails.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,31 +7,31 @@ Rails/SkipsModelValidations:

Rails/ThreeStateBooleanColumn:
Exclude:
- 'db/migrate/20190222063449_add_opted_in_to_provider.rb'
- 'db/migrate/20190812153252_add_is_send_to_course.rb'
- 'db/migrate/20191101115140_add_admin_to_users.rb'
- 'db/migrate/20200227105316_add_user_notifications_table.rb'
- 'db/migrate/20200312143851_add_course_create_to_user_notification.rb'
- 'db/migrate/20200930155031_add_permission_given_to_contacts.rb'
- 'db/migrate/20210527145331_add_visa_columns_to_the_database.rb'
- 'db/migrate/20210527145331_add_visa_columns_to_the_database.rb'
- 'db/migrate/20210609081246_add_structured_degree_columns_to_the_course_table.rb'
- 'db/migrate/20210614130500_add_structured_gcse_columns_to_course_table.rb'
- 'db/migrate/20210623150714_remove_structured_gcse_columns_from_course_table.rb'
- 'db/migrate/20210623150714_remove_structured_gcse_columns_from_course_table.rb'
- 'db/migrate/20220825093437_add_visa_fields_to_course.rb'
- 'db/migrate/20240619150526_add_a_level_requirements_to_course.rb'
- 'db/migrate/20240626110024_add_accept_pending_a_level_to_courses.rb'
- 'db/migrate/20240626152030_add_accept_a_level_equivalency_to_course.rb'
- "db/migrate/20190222063449_add_opted_in_to_provider.rb"
- "db/migrate/20190812153252_add_is_send_to_course.rb"
- "db/migrate/20191101115140_add_admin_to_users.rb"
- "db/migrate/20200227105316_add_user_notifications_table.rb"
- "db/migrate/20200312143851_add_course_create_to_user_notification.rb"
- "db/migrate/20200930155031_add_permission_given_to_contacts.rb"
- "db/migrate/20210527145331_add_visa_columns_to_the_database.rb"
- "db/migrate/20210527145331_add_visa_columns_to_the_database.rb"
- "db/migrate/20210609081246_add_structured_degree_columns_to_the_course_table.rb"
- "db/migrate/20210614130500_add_structured_gcse_columns_to_course_table.rb"
- "db/migrate/20210623150714_remove_structured_gcse_columns_from_course_table.rb"
- "db/migrate/20210623150714_remove_structured_gcse_columns_from_course_table.rb"
- "db/migrate/20220825093437_add_visa_fields_to_course.rb"
- "db/migrate/20240619150526_add_a_level_requirements_to_course.rb"
- "db/migrate/20240626110024_add_accept_pending_a_level_to_courses.rb"
- "db/migrate/20240626152030_add_accept_a_level_equivalency_to_course.rb"

Rails/HasAndBelongsToMany:
Exclude:
- 'app/models/provider.rb'
- 'app/models/organisation.rb'
- "app/models/provider.rb"
- "app/models/organisation.rb"

Rails/CreateTableWithTimestamps:
Exclude:
- 'db/migrate/20230905103742_delete_access_request_table.rb'
- "db/migrate/20230905103742_delete_access_request_table.rb"

Rails/OutputSafety:
Enabled: false
Expand All @@ -41,28 +41,27 @@ Rails/HasManyOrHasOneDependent:

Rails/UnknownEnv:
Environments:
- production_aks
- production
- development
- test
- sandbox

Rails/FindEach:
Exclude:
- 'app/services/subjects/financial_incentive_creator_service.rb'
- 'db/migrate/20190815091422_set_application_end_dates_on_recruitment_cycles.rb'
- 'db/migrate/20190909105439_provider_enrichment_user_not_null.rb'
- 'db/migrate/20190913125905_migrate_subjects.rb'
- 'db/migrate/20191016144506_copy_latest_provider_enrichment_data_to_provider.rb'
- 'db/migrate/20190711074433_change_course_accrediting_provider_id_to_code.rb'
- 'db/migrate/20190806102256_add_applications_open_from_to_courses.rb'
- 'lib/tasks/correct_subject_positions.rake'

- "app/services/subjects/financial_incentive_creator_service.rb"
- "db/migrate/20190815091422_set_application_end_dates_on_recruitment_cycles.rb"
- "db/migrate/20190909105439_provider_enrichment_user_not_null.rb"
- "db/migrate/20190913125905_migrate_subjects.rb"
- "db/migrate/20191016144506_copy_latest_provider_enrichment_data_to_provider.rb"
- "db/migrate/20190711074433_change_course_accrediting_provider_id_to_code.rb"
- "db/migrate/20190806102256_add_applications_open_from_to_courses.rb"
- "lib/tasks/correct_subject_positions.rake"

Rails/RedundantActiveRecordAllMethod:
Exclude:
- 'spec/services/support/data_exports/data_export_spec.rb'
- 'spec/services/support/data_exports/data_export_spec.rb'
- 'spec/support/feature_helpers/govuk_components.rb'
- "spec/services/support/data_exports/data_export_spec.rb"
- "spec/services/support/data_exports/data_export_spec.rb"
- "spec/support/feature_helpers/govuk_components.rb"

Rails/Output:
Exclude:
Expand All @@ -71,4 +70,3 @@ Rails/Output:
Rails/ApplicationRecord:
Exclude:
- config/initializers/blazer.rb

4 changes: 4 additions & 0 deletions config/settings/production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ bg_jobs:
cron: "0 0 * * *" # daily at midnight
class: "SaveStatisticJob"
queue: save_statistic
send_entity_table_checks_to_bigquery:
cron: "30 0 * * *" # daily at 00:30
class: "DfE::Analytics::EntityTableCheckJob"
queue: low_priority
skylight:
enable: true
environment:
Expand Down
42 changes: 0 additions & 42 deletions config/settings/production_aks.yml

This file was deleted.

35 changes: 0 additions & 35 deletions config/settings/qa_aks.yml

This file was deleted.

15 changes: 0 additions & 15 deletions config/settings/review_aks.yml

This file was deleted.

22 changes: 0 additions & 22 deletions config/settings/sandbox_aks.yml

This file was deleted.

31 changes: 0 additions & 31 deletions config/settings/staging_aks.yml

This file was deleted.

2 changes: 1 addition & 1 deletion global_config/dv_review.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CONFIG=dv_review_aks
CONFIG=dv_review
DEPLOY_ENV=dv_review
CONFIG_SHORT=rv
AZ_SUBSCRIPTION=s189-teacher-services-cloud-development
Expand Down
2 changes: 1 addition & 1 deletion global_config/production.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CONFIG=production_aks
CONFIG=production
DEPLOY_ENV=production
CONFIG_SHORT=pd
AZ_SUBSCRIPTION=s189-teacher-services-cloud-production
Expand Down
2 changes: 1 addition & 1 deletion global_config/qa.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CONFIG=qa_aks
CONFIG=qa
DEPLOY_ENV=qa
CONFIG_SHORT=qa
AZ_SUBSCRIPTION=s189-teacher-services-cloud-test
Expand Down
2 changes: 1 addition & 1 deletion global_config/review.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CONFIG=review_aks
CONFIG=review
DEPLOY_ENV=review
CONFIG_SHORT=rv
AZ_SUBSCRIPTION=s189-teacher-services-cloud-test
Expand Down
2 changes: 1 addition & 1 deletion global_config/sandbox.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CONFIG=sandbox_aks
CONFIG=sandbox
DEPLOY_ENV=sandbox
CONFIG_SHORT=sbx
AZ_SUBSCRIPTION=s189-teacher-services-cloud-production
Expand Down
2 changes: 1 addition & 1 deletion global_config/staging.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CONFIG=staging_aks
CONFIG=staging
DEPLOY_ENV=staging
CONFIG_SHORT=stg
AZ_SUBSCRIPTION=s189-teacher-services-cloud-test
Expand Down
Loading
Loading