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

Removal of outdate feature flags + bundle update #1669

Merged
merged 7 commits into from
Dec 6, 2023
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
64 changes: 61 additions & 3 deletions .github/workflows/ci-full-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,68 @@ jobs:
-e FAF_FRAMEWORK_ENDPOINT=http://faf.test \
-e CI_NODE_TOTAL=${{ matrix.ci_node_total }} \
-e CI_NODE_INDEX=${{ matrix.ci_node_index }} \
-e CI=1 \
-v ${PWD}/coverage/coverage-${{ matrix.ci_node_index }}:/srv/app/coverage \
${{ needs.build_test.outputs.docker_image }} \
bash -c "bundle exec rake knapsack:rspec || bundle exec rspec --only-failure"
bash -c "bundle exec rake 'knapsack:rspec[--tag ~flaky]' || bundle exec rspec --only-failure"

rspec_quarentine:
name: Checks - Rspec (Quarantined tests)
needs: build_test
runs-on: ubuntu-20.04

services:
postgres:
image: postgres
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
POSTGRES_HOST_AUTH_METHOD: trust
ports:
- 5432:5432
redis:
image: redis
ports:
- 6379:6379
chrome:
image: selenium/standalone-chrome:95.0-chromedriver-95.0
ports:
- 4444:4444

steps:
- name: Run Rspec tests
run: |
docker run --rm \
--network ${{ job.container.network }} \
-e RAILS_ENV=test \
-e DATABASE_URL=postgres://postgres:password@postgres:5432/buy-for-your-school-test \
-e DATABASE_CLEANER_ALLOW_REMOTE_DATABASE_URL="true" \
-e DOCKER=true \
-e SELENIUM_HUB_URL=http://chrome:4444/wd/hub \
-e REDIS_URL=redis://redis:6379 \
-e APPLICATION_URL=http://localhost:3000 \
-e SECRET_KEY_BASE=test \
-e CONTENTFUL_SPACE=test \
-e CONTENTFUL_ENVIRONMENT=master \
-e CONTENTFUL_DELIVERY_TOKEN=123 \
-e CONTENTFUL_PREVIEW_TOKEN=123 \
-e CONTENTFUL_ENTRY_CACHING=false \
-e CONTENTFUL_WEBHOOK_API_KEY=test \
-e NOTIFY_API_KEY=development_team-12345678-1234-1234-1234-abcd12345678-12345678-1234-1234-1234-abcd12345678 \
-e MS_GRAPH_TENANT=test \
-e MS_GRAPH_CLIENT_ID=test \
-e MS_GRAPH_CLIENT_SECRET=test \
-e MS_GRAPH_SHARED_MAILBOX_USER_ID=test \
-e MS_GRAPH_SHARED_MAILBOX_NAME=mailbox \
-e MS_GRAPH_SHARED_MAILBOX_ADDRESS=test@mailbox.com \
-e CLAMAV_REST_SERVICE_URL=test \
-e DSI_ENV=test \
-e DFE_SIGN_IN_IDENTIFIER=service \
-e DFE_SIGN_IN_API_SECRET=secret \
-e PROC_OPS_TEAM="DSI Caseworkers" \
-e QUALTRICS_SURVEY_URL=https://dferesearch.fra1.qualtrics.com \
-e SUPPORT_EMAIL=email@example.gov.uk \
-e FAF_FRAMEWORK_ENDPOINT=http://faf.test \
${{ needs.build_test.outputs.docker_image }} \
bash -c "bundle exec rspec --tag flaky || bundle exec rspec --only-failure"

release_dev:
name: Deploy release (Dev)
Expand Down
88 changes: 42 additions & 46 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -100,21 +100,21 @@ GEM
activerecord
ast (2.4.2)
attr_required (1.0.1)
aws-eventstream (1.2.0)
aws-partitions (1.844.0)
aws-sdk-core (3.186.0)
aws-eventstream (~> 1, >= 1.0.2)
aws-eventstream (1.3.0)
aws-partitions (1.863.0)
aws-sdk-core (3.190.0)
aws-eventstream (~> 1, >= 1.3.0)
aws-partitions (~> 1, >= 1.651.0)
aws-sigv4 (~> 1.5)
aws-sigv4 (~> 1.8)
jmespath (~> 1, >= 1.6.1)
aws-sdk-kms (1.72.0)
aws-sdk-core (~> 3, >= 3.184.0)
aws-sdk-kms (1.74.0)
aws-sdk-core (~> 3, >= 3.188.0)
aws-sigv4 (~> 1.1)
aws-sdk-s3 (1.136.0)
aws-sdk-core (~> 3, >= 3.181.0)
aws-sdk-s3 (1.141.0)
aws-sdk-core (~> 3, >= 3.189.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.6)
aws-sigv4 (1.6.1)
aws-sigv4 (~> 1.8)
aws-sigv4 (1.8.0)
aws-eventstream (~> 1, >= 1.0.2)
backports (3.24.1)
base64 (0.2.0)
Expand All @@ -136,10 +136,10 @@ GEM
debug_inspector (>= 0.0.1)
bootsnap (1.17.0)
msgpack (~> 1.2)
brakeman (6.0.1)
brakeman (6.1.0)
brow (0.4.1)
builder (3.2.4)
bullet (7.1.2)
bullet (7.1.4)
activesupport (>= 3.0.0)
uniform_notifier (~> 1.11)
byebug (11.1.3)
Expand Down Expand Up @@ -183,8 +183,7 @@ GEM
debug_inspector (1.1.0)
diff-lcs (1.5.0)
docile (1.4.0)
domain_name (0.5.20190701)
unf (>= 0.0.5, < 1.0.0)
domain_name (0.6.20231109)
dotenv (2.8.1)
dotenv-rails (2.8.1)
dotenv (= 2.8.1)
Expand Down Expand Up @@ -237,14 +236,14 @@ GEM
actionmailer (>= 5.2, < 8)
activesupport (>= 5.2, < 8)
execjs (2.9.1)
factory_bot (6.2.1)
factory_bot (6.4.2)
activesupport (>= 5.0.0)
factory_bot_rails (6.2.0)
factory_bot (~> 6.2.0)
factory_bot_rails (6.4.2)
factory_bot (~> 6.4)
railties (>= 5.0.0)
faker (3.2.1)
faker (3.2.2)
i18n (>= 1.8.11, < 2)
faraday (2.7.11)
faraday (2.7.12)
base64
faraday-net_http (>= 2.0, < 3.1)
ruby2_keywords (>= 0.0.4)
Expand Down Expand Up @@ -317,7 +316,7 @@ GEM
terminal-table (>= 1.5.1)
ice_nine (0.11.2)
io-console (0.6.0)
irb (1.9.0)
irb (1.10.1)
rdoc
reline (>= 0.3.8)
jbuilder (2.11.5)
Expand All @@ -330,7 +329,7 @@ GEM
thor (>= 0.14, < 2.0)
jsbundling-rails (1.2.1)
railties (>= 6.0.0)
json (2.6.3)
json (2.7.1)
json-jwt (1.16.3)
activesupport (>= 4.2)
aes_key_wrap
Expand Down Expand Up @@ -368,14 +367,14 @@ GEM
mini_racer (0.8.0)
libv8-node (~> 18.16.0.0)
minitest (5.20.0)
mock_redis (0.39.0)
mock_redis (0.40.0)
msgpack (1.7.2)
multi_json (1.15.0)
multi_xml (0.6.0)
mutex_m (0.2.0)
net-http-persistent (4.0.2)
connection_pool (~> 2.2)
net-imap (0.4.5)
net-imap (0.4.7)
date
net-protocol
net-pop (0.1.2)
Expand All @@ -384,12 +383,12 @@ GEM
timeout
net-smtp (0.4.0)
net-protocol
nio4r (2.6.0)
nokogiri (1.15.4-arm64-darwin)
nio4r (2.7.0)
nokogiri (1.15.5-arm64-darwin)
racc (~> 1.4)
nokogiri (1.15.4-x86_64-darwin)
nokogiri (1.15.5-x86_64-darwin)
racc (~> 1.4)
nokogiri (1.15.4-x86_64-linux)
nokogiri (1.15.5-x86_64-linux)
racc (~> 1.4)
notifications-ruby-client (5.4.0)
jwt (>= 1.5, < 3)
Expand Down Expand Up @@ -417,7 +416,7 @@ GEM
validate_url
webfinger (~> 2.0)
pagy (6.2.0)
pandoc-ruby (2.1.9)
pandoc-ruby (2.1.10)
paper_trail (15.1.0)
activerecord (>= 6.1)
request_store (~> 1.4)
Expand All @@ -439,7 +438,7 @@ GEM
pry (>= 0.10.4)
psych (5.1.1.1)
stringio
public_suffix (5.0.3)
public_suffix (5.0.4)
puma (6.4.0)
nio4r (~> 2.0)
pundit (2.3.1)
Expand All @@ -457,7 +456,7 @@ GEM
rack (>= 2.1.0)
rack-protection (3.1.0)
rack (~> 2.2, >= 2.2.4)
rack-session (1.0.1)
rack-session (1.0.2)
rack (< 3)
rack-test (2.1.0)
rack (>= 1.3)
Expand Down Expand Up @@ -506,29 +505,29 @@ GEM
rb-fsevent (0.11.2)
rb-inotify (0.10.1)
ffi (~> 1.0)
rdoc (6.6.0)
rdoc (6.6.1)
psych (>= 4.0.0)
redis (4.8.1)
redis-actionpack (5.3.0)
redis-actionpack (5.4.0)
actionpack (>= 5, < 8)
redis-rack (>= 2.1.0, < 3)
redis-rack (>= 2.1.0, < 4)
redis-store (>= 1.1.0, < 2)
redis-activesupport (5.3.0)
activesupport (>= 3, < 8)
redis-store (>= 1.3, < 2)
redis-namespace (1.11.0)
redis (>= 4)
redis-rack (2.1.4)
rack (>= 2.0.8, < 3)
redis-rack (3.0.0)
rack-session (>= 0.2.0)
redis-store (>= 1.2, < 2)
redis-rails (5.0.2)
redis-actionpack (>= 5.0, < 6)
redis-activesupport (>= 5.0, < 6)
redis-store (>= 1.2, < 2)
redis-store (1.10.0)
redis (>= 4, < 6)
regexp_parser (2.8.2)
reline (0.4.0)
regexp_parser (2.8.3)
reline (0.4.1)
io-console (~> 0.5)
request_store (1.5.1)
rack (>= 1.4)
Expand All @@ -543,7 +542,7 @@ GEM
rspec-mocks (3.12.6)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.12.0)
rspec-rails (6.0.3)
rspec-rails (6.1.0)
actionpack (>= 6.1)
activesupport (>= 6.1)
railties (>= 6.1)
Expand Down Expand Up @@ -607,7 +606,7 @@ GEM
connection_pool (>= 2.2.5, < 3)
rack (~> 2.0)
redis (>= 4.5.0, < 5)
sidekiq-cron (1.10.1)
sidekiq-cron (1.11.0)
fugit (~> 1.8)
globalid (>= 1.0.1)
sidekiq (>= 6)
Expand All @@ -622,7 +621,7 @@ GEM
simplecov_json_formatter (0.1.4)
slack-notifier (2.4.0)
smart_properties (1.17.0)
spring (4.1.1)
spring (4.1.3)
spring-commands-rspec (1.0.4)
spring (>= 0.9.1)
sprockets (4.2.1)
Expand All @@ -634,15 +633,15 @@ GEM
sprockets (>= 3.0.0)
stimulus-rails (1.3.0)
railties (>= 6.0.0)
stringio (3.0.9)
stringio (3.1.0)
swd (2.0.2)
activesupport (>= 3)
attr_required (>= 0.0.5)
faraday (~> 2.0)
faraday-follow_redirects
terminal-table (3.0.2)
unicode-display_width (>= 1.1.1, < 3)
terser (1.1.19)
terser (1.1.20)
execjs (>= 0.3.0, < 3)
thor (1.3.0)
timeout (0.4.1)
Expand All @@ -652,9 +651,6 @@ GEM
railties (>= 6.0.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unf (0.1.4)
unf_ext
unf_ext (0.0.8.2)
unicode-display_width (2.5.0)
uniform_notifier (1.16.0)
validate_email (0.1.6)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,7 @@ def case_procurement_details_form_params

# @return [Hash]
def persisted_data
framework_name = if Flipper.enabled?(:framework_select_from_register)
current_case.procurement.register_framework&.reference_and_name
else
current_case.procurement.framework&.name
end

framework_name = current_case.procurement.register_framework&.reference_and_name
current_case.procurement.to_h.merge(framework_name:)
end
end
Expand Down
10 changes: 2 additions & 8 deletions app/controllers/support/cases_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,7 @@ def index
@cases = @all_cases_filter_form.results.paginate(page: params[:cases_page]).load_async
@new_cases = @new_cases_filter_form.results.paginate(page: params[:new_cases_page]).load_async
@my_cases = @my_cases_filter_form.results.paginate(page: params[:my_cases_page]).load_async

if Flipper.enabled?(:cms_triage_view)
@triage_cases = @triage_cases_filter_form.results.paginate(page: params[:triage_cases_page]).load_async
end
@triage_cases = @triage_cases_filter_form.results.paginate(page: params[:triage_cases_page]).load_async
end
end
end
Expand Down Expand Up @@ -56,10 +53,7 @@ def filter_forms
@all_cases_filter_form = Case.filtering(filter_params_for(:filter_all_cases_form, defaults:, persist: !override_filter(:filter_all_cases_form)).except(:override))
@new_cases_filter_form = Case.initial.filtering(filter_params_for(:filter_new_cases_form, defaults:))
@my_cases_filter_form = Case.by_agent(current_agent.id).filtering(filter_params_for(:filter_my_cases_form, defaults: defaults.merge({ state: %w[live] })))

if Flipper.enabled?(:cms_triage_view)
@triage_cases_filter_form = Case.triage.filtering(filter_params_for(:filter_triage_cases_form, defaults: defaults.merge({ state: %w[live] })))
end
@triage_cases_filter_form = Case.triage.filtering(filter_params_for(:filter_triage_cases_form, defaults: defaults.merge({ state: %w[live] })))
end

def override_filter(filter_scope) = params.fetch(filter_scope, {}).permit(:override)[:override] == "true"
Expand Down
26 changes: 11 additions & 15 deletions app/controllers/support/frameworks_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,18 @@ class FrameworksController < ApplicationController
def index
respond_to do |format|
format.json do
if Flipper.enabled?(:framework_select_from_register)
methods = %i[display_status
reference_and_name
category_names
provider_name
display_provider_start_date
display_provider_end_date]
methods = %i[display_status
reference_and_name
category_names
provider_name
display_provider_start_date
display_provider_end_date]

render json: ::Frameworks::Framework
.not_evaluating
.omnisearch(params[:q])
.order("reference DESC")
.as_json(methods:)
else
render json: Framework.omnisearch(params[:q]).map { |f| FrameworkPresenter.new(f) }.as_json
end
render json: ::Frameworks::Framework
.not_evaluating
.omnisearch(params[:q])
.order("reference DESC")
.as_json(methods:)
end
end
end
Expand Down
Loading