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

Release FY24Q3.2.0 #21629

Merged
merged 41 commits into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
f183dde
added saftey opperator and removed outdated date check
HunJerBAH Mar 1, 2024
6e3075c
removed leftover method that was breaking and unused.
HunJerBAH Mar 6, 2024
5c5e8fa
Merge branch 'master' into HunJerBAH/APPEALS-41361
HunJerBAH Mar 18, 2024
1906fa1
removed legacy appeal date check for MST on special issue list
HunJerBAH Mar 19, 2024
8b36d35
updated mst and pact badges to check decisions in flight (if any) the…
HunJerBAH Mar 21, 2024
ebafe67
removed bypass for special issue list for pact toggle for AMA.
HunJerBAH Mar 21, 2024
5652a95
updated rake and seed comments
HunJerBAH Mar 21, 2024
64c5130
Merge branch 'master' into HunJerBAH/APPEALS-41361
HunJerBAH Mar 22, 2024
89f3c35
allowed special issues page tracking for AMA MST issues when pact is …
HunJerBAH Mar 26, 2024
3c6ab02
remove code changes causing cancel to progress forward
HunJerBAH Apr 16, 2024
cb47d2d
moved method definition validate_claim_code into ClaimLabelChange class
Apr 29, 2024
a7bda22
fixed spacing issue
Apr 29, 2024
fe99e28
fixed linting error
Apr 29, 2024
afcc473
fixed linting issue
Apr 29, 2024
06dda06
draft pr
IsaiahBar Apr 30, 2024
cda9dea
Completing AC for ticketing for styling and error portion of page. No…
IsaiahBar May 2, 2024
5762ad2
added ability for user to search by css id
HunJerBAH May 2, 2024
1713ecb
added feature tests for using search bar
HunJerBAH May 2, 2024
676a3b7
Merge branch 'master' into IsaiahBar/APPEALS-41639
HunJerBAH May 2, 2024
4c45cbb
reverted changes in package.json
HunJerBAH May 2, 2024
500d03c
removed added file
HunJerBAH May 2, 2024
b0a68a9
removed linting error
HunJerBAH May 2, 2024
eefd0ae
searchable by 2 characters instead of 1
IsaiahBar May 3, 2024
0c74de0
Merge branch 'IsaiahBar/APPEALS-41639' of https://github.com/departme…
IsaiahBar May 3, 2024
50016b8
Merge branch 'master' into HunJerBAH/APPEALS-41361
HunJerBAH May 3, 2024
8e293aa
Merge branch 'HunJerBAH/APPEALS-44290' into HunJerBAH/FY24Q3.2-mst-pa…
HunJerBAH May 3, 2024
67fe9b3
Merge branch 'master' into hotfix/APPEALS-45186
raymond-hughes May 6, 2024
a085735
ccc
IsaiahBar May 6, 2024
461955a
gggg
IsaiahBar May 6, 2024
dc099d5
gggg
IsaiahBar May 6, 2024
a5b63e3
feature/APPEALS-44188-44282 - Deprecation fixes for Rails 6.1 (releas…
jcroteau May 10, 2024
080bb01
Merge branch 'master' into hotfix/APPEALS-45186
raymond-hughes May 10, 2024
f6dc6b4
Merge branch 'hotfix/APPEALS-45186' into release/FY24Q3.2.0
raymond-hughes May 10, 2024
7501557
APPEALS-44310: add notification for unexpected task trees and update …
craigrva May 10, 2024
e80dde2
APPEALS-45199: Update Quality Review selection probabilities #21518
craigrva May 10, 2024
15c3381
APPEALS-44423: Remove therubyracer and jshint gems (#21443)
craigrva May 10, 2024
a87044e
Merge pull request #21552 from department-of-veterans-affairs/HunJerB…
cacevesva May 10, 2024
f7c152a
Merge branch 'release/FY24Q3.2.0' into IsaiahBar/APPEALS-41639
cacevesva May 10, 2024
e5a93fa
Merge pull request #21540 from department-of-veterans-affairs/IsaiahB…
cacevesva May 10, 2024
205ca88
APPEALS-42941 copied over Matt's work (#21624)
amybids May 13, 2024
067bb68
lint error resolution (#21631)
HunJerBAH May 14, 2024
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
3 changes: 0 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,6 @@ gem "statsd-instrument"
gem "stringex", require: false
# catch problematic migrations at development/test time
gem "strong_migrations"
# execjs runtime
gem "therubyracer", platforms: :ruby
# print trees
gem "tty-tree"
gem "tzinfo", "1.2.10"
Expand Down Expand Up @@ -106,7 +104,6 @@ group :test, :development, :demo do
gem "guard-rspec"
gem "immigrant"
# Linters
gem "jshint", platforms: :ruby
gem "pluck_to_hash"
gem "pry", "~> 0.13.0"
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
Expand Down
12 changes: 0 additions & 12 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -367,10 +367,6 @@ GEM
rails-dom-testing (>= 1, < 3)
railties (>= 4.2.0)
thor (>= 0.14, < 2.0)
jshint (1.5.0)
execjs (>= 1.4.0)
multi_json (~> 1.0)
therubyracer (~> 0.12.1)
json (2.3.0)
json_schemer (0.2.16)
ecma-re-validator (~> 0.2)
Expand All @@ -397,7 +393,6 @@ GEM
kramdown (~> 2.0)
launchy (2.4.3)
addressable (~> 2.3)
libv8 (3.16.14.19)
listen (3.1.5)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
Expand Down Expand Up @@ -431,7 +426,6 @@ GEM
momentjs-rails (2.29.4.1)
railties (>= 3.1)
msgpack (1.4.2)
multi_json (1.12.2)
multipart-post (2.1.1)
multiverse (0.2.2)
activerecord (>= 4.2)
Expand Down Expand Up @@ -564,7 +558,6 @@ GEM
redis-store (>= 1.2, < 2)
redis-store (1.4.1)
redis (>= 2.2, < 5)
ref (2.0.0)
regexp_parser (1.6.0)
request_store (1.4.1)
rack (>= 1.4)
Expand Down Expand Up @@ -696,9 +689,6 @@ GEM
terminal-table (1.8.0)
unicode-display_width (~> 1.1, >= 1.1.1)
test-prof (0.10.1)
therubyracer (0.12.3)
libv8 (~> 3.16.14.15)
ref
thor (0.20.3)
thread_safe (0.3.6)
tilt (2.0.8)
Expand Down Expand Up @@ -792,7 +782,6 @@ DEPENDENCIES
holidays (~> 6.4)
icalendar
immigrant
jshint
json_schemer (~> 0.2.16)
kaminari
knapsack_pro (~> 3.8)
Expand Down Expand Up @@ -849,7 +838,6 @@ DEPENDENCIES
stringex
strong_migrations
test-prof
therubyracer
timecop
tty-tree
tzinfo (= 1.2.10)
Expand Down
6 changes: 1 addition & 5 deletions app/jobs/caseflow_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,8 @@ def metrics_service_report_time_segment(segment:, start_time:)
)
end

def slack_url
ENV["SLACK_DISPATCH_ALERT_URL"]
end

def slack_service
@slack_service ||= SlackService.new(url: slack_url)
@slack_service ||= SlackService.new
end

def log_error(error, extra: {})
Expand Down
6 changes: 1 addition & 5 deletions app/jobs/out_of_service_reminder_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def perform
out_of_service_apps.push(app.humanize) if Rails.cache.read(app + "_out_of_service")
end

SlackService.new(url: url).send_notification(message(out_of_service_apps)) unless out_of_service_apps.empty?
SlackService.new.send_notification(message(out_of_service_apps)) unless out_of_service_apps.empty?
end

def message(apps)
Expand All @@ -23,8 +23,4 @@ def message(apps)
"Reminder: #{apps.to_sentence} are out of service."
end
end

def url
ENV["SLACK_DISPATCH_ALERT_URL"]
end
end
6 changes: 1 addition & 5 deletions app/jobs/prepare_establish_claim_tasks_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@ def log_info(count)
msg = "PrepareEstablishClaimTasksJob successfully ran: #{count[:success]} tasks " \
"prepared and #{count[:fail]} tasks failed"
Rails.logger.info msg
SlackService.new(url: url).send_notification(msg)
end

def url
ENV["SLACK_DISPATCH_ALERT_URL"]
SlackService.new.send_notification(msg)
end
end
5 changes: 2 additions & 3 deletions app/jobs/quarterly_notifications_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@ class QuarterlyNotificationsJob < CaseflowJob
def perform # rubocop:disable Metrics/AbcSize, Metrics/MethodLength, Metrics/PerceivedComplexity
ensure_current_user_is_set

AppealState.where.not(
decision_mailed: true, appeal_cancelled: true
).find_in_batches(batch_size: QUERY_LIMIT.to_i) do |batched_appeal_states|
AppealState.where.not(decision_mailed: true).where.not(appeal_cancelled: true)
.find_in_batches(batch_size: QUERY_LIMIT.to_i) do |batched_appeal_states|
batched_appeal_states.each do |appeal_state|
# add_record_to_appeal_states_table(appeal_state.appeal)
if appeal_state.appeal_type == "Appeal"
Expand Down
4 changes: 1 addition & 3 deletions app/models/appeal.rb
Original file line number Diff line number Diff line change
Expand Up @@ -263,9 +263,7 @@ def mst?
return decision_issues.any?(&:mst_status) unless decision_issues.empty?

request_issues.active.any?(&:mst_status) ||
(special_issue_list &&
special_issue_list.created_at < "2023-06-01".to_date &&
special_issue_list.military_sexual_trauma)
special_issue_list&.military_sexual_trauma
end

# :reek:RepeatedConditionals
Expand Down
2 changes: 1 addition & 1 deletion app/models/bgs_power_of_attorney.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def find_or_create_by_file_number(file_number)
end

def find_or_create_by_claimant_participant_id(claimant_participant_id)
poa = find_or_create_by!(claimant_participant_id: claimant_participant_id)
poa = default_scoped.find_or_create_by!(claimant_participant_id: claimant_participant_id)
if FeatureToggle.enabled?(:poa_auto_refresh, user: RequestStore.store[:current_user])
poa.save_with_updated_bgs_record! if poa&.expired?
end
Expand Down
50 changes: 33 additions & 17 deletions app/models/concerns/distribution_concern.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,47 @@ module DistributionConcern

private

# A list of tasks which are expected or allowed to be open at time of distribution
ALLOWABLE_TASKS = [
RootTask.name,
DistributionTask.name,
JudgeAssignTask.name,
TrackVeteranTask.name,
VeteranRecordRequest.name,
*MailTask.subclasses.reject(&:blocking?).map(&:name)
].freeze

def assign_judge_tasks_for_appeals(appeals, judge)
appeals.map do |appeal|
check_for_unexpected_tasks(appeal)

# If an appeal does not have an open DistributionTask, then it has already been distributed by automatic
# case distribution and a new JudgeAssignTask should not be created. This should only occur if two users
# request a distribution simultaneously.
if appeal.tasks.open.of_type(:DistributionTask).any?
distribution_task_assignee_id = appeal.tasks.of_type(:DistributionTask).first.assigned_to_id
Rails.logger.info("Calling JudgeAssignTaskCreator for appeal #{appeal.id} with judge #{judge.css_id}")
JudgeAssignTaskCreator.new(appeal: appeal,
judge: judge,
assigned_by_id: distribution_task_assignee_id).call
else
msg = "Appeal ID #{appeal.id} cannot be distributed. Check its task tree and manually remediate if necessary"
title = "Appeal unable to be distributed"
SlackService.new(url: slack_url).send_notification(msg, title)

nil
end
next nil unless appeal.tasks.open.of_type(:DistributionTask).any?

distribution_task_assignee_id = appeal.tasks.of_type(:DistributionTask).first.assigned_to_id
Rails.logger.info("Calling JudgeAssignTaskCreator for appeal #{appeal.id} with judge #{judge.css_id}")
JudgeAssignTaskCreator.new(appeal: appeal,
judge: judge,
assigned_by_id: distribution_task_assignee_id).call
end
end

# Check for tasks which are open that we would not expect to see at the time of distribution. Send a slack
# message for notification of a potential bug in part of the application, but do not stop the distribution
def check_for_unexpected_tasks(appeal)
unless appeal.tasks.open.reject { |task| ALLOWABLE_TASKS.include?(task.class.name) }.empty?
send_slack_notification(appeal)
end
end

def send_slack_notification(appeal)
msg = "Appeal #{appeal.id}. Check its task tree for a potential bug or tasks which need to be manually remediated"
title = "Appeal with unexpected open tasks during distribution"
SlackService.new.send_notification(msg, title)
end

def assign_sct_tasks_for_appeals(appeals)
appeals.map do |appeal|
next nil unless appeal.tasks.open.of_type(:DistributionTask).any?
Expand All @@ -41,10 +61,6 @@ def cancel_previous_judge_assign_task(appeal, judge_id)
appeal.tasks.of_type(:JudgeAssignTask).where.not(assigned_to_id: judge_id).update(status: :cancelled)
end

def slack_url
ENV["SLACK_DISPATCH_ALERT_URL"]
end

# rubocop:disable Metrics/MethodLength
# :reek:FeatureEnvy
def create_sct_appeals(appeals_args, limit)
Expand Down
2 changes: 1 addition & 1 deletion app/models/dispatch/task.rb
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ def should_invalidate?
end

def no_open_tasks_for_appeal
if self.class.to_complete_task_for_appeal(appeal).any?
if self.class.default_scoped.to_complete_task_for_appeal(appeal).any?
errors.add(:appeal, "Uncompleted task already exists for this appeal")
end
end
Expand Down
3 changes: 3 additions & 0 deletions app/models/distribution.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ def distribute!(limit = nil)
end
rescue StandardError => error
process_error(error)
title = "Distribution Failed"
msg = "Distribution #{id} failed: #{error.message}}"
SlackService.new.send_notification(msg, title)

raise error
end
Expand Down
2 changes: 1 addition & 1 deletion app/models/judge_case_review.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class JudgeCaseReview < CaseflowRecord
# As of Dec 2019, we want AMA and Legacy to use the same cap. The percentages may differ. The
# goal is to get to the cap as steadily across the month as possible
MONTHLY_LIMIT_OF_QUALITY_REVIEWS = 137
QUALITY_REVIEW_SELECTION_PROBABILITY = 0.032
QUALITY_REVIEW_SELECTION_PROBABILITY = 0.100

def update_in_vacols!
MetricsService.record("VACOLS: judge_case_review #{task_id}",
Expand Down
5 changes: 1 addition & 4 deletions app/models/legacy_appeal.rb
Original file line number Diff line number Diff line change
Expand Up @@ -636,10 +636,7 @@ def mst?
return false unless FeatureToggle.enabled?(:mst_identification, user: RequestStore[:current_user]) &&
FeatureToggle.enabled?(:legacy_mst_pact_identification, user: RequestStore[:current_user])

issues.any?(&:mst_status) ||
(special_issue_list &&
special_issue_list.created_at < "2023-06-01".to_date &&
special_issue_list.military_sexual_trauma)
issues.any?(&:mst_status) || special_issue_list&.military_sexual_trauma
end

def pact?
Expand Down
2 changes: 1 addition & 1 deletion app/models/quality_review_case_selector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class QualityReviewCaseSelector
# AMA Limit and Probability. See Legacy numbers at app/models/judge_case_review.rb:28
# This probability was selected by Derek Brown, QR Director at BVA
MONTHLY_LIMIT_OF_QUALITY_REVIEWS = 164
QUALITY_REVIEW_SELECTION_PROBABILITY = 0.188
QUALITY_REVIEW_SELECTION_PROBABILITY = 0.057

class << self
def select_case_for_quality_review?
Expand Down
4 changes: 2 additions & 2 deletions app/models/tasks/judge_decision_review_task.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ def self.label
private

def ama_judge_actions
# bypass special issues page if mst/pact enabled
# bypass special issues page if mst issue tracking is enabled
return Constants.TASK_ACTIONS.JUDGE_AMA_CHECKOUT.to_h if
FeatureToggle.enabled?(:mst_identification) || FeatureToggle.enabled?(:pact_identification)
FeatureToggle.enabled?(:mst_identification)

Constants.TASK_ACTIONS.JUDGE_AMA_CHECKOUT_SPECIAL_ISSUES.to_h
end
Expand Down
4 changes: 2 additions & 2 deletions app/models/tasks/judge_dispatch_return_task.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ def self.label

# :reek:UtilityFunction
def ama_issue_checkout
# bypass special issues page if mst/pact enabled
# bypass special issues page if mst issue tracking is enabled
return Constants.TASK_ACTIONS.JUDGE_AMA_CHECKOUT.to_h if
FeatureToggle.enabled?(:mst_identification) || FeatureToggle.enabled?(:pact_identification)
FeatureToggle.enabled?(:mst_identification)

Constants.TASK_ACTIONS.JUDGE_AMA_CHECKOUT_SPECIAL_ISSUES.to_h
end
Expand Down
2 changes: 1 addition & 1 deletion app/models/team_quota.rb
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,6 @@ def most_recent_user_count

# Cap the search to the last month to avoid an infinite loop
def most_recent_user_counts
self.class.where(task_type: task_type).order(:date).limit(31).lazy.map(&:user_count)
self.class.default_scoped.where(task_type: task_type).order(:date).limit(31).lazy.map(&:user_count)
end
end
5 changes: 4 additions & 1 deletion app/models/vbms_uploaded_document.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ class VbmsUploadedDocument < CaseflowRecord
attribute :file, :string

scope :successfully_uploaded, lambda {
where(error: nil).where.not(uploaded_to_vbms_at: nil, attempted_at: nil, processed_at: nil)
where(error: nil)
.where.not(uploaded_to_vbms_at: nil)
.where.not(attempted_at: nil)
.where.not(processed_at: nil)
}

def cache_file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ def appeal_ids_for_completed_root_tasks
def appeal_ids_for_open_child_tasks
ETL::Task.select(:appeal_id).distinct
.where(appeal_type: "Appeal")
.where.not(task_type: "RootTask", task_status: Task.closed_statuses)
.where.not(task_type: "RootTask")
.where.not(task_status: Task.closed_statuses)
end
end
3 changes: 2 additions & 1 deletion app/queries/etl/unknown_status_with_open_root_task_query.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ def appeal_ids_for_open_root_tasks
def appeal_ids_for_open_child_tasks
ETL::Task.select(:appeal_id).distinct
.where(appeal_type: "Appeal")
.where.not(task_type: "RootTask", task_status: Task.closed_statuses)
.where.not(task_type: "RootTask")
.where.not(task_status: Task.closed_statuses)
end
end
4 changes: 2 additions & 2 deletions app/repositories/task_action_repository.rb
Original file line number Diff line number Diff line change
Expand Up @@ -902,9 +902,9 @@ def cancel_task_and_return_to_sct_action(task, _)
def select_ama_review_decision_action(task)
return Constants.TASK_ACTIONS.REVIEW_VACATE_DECISION.to_h if task.appeal.vacate?

# route to decision if mst/pact toggles are enabled.
# bypass special issues page if MST is enabled
return Constants.TASK_ACTIONS.REVIEW_AMA_DECISION.to_h if
FeatureToggle.enabled?(:mst_identification) || FeatureToggle.enabled?(:pact_identification)
FeatureToggle.enabled?(:mst_identification)

Constants.TASK_ACTIONS.REVIEW_AMA_DECISION_SP_ISSUES.to_h
end
Expand Down
3 changes: 2 additions & 1 deletion app/services/deprecation_warnings/disallowed_deprecations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ class ::DisallowedDeprecationError < StandardError; end
/ActionView::Base instances should be constructed with a lookup context, assignments, and a controller./,
/ActionView::Base instances must implement `compiled_method_container`/,
/render file: should be given the absolute path to a file/,
/`ActiveRecord::Result#to_hash` has been renamed to `to_a`/
/`ActiveRecord::Result#to_hash` has been renamed to `to_a`/,
/Class level methods will no longer inherit scoping/
].freeze

# Regular expressions for deprecation warnings that should raise an exception on detection
Expand Down
4 changes: 1 addition & 3 deletions app/services/deprecation_warnings/production_handler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,7 @@ def emit_warning_to_sentry(message, callstack, deprecation_horizon, gem_name)
def emit_warning_to_slack_alerts_channel(message)
slack_alert_title = "Deprecation Warning - #{APP_NAME} (#{ENV['DEPLOY_ENV']})"

SlackService
.new(url: ENV["SLACK_DISPATCH_ALERT_URL"])
.send_notification(message, slack_alert_title, SLACK_ALERT_CHANNEL)
SlackService.new.send_notification(message, slack_alert_title, SLACK_ALERT_CHANNEL)
end
end
end
Expand Down
7 changes: 1 addition & 6 deletions app/services/etl/syncer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,8 @@ def initialize(since: nil, etl_build:, id_offset: 0)
@id_offset = id_offset
end

# :reek:UtilityFunction
def slack_url
ENV["SLACK_DISPATCH_ALERT_URL"]
end

def slack_service
@slack_service ||= SlackService.new(url: slack_url)
@slack_service ||= SlackService.new
end

# :reek:FeatureEnvy
Expand Down
2 changes: 1 addition & 1 deletion app/services/slack_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class SlackService
warn: "#ffff00"
}.freeze

def initialize(url:)
def initialize(url: ENV["SLACK_DISPATCH_ALERT_URL"])
@url = url
end

Expand Down
Loading
Loading