index int64 0 0 | repo_id stringclasses 829
values | file_path stringlengths 34 254 | content stringlengths 6 5.38M |
|---|---|---|---|
0 | code_files | code_files/vets-api-private/.yardopts | --title "Vets API"
--protected
--private
--verbose
--no-cache
--no-save
--output-dir .yardoc/output
--exclude /spec/
--exclude /swagger/
--exclude /db\/migrate/
--readme README.md
--files CONTRIBUTING.md,LICENSE.md,SECURITY.md
|
0 | code_files | code_files/vets-api-private/LICENSE.md | As a work of the United States Government, this project is in the
public domain within the United States.
Additionally, we waive copyright and related rights in the work
worldwide through the CC0 1.0 Universal public domain dedication.
## CC0 1.0 Universal Summary
This is a human-readable summary of the [Legal Code ... |
0 | code_files | code_files/vets-api-private/.rubocop_todo.yml | # This configuration was generated by
# `rubocop --auto-gen-config --exclude-limit 100`
# on 2024-09-12 18:15:53 UTC using RuboCop version 1.66.1.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or ... |
0 | code_files | code_files/vets-api-private/Guardfile | # frozen_string_literal: true
guard :rspec, cmd: 'DISABLE_SPRING=y NOCOVERAGE=y bin/rspec' do
require 'guard/rspec/dsl'
dsl = Guard::RSpec::Dsl.new(self)
watch(dsl.rspec.spec_helper) { dsl.rspec.spec_dir }
watch(dsl.rspec.spec_support) { dsl.rspec.spec_dir }
watch(dsl.rspec.spec_files)
dsl.watch_spec_fil... |
0 | code_files | code_files/vets-api-private/.rubocop_explicit_enables.yml | Capybara/NegationMatcher: # new in 2.14
Enabled: true
Capybara/SpecificActions: # new in 2.14
Enabled: true
Capybara/SpecificFinders: # new in 2.13
Enabled: true
Capybara/SpecificMatcher: # new in 2.12
Enabled: true
Gemspec/DeprecatedAttributeAssignment: # new in 1.30
Enabled: true
Gemspec/RequireMFA: # new i... |
0 | code_files | code_files/vets-api-private/.rspec | --color
--require spec_helper
--format progress
<% if ENV['CI'] %>
--format RspecJunitFormatter
--out log/rspec.xml
<% end %>
|
0 | code_files | code_files/vets-api-private/docker-compose-deps.yml | services:
redis:
image: redis:6.2-alpine
ports:
- "63790:6379"
postgres:
command: postgres -c shared_preload_libraries=pg_stat_statements -c pg_stat_statements.track=all -c max_connections=200
image: postgis/postgis:14-3.3-alpine
environment:
POSTGRES_PASSWORD: "${POSTGRES_PASSWORD:-... |
0 | code_files | code_files/vets-api-private/.ruby-version | 3.3.6
|
0 | code_files | code_files/vets-api-private/mkdocs.yaml | site_name: "Vets API"
site_description: "Documentation for Vets API deployment, setup, and history."
repo_url: https://github.com/department-of-veterans-affairs/vets-api
edit_uri: edit/master/docs/
nav:
- Deployment:
- Information: "deployment/information.md"
- Setup:
- Betamocks: "setup/betamocks.md"
... |
0 | code_files | code_files/vets-api-private/Dockerfile | FROM public.ecr.aws/docker/library/ruby:3.3.6-slim-bookworm AS rubyimg
FROM rubyimg AS modules
WORKDIR /tmp
# Copy each module's Gemfile, gemspec, and version.rb files
COPY modules/ modules/
RUN find modules -type f ! \( -name Gemfile -o -name "*.gemspec" -o -path "*/lib/*/version.rb" \) -delete && \
find modules... |
0 | code_files | code_files/vets-api-private/Makefile | $stdout.sync = true
export VETS_API_USER_ID := $(shell id -u)
ifdef env
ENV_ARG := $(env)
else
ENV_ARG := dev
endif
ifdef clam
FOREMAN_ARG := all=1
else
FOREMAN_ARG := all=1,clamd=0,freshclam=0
endif
COMPOSE_DEV := docker-compose
COMPOSE_TEST := docker-compose -f docker-compose.test.yml
BASH :=... |
0 | code_files | code_files/vets-api-private/.irbrc | # Disable autocomplete in deployed environments
# to help prevent running unintended commands
if ENV['RAILS_ENV'] == 'production'
IRB.conf[:USE_AUTOCOMPLETE] = false
end
|
0 | code_files | code_files/vets-api-private/config.ru | # frozen_string_literal: true
# This file is used by Rack-based servers to start the application.
require_relative 'config/environment'
require 'datadog/profiling/preload'
run Rails.application
Rails.application.load_server
|
0 | code_files | code_files/vets-api-private/docker-compose-clamav.yml | version: '3.4'
services:
clamav:
volumes:
- shared-vol:/vets-api
image: clamav/clamav
ports:
- 33100:3310
volumes:
shared-vol:
|
0 | code_files | code_files/vets-api-private/README.md | # Vets API
This project provides common APIs for applications that live on VA.gov (formerly vets.gov APIs).
[](https://www.rubydoc.info/github/department-of-veterans-affairs/vets-api)
[.empty? ? `git rev-parse --abbrev-ref HEAD`.chomp.freeze : "origin/#{ENV.fetch('GITHUB_HEAD_REF')}"
BASE_SHA = ENV.fe... |
0 | code_files | code_files/vets-api-private/Gemfile | # frozen_string_literal: true
source 'https://rubygems.org'
ruby '~> 3.3.6'
# Modules
path 'modules' do
gem 'accredited_representative_portal'
gem 'appeals_api'
gem 'apps_api'
gem 'ask_va_api'
gem 'avs'
gem 'banners'
gem 'bpds'
gem 'burials'
gem 'check_in'
gem 'claims_api'
gem 'claims_evidence_... |
0 | code_files | code_files/vets-api-private/.rubocop.yml | inherit_from:
- .rubocop_explicit_enables.yml
- .rubocop_todo.yml
require:
- './lib/rubocop/cops/ams_serializer.rb'
plugins:
- rubocop-rails
- rubocop-rspec
- rubocop-capybara
- rubocop-factory_bot
- rubocop-rspec_rails
- rubocop-thread_safety
AllCops:
NewCops: disable
TargetRailsVersion: 6.1
... |
0 | code_files | code_files/vets-api-private/Gemfile.lock | GIT
remote: https://github.com/adhocteam/connect_vbms
revision: 2284b8e9a68d2b44dda52a098ffc83f8fa283211
tag: v2.1.1
specs:
connect_vbms (2.1.1)
httpclient (~> 2.8.0)
httpi (~> 4.0)
mail
nokogiri (>= 1.8.4)
nori
xmldsig (~> 0.3.1)
xmlenc
GIT
remote: https://githu... |
0 | code_files | code_files/vets-api-private/docker-compose.yml | version: '3.8'
x-app: &common
build:
args:
BUNDLE_ENTERPRISE__CONTRIBSYS__COM: "${BUNDLE_ENTERPRISE__CONTRIBSYS__COM}"
context: .
environment:
BUNDLE_ENTERPRISE__CONTRIBSYS__COM: "${BUNDLE_ENTERPRISE__CONTRIBSYS__COM}"
SETTINGS__DATABASE_URL: "postgis://${POSTGRES_USER:-postgres}:${POSTGRES_P... |
0 | code_files | code_files/vets-api-private/docker-compose.test.yml | version: '3.4'
services:
redis:
image: ${ECR_REGISTRY_WITH_SLASH}redis:6.2-alpine
postgres:
image: ${ECR_REGISTRY_WITH_SLASH}postgis/postgis:14-3.3-alpine
command: postgres -c shared_preload_libraries=pg_stat_statements -c pg_stat_statements.track=all -c max_connections=200
environment:
POSTGR... |
0 | code_files | code_files/vets-api-private/Brewfile | brew 'clamav' # anti-virus scanner
brew 'coreutils' # gnu coreutils
brew 'docker-compose'
brew 'imagemagick@6'
brew 'memcached'
brew 'poppler' # pdf rendering
brew 'redis'
brew 'gs'
# Note: Installing psql@14 may be difficult to complete using Homebrew. See
# docs/setup/native.md#OSX for more information. Included her... |
0 | code_files | code_files/vets-api-private/Procfile | web: bundle exec puma -p 3000 -C ./config/puma.rb
job: bundle exec sidekiq -q critical,4 -q tasker,3 -q default,2 -q low,1
|
0 | code_files | code_files/vets-api-private/SECURITY.md | # Security Policy
The Department of Veterans Affairs participates in a Responsible Vulnerability
Disclosure Program through Bugcrowd. Please report any security-related issues
using our [Bugcrowd program](https://bugcrowd.com/va-vdp).
If your Bugcrowd submission is related to an open GH issue, please include that
iss... |
0 | code_files | code_files/vets-api-private/.rspec_parallel | --color
--require spec_helper
--format documentation
<% if ENV['CI'] %>
--format RspecJunitFormatter
--out log/rspec<%= ENV['TEST_ENV_NUMBER'] %>.xml
<% end %>
|
0 | code_files | code_files/vets-api-private/catalog-info.yaml | apiVersion: backstage.io/v1alpha1
kind: System
metadata:
title: Veterans API
name: vets-api
description: This project provides common APIs for applications that live on VA.gov (formerly vets.gov APIs).
annotations:
github.com/project-slug: department-of-veterans-affairs/vets-api
# project slug for the V... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/uploaders/reencode_images.rb | # frozen_string_literal: true
module ReencodeImages
extend ActiveSupport::Concern
include CarrierWave::MiniMagick
included do
process :reencode
end
def reencode
unless file.content_type == 'application/pdf'
manipulate! do |img|
img.strip
img.format(img.type)
img
... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/uploaders/evss_claim_document_uploader_base.rb | # frozen_string_literal: true
class EVSSClaimDocumentUploaderBase < CarrierWave::Uploader::Base
include SetAWSConfig
include ValidatePdf
include CarrierWave::MiniMagick
include ConvertFileType
version :converted, if: :tiff_or_incorrect_extension? do
process(convert: :jpg, if: :tiff?)
def full_filena... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/uploaders/lighthouse_document_uploader_base.rb | # frozen_string_literal: true
class LighthouseDocumentUploaderBase < CarrierWave::Uploader::Base
include SetAWSConfig
include ValidatePdf
include CarrierWave::MiniMagick
include ConvertFileType
include UploaderVirusScan
version :converted, if: :tiff_or_incorrect_extension? do
process(convert: :jpg, if... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/uploaders/validate_pdf.rb | # frozen_string_literal: true
require 'pdf_info'
module ValidatePdf
extend ActiveSupport::Concern
included do
before :store, :validate_pdf
end
def validate(temp_file)
metadata = PdfInfo::Metadata.read(temp_file)
if metadata.encrypted?
raise Common::Exceptions::UnprocessableEntity.new(detai... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/uploaders/convert_file_type.rb | # frozen_string_literal: true
module ConvertFileType
extend ActiveSupport::Concern
class_methods do
def tiff?(mimemagic_object: nil, carrier_wave_sanitized_file: nil)
return mimemagic_object.type == 'image/tiff' if mimemagic_object
carrier_wave_sanitized_file&.content_type == 'image/tiff'
end... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/uploaders/supporting_evidence_attachment_uploader.rb | # frozen_string_literal: true
# Files uploaded as part of a form526 submission that will be sent to EVSS upon form submission.
class SupportingEvidenceAttachmentUploader < EVSSClaimDocumentUploaderBase
before :store, :log_transaction_start
after :store, :log_transaction_complete
def initialize(guid, _unused = n... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/uploaders/log_metrics.rb | # frozen_string_literal: true
module LogMetrics
extend ActiveSupport::Concern
KEY_PREFIX = 'api.upload.'
included do
after(:store, :log_metrics)
end
def log_metrics(file)
class_name = self.class.to_s.gsub('::', '_').underscore
class_prefix = "#{KEY_PREFIX}#{class_name}"
args = [
"#{... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/uploaders/uploader_virus_scan.rb | # frozen_string_literal: true
require 'common/file_helpers'
require 'common/virus_scan'
module UploaderVirusScan
extend ActiveSupport::Concern
class VirusFoundError < StandardError
end
included do
before(:store, :validate_virus_free)
end
def validate_virus_free(file)
return unless Rails.env.pro... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/uploaders/evss_claim_document_uploader.rb | # frozen_string_literal: true
# Files that will be associated with a previously submitted claim, from the Claim Status tool
class EVSSClaimDocumentUploader < EVSSClaimDocumentUploaderBase
def initialize(user_uuid, ids)
# carrierwave allows only 2 arguments, which they will pass onto
# different versions by c... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/uploaders/async_processing.rb | # frozen_string_literal: true
module AsyncProcessing
extend ActiveSupport::Concern
included do
after(:store, :process_file)
end
def process_file(_file)
ProcessFileJob.perform_async(self.class::PROCESSING_CLASS.to_s, store_dir, filename)
end
end
|
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/uploaders/set_aws_config.rb | # frozen_string_literal: true
module SetAWSConfig
def set_aws_config(aws_access_key_id, aws_secret_access_key, region, bucket)
self.aws_credentials = {
access_key_id: aws_access_key_id,
secret_access_key: aws_secret_access_key,
region:
}
self.aws_acl = 'private'
self.aws_bucket = bu... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/uploaders/decision_review_evidence_attachment_uploader.rb | # frozen_string_literal: true
# Files uploaded as part of a Notice of Disagreement submission that will be sent to Lighthouse upon form submission.
class DecisionReviewEvidenceAttachmentUploader < CarrierWave::Uploader::Base
include SetAWSConfig
def size_range
(1.byte)...(100_000_000.bytes)
end
def exten... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/uploaders/preneed_attachment_uploader.rb | # frozen_string_literal: true
class PreneedAttachmentUploader < CarrierWave::Uploader::Base
include SetAWSConfig
include UploaderVirusScan
include CarrierWave::MiniMagick
def size_range
(1.byte)...(25.megabytes)
end
process(convert: 'pdf', if: :not_pdf?)
def initialize(guid)
super
@guid = ... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/uploaders/lighthouse_document_uploader.rb | # frozen_string_literal: true
# Files that will be associated with a previously submitted claim, from the Claim Status tool
class LighthouseDocumentUploader < LighthouseDocumentUploaderBase
def initialize(icn, ids)
# carrierwave allows only 2 arguments, which they will pass onto
# different versions by calli... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/uploaders/hca_attachment_uploader.rb | # frozen_string_literal: true
class HCAAttachmentUploader < CarrierWave::Uploader::Base
include SetAWSConfig
include UploaderVirusScan
include CarrierWave::MiniMagick
def size_range
(1.byte)...(10.megabytes)
end
process(convert: 'jpg', if: :png?)
process(convert: 'jpg', if: :heic?)
def initializ... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/uploaders/vets_shrine.rb | # frozen_string_literal: true
require 'shrine/plugins/storage_from_config'
require 'shrine/plugins/validate_virus_free'
class VetsShrine < Shrine
plugin :validation_helpers
plugin :metadata_attributes
plugin :rack_file
plugin :validate_virus_free
end
|
0 | code_files/vets-api-private/app/uploaders | code_files/vets-api-private/app/uploaders/form_upload/uploader.rb | # frozen_string_literal: true
require 'shrine/plugins/validate_unlocked_pdf'
require 'shrine/plugins/validate_pdf_page_count'
require 'shrine/plugins/validate_correct_form'
class FormUpload::Uploader < VetsShrine
plugin :storage_from_config, settings: Settings.shrine.claims
plugin :activerecord, callbacks: false
... |
0 | code_files/vets-api-private/app/uploaders/simple_forms_api | code_files/vets-api-private/app/uploaders/simple_forms_api/form_remediation/uploader.rb | # frozen_string_literal: true
require 'simple_forms_api/form_remediation/configuration/base'
module SimpleFormsApi
module FormRemediation
class Uploader < CarrierWave::Uploader::Base
include UploaderVirusScan
def initialize(directory:, config:)
raise 'The S3 directory is missing.' if direct... |
0 | code_files/vets-api-private/app/uploaders | code_files/vets-api-private/app/uploaders/claim_documentation/uploader.rb | # frozen_string_literal: true
require 'shrine/plugins/validate_unlocked_pdf'
# Shrine logic for claim evidence uploads, optimistically named so
# that they cover any sort of claim documentation in a sane way.
class ClaimDocumentation::Uploader < VetsShrine
plugin :storage_from_config, settings: Settings.shrine.cla... |
0 | code_files/vets-api-private/app/uploaders | code_files/vets-api-private/app/uploaders/form1010cg/poa_uploader.rb | # frozen_string_literal: true
module Form1010cg
class PoaUploader < CarrierWave::Uploader::Base
include SetAWSConfig
include LogMetrics
include UploaderVirusScan
storage :aws
attr_reader :store_dir
def initialize(form_attachment_guid)
super
set_aws_config(
Settings.for... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/sidekiq/form0781_state_snapshot_job.rb | # frozen_string_literal: true
# Log information about Form 0781 submissions to populate an admin facing Datadog dashboard
class Form0781StateSnapshotJob
include Sidekiq::Job
sidekiq_options retry: false
STATSD_PREFIX = 'form526.form0781.state.snapshot'
def perform
if Flipper.enabled?(:disability_compensa... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/sidekiq/form526_confirmation_email_job.rb | # frozen_string_literal: true
require 'va_notify/service'
class Form526ConfirmationEmailJob
include Sidekiq::Job
sidekiq_options expires_in: 1.day
STATSD_ERROR_NAME = 'worker.form526_confirmation_email.error'
STATSD_SUCCESS_NAME = 'worker.form526_confirmation_email.success'
def perform(personalization_par... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/sidekiq/process_file_job.rb | # frozen_string_literal: true
class ProcessFileJob
include Sidekiq::Job
def perform(processing_class, store_dir, filename)
uploader = processing_class.constantize.new(store_dir, filename)
uploader.retrieve_from_store!(filename)
old_file = uploader.file
uploader.store!(old_file)
old_file.delete... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/sidekiq/external_services_status_job.rb | # frozen_string_literal: true
class ExternalServicesStatusJob
include Sidekiq::Job
sidekiq_options(retry: false)
def perform
ExternalServicesRedis::Status.new.fetch_or_cache
end
end
|
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/sidekiq/form526_status_polling_job.rb | # frozen_string_literal: true
require 'benefits_intake_service/service'
class Form526StatusPollingJob
include Sidekiq::Job
sidekiq_options retry: false
STATS_KEY = 'api.benefits_intake.submission_status'
MAX_BATCH_SIZE = 1000
attr_reader :max_batch_size
def initialize(max_batch_size: MAX_BATCH_SIZE)
... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/sidekiq/form526_paranoid_success_polling_job.rb | # frozen_string_literal: true
require 'benefits_intake_service/service'
class Form526ParanoidSuccessPollingJob
include Sidekiq::Job
sidekiq_options retry: false
MAX_BATCH_SIZE = 1000
attr_reader :max_batch_size, :change_totals, :total_checked
def initialize(max_batch_size: MAX_BATCH_SIZE)
@max_batch_s... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/sidekiq/user_actions_cleanup_job.rb | # frozen_string_literal: true
class UserActionsCleanupJob
include Sidekiq::Job
sidekiq_options unique_for: 30.minutes, retry: false
EXPIRATION_TIME = 1.year
def perform
UserAction.where(created_at: ...EXPIRATION_TIME.ago).delete_all
end
end
|
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/sidekiq/va_notify_email_job.rb | # frozen_string_literal: true
require 'vets/shared_logging'
###########################################################################################
# This class is deprecated in favor of modules/va_notify/app/sidekiq/va_notify/email_job.rb
# Use that one instead.
##################################################... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/sidekiq/feature_cleaner_job.rb | # frozen_string_literal: true
class FeatureCleanerJob
include Sidekiq::Job
def perform
Rails.logger.info "FeatureCleanerJob Removing: #{removed_features.join(', ')}"
# removed_features.each do |feature|
# Flipper.remove(feature)
# end
end
private
def removed_features
@removed_feature... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/sidekiq/benefits_intake_remediation_status_job.rb | # frozen_string_literal: true
require 'lighthouse/benefits_intake/service'
# Reporting job for Lighthouse Benefit Intake Failures
# @see https://vagov.ddog-gov.com/dashboard/8zk-ja2-xvm/benefits-intake-submission-remediation-report
class BenefitsIntakeRemediationStatusJob
include Sidekiq::Job
sidekiq_options ret... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/sidekiq/export_breaker_status.rb | # frozen_string_literal: true
class ExportBreakerStatus
include Sidekiq::Job
def perform
Breakers.client.services.each do |service|
# trying to avoid double-negative with open/closed here, up of 1 is "closed" or "up"
up = service.latest_outage && !service.latest_outage.ended? ? 0 : 1
StatsD.... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/sidekiq/load_average_days_for_claim_completion_job.rb | # frozen_string_literal: true
class LoadAverageDaysForClaimCompletionJob
include Sidekiq::Job
# this will go away once the file publishing is setup.
def connection
@conn ||= Faraday.new('https://www.va.gov/') do |faraday|
faraday.use :breakers
faraday.use Faraday::Response::RaiseError
... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/sidekiq/form526_submitted_email_job.rb | # frozen_string_literal: true
require 'va_notify/service'
class Form526SubmittedEmailJob
include Sidekiq::Job
sidekiq_options expires_in: 1.day
STATSD_ERROR_NAME = 'worker.form526_submitted_email.error'
STATSD_SUCCESS_NAME = 'worker.form526_submitted_email.success'
def perform(personalization_parameters)
... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/sidekiq/form526_submission_processing_report_job.rb | # frozen_string_literal: true
# Log information about Form526Submission state to populate an admin facing Datadog dashboard
class Form526SubmissionProcessingReportJob
include Sidekiq::Job
sidekiq_options retry: false
attr_reader :start_date, :end_date
END_DATE = Time.zone.today.beginning_of_day
START_DATE ... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/sidekiq/va_notify_dd_email_job.rb | # frozen_string_literal: true
class VANotifyDdEmailJob
include Sidekiq::Job
# retry for 2d 1h 47m 12s
# https://github.com/sidekiq/sidekiq/wiki/Error-Handling
sidekiq_options retry: 16
STATSD_ERROR_NAME = 'worker.direct_deposit_confirmation_email.error'
STATSD_SUCCESS_NAME = 'worker.direct_deposit_confir... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/sidekiq/transactional_email_analytics_job.rb | # frozen_string_literal: true
class TransactionalEmailAnalyticsJob
include Sidekiq::Job
sidekiq_options(unique_for: 30.minutes, retry: false)
def initialize
unless FeatureFlipper.send_email?
raise Common::Exceptions::ParameterMissing.new(
'GovDelivery token or server',
detail: 'It sho... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/sidekiq/in_progress_form_cleaner.rb | # frozen_string_literal: true
class InProgressFormCleaner
include Sidekiq::Job
def perform
forms = InProgressForm.where('expires_at < ?', Time.now.utc)
form_counts = forms.group(:form_id).count
form_counts.each do |form_id, count|
if count.positive?
StatsD.increment("worker.in_progress_... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/sidekiq/email_verification_job.rb | # frozen_string_literal: true
require 'sidekiq/attr_package'
class EmailVerificationJob
include Sidekiq::Job
include Vets::SharedLogging
sidekiq_options retry: 5 # exponential backoff, retries for ~17 mins
STATS_KEY = 'api.vanotify.email_verification'
sidekiq_retries_exhausted do |msg, _ex|
job_id = m... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/sidekiq/delete_in_progress_form_job.rb | # frozen_string_literal: true
class DeleteInProgressFormJob
include Sidekiq::Job
sidekiq_options retry: 5
def perform(form_id, user_uuid)
return unless user_uuid
InProgressForm.find_by(form_id:, user_uuid:)&.destroy
end
end
|
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/sidekiq/form526_submission_failed_email_job.rb | # frozen_string_literal: true
require 'va_notify/service'
class Form526SubmissionFailedEmailJob
include Sidekiq::Job
sidekiq_options expires_in: 1.day
STATSD_ERROR_NAME = 'worker.form526_submission_failed_email.error'
STATSD_SUCCESS_NAME = 'worker.form526_submission_failed_email.success'
def perform(perso... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/sidekiq/form_pdf_change_detection_job.rb | # frozen_string_literal: true
require 'forms/client'
# FormPdfChangeDetectionJob
#
# This Sidekiq job monitors VA form PDF revisions by comparing current SHA256 checksums
# against cached values to detect when forms have been updated.
#
# Why:
# - Enables automated tracking of form revisions for compliance and versio... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/sidekiq/delete_old_pii_logs_job.rb | # frozen_string_literal: true
class DeleteOldPiiLogsJob
include Sidekiq::Job
sidekiq_options unique_for: 30.minutes, retry: false
EXPIRATION_TIME = 2.weeks
BATCH_SIZE = 10_000
def perform
loop do
records = PersonalInformationLog.where('created_at < ?', EXPIRATION_TIME.ago).limit(BATCH_SIZE)
... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/sidekiq/gi_bill_feedback_submission_job.rb | # frozen_string_literal: true
require 'gibft/service'
class GIBillFeedbackSubmissionJob
include Sidekiq::Job
sidekiq_options retry: false
def perform(feedback_id, form, user_uuid)
@feedback_id = feedback_id
gi_bill_feedback.form = form
gi_bill_feedback.user = User.find(user_uuid) if user_uuid.pres... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/sidekiq/delete_old_transactions_job.rb | # frozen_string_literal: true
require 'vets/shared_logging'
class DeleteOldTransactionsJob
include Sidekiq::Job
include Vets::SharedLogging
# :nocov:
def perform
AsyncTransaction::Base
.stale
.find_each do |tx|
tx.destroy!
rescue ActiveRecord::RecordNotDestroyed => e
log_mes... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/sidekiq/form526_failure_state_snapshot_job.rb | # frozen_string_literal: true
# Log information about Form526Submission state to populate an admin facing Datadog dashboard
class Form526FailureStateSnapshotJob
include Sidekiq::Job
sidekiq_options retry: false
STATSD_PREFIX = 'form526.state.snapshot'
def perform
write_failure_snapshot
rescue => e
... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/sidekiq/benefits_intake_status_job.rb | # frozen_string_literal: true
require 'lighthouse/benefits_intake/service'
require 'lighthouse/benefits_intake/sidekiq/submission_status_job'
require 'pcpg/monitor'
require 'dependents/monitor'
require 'vre/monitor'
# Datadog Dashboard:
# https://vagov.ddog-gov.com/dashboard/4d8-3fn-dbp/benefits-intake-form-submissio... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/sidekiq/delete_attachment_job.rb | # frozen_string_literal: true
class DeleteAttachmentJob
include Sidekiq::Job
sidekiq_options(unique_for: 30.minutes, retry: false)
EXPIRATION_TIME = 2.months
def perform
FormAttachment.where(
'created_at < ?', self.class::EXPIRATION_TIME.ago
).where(
type: self.class::ATTACHMENT_CLASSES
... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/sidekiq/form526_submission_failure_email_job.rb | # frozen_string_literal: true
require 'va_notify/service'
class Form526SubmissionFailureEmailJob
include Sidekiq::Job
attr_accessor :submission
STATSD_PREFIX = 'api.form_526.veteran_notifications.form526_submission_failure_email'
# https://github.com/department-of-veterans-affairs/va.gov-team-sensitive/blob... |
0 | code_files/vets-api-private/app/sidekiq | code_files/vets-api-private/app/sidekiq/copay_notifications/parse_new_statements_job.rb | # frozen_string_literal: true
module CopayNotifications
class ParseNewStatementsJob
include Sidekiq::Job
sidekiq_options retry: false
# time (in seconds) between scheduling batch of jobs
JOB_INTERVAL = Settings.mcp.notifications.job_interval
# number of jobs to perform at next interval
BATC... |
0 | code_files/vets-api-private/app/sidekiq | code_files/vets-api-private/app/sidekiq/copay_notifications/new_statement_notification_job.rb | # frozen_string_literal: true
require 'debt_management_center/statement_identifier_service'
require 'debt_management_center/sidekiq/va_notify_email_job'
require 'vets/shared_logging'
module CopayNotifications
class Vet360IdNotFound < StandardError
def initialize(icn)
message = "MPIProfileMissingVet360Id: ... |
0 | code_files/vets-api-private/app/sidekiq | code_files/vets-api-private/app/sidekiq/kms_key_rotation/batch_initiator_job.rb | # frozen_string_literal: true
module KmsKeyRotation
class BatchInitiatorJob
include Sidekiq::Worker
sidekiq_options retry: false, queue: :low
MAX_RECORDS_PER_BATCH = 15_000_000
MAX_RECORDS_PER_JOB = 100
MODELS_FOR_QUERY = {
'ClaimsApi::V2::AutoEstablishedClaim' => ClaimsApi::AutoEstablis... |
0 | code_files/vets-api-private/app/sidekiq | code_files/vets-api-private/app/sidekiq/kms_key_rotation/rotate_keys_job.rb | # frozen_string_literal: true
module KmsKeyRotation
class RotateKeysJob
include Sidekiq::Worker
sidekiq_options retry: false, queue: :low
def perform(gids)
Rails.logger.info { "Re-encrypting records: #{gids.join ', '}" }
records = GlobalID::Locator.locate_many gids
records.each do |r... |
0 | code_files/vets-api-private/app/sidekiq | code_files/vets-api-private/app/sidekiq/hca/log_email_diff_job.rb | # frozen_string_literal: true
# LogEmailDiffJob
#
# This Sidekiq job logs whether the email address in an in-progress form matches the user's VA Profile email.
#
# Why:
# - Tracks discrepancies between user-provided emails and VA Profile emails for analytics and troubleshooting.
# - Helps identify cases where users ma... |
0 | code_files/vets-api-private/app/sidekiq | code_files/vets-api-private/app/sidekiq/hca/std_institution_import_job.rb | # frozen_string_literal: true
# StdInstitutionImportJob
#
# This Sidekiq job imports and synchronizes standard institution facility data from a remote CSV source.
#
# Why:
# - Keeps the StdInstitutionFacility table up-to-date with authoritative data.
# - Ensures downstream processes and user features have current inst... |
0 | code_files/vets-api-private/app/sidekiq | code_files/vets-api-private/app/sidekiq/hca/submission_job.rb | # frozen_string_literal: true
# SubmissionJob
#
# This Sidekiq job handles the submission of 10-10EZ health care applications to the HCA backend service.
#
# Why:
# - Automates the process of submitting user health care applications asynchronously.
# - Handles retries and error logging for robust, reliable processing.... |
0 | code_files/vets-api-private/app/sidekiq | code_files/vets-api-private/app/sidekiq/hca/health_facilities_import_job.rb | # frozen_string_literal: true
# HealthFacilitiesImportJob
#
# This Sidekiq job imports and synchronizes VA health facility data from the Lighthouse API
# into the HealthFacility table. It ensures that the local database reflects the current
# set of health facilities, including removing facilities that no longer exis... |
0 | code_files/vets-api-private/app/sidekiq | code_files/vets-api-private/app/sidekiq/hca/ezr_submission_job.rb | # frozen_string_literal: true
# EzrSubmissionJob
#
# This Sidekiq job handles the submission of 10-10EZR (health care renewal) forms to the backend service.
#
# Why:
# - Automates and manages the asynchronous submission of renewal forms.
# - Handles retries, error logging, and user notification on failure.
#
# How:
# ... |
0 | code_files/vets-api-private/app/sidekiq | code_files/vets-api-private/app/sidekiq/identity/cerner_provisioner_job.rb | # frozen_string_literal: true
module Identity
class CernerProvisionerJob
include Sidekiq::Job
sidekiq_options retry: false, unique_for: 5.minutes
def perform(icn, source = nil)
CernerProvisioner.new(icn:, source:).perform
rescue Errors::CernerProvisionerError => e
Rails.logger.error('[I... |
0 | code_files/vets-api-private/app/sidekiq | code_files/vets-api-private/app/sidekiq/identity/user_acceptable_verified_credential_totals_job.rb | # frozen_string_literal: true
module Identity
class UserAcceptableVerifiedCredentialTotalsJob
include Sidekiq::Job
STATSD_KEY_PREFIX = 'worker.user_avc_totals'
SCOPES = [WITH_AVC = :with_avc,
WITH_IVC = :with_ivc,
WITHOUT_AVC = :without_avc,
WITHOUT_IVC = :with... |
0 | code_files/vets-api-private/app/sidekiq | code_files/vets-api-private/app/sidekiq/identity/get_ssoe_traits_by_cspid_job.rb | # frozen_string_literal: true
module Identity
class GetSSOeTraitsByCspidJob
include Sidekiq::Job
STATSD_KEY_PREFIX = 'worker.get_ssoe_traits_by_cspid'
sidekiq_options retry: 3, queue: :default
def perform(cache_key, credential_method, credential_id)
attributes = Sidekiq::AttrPackage.find(cac... |
0 | code_files/vets-api-private/app/sidekiq | code_files/vets-api-private/app/sidekiq/vre/submit1900_job.rb | # frozen_string_literal: true
require 'vets/shared_logging'
require 'vre/monitor'
module VRE
class Submit1900Job
include Sidekiq::Job
include Vets::SharedLogging
STATSD_KEY_PREFIX = 'worker.vre.submit_1900_job'
# retry for 2d 1h 47m 12s
# https://github.com/sidekiq/sidekiq/wiki/Error-Handling
... |
0 | code_files/vets-api-private/app/sidekiq | code_files/vets-api-private/app/sidekiq/sign_in/certificate_checker_job.rb | # frozen_string_literal: true
class SignIn::CertificateCheckerJob
include Sidekiq::Job
LOGGER_PREFIX = '[SignIn] [CertificateChecker]'
CONFIG_CLASSES = [
SignIn::ClientConfig,
SignIn::ServiceAccountConfig
].freeze
def perform
CONFIG_CLASSES.each do |config_class|
config_class.find_each { ... |
0 | code_files/vets-api-private/app/sidekiq | code_files/vets-api-private/app/sidekiq/sign_in/delete_expired_sessions_job.rb | # frozen_string_literal: true
module SignIn
class DeleteExpiredSessionsJob
include Sidekiq::Job
def perform
expired_oauth_sessions.destroy_all
end
private
def time_in_past
...Time.zone.now
end
def expired_oauth_sessions
OAuthSession.where(refresh_expiration: time_in_... |
0 | code_files/vets-api-private/app/sidekiq | code_files/vets-api-private/app/sidekiq/bgs/submit_form674_v2_job.rb | # frozen_string_literal: true
require 'bgsv2/form674'
require 'dependents/monitor'
require 'vets/shared_logging'
module BGS
class SubmitForm674V2Job < Job
class Invalid674Claim < StandardError; end
FORM_ID = '686C-674-V2'
include Sidekiq::Job
include Vets::SharedLogging
attr_reader :claim, :use... |
0 | code_files/vets-api-private/app/sidekiq | code_files/vets-api-private/app/sidekiq/bgs/flash_updater.rb | # frozen_string_literal: true
require 'logging/third_party_transaction'
require 'bgs/monitor'
module BGS
class FlashUpdater
include Sidekiq::Job
extend Logging::ThirdPartyTransaction::MethodWrapper
attr_accessor :submission_id
# Sidekiq has built in exponential back-off functionality for retries
... |
0 | code_files/vets-api-private/app/sidekiq | code_files/vets-api-private/app/sidekiq/bgs/submit_form686c_v2_job.rb | # frozen_string_literal: true
require 'bgsv2/form686c'
require 'dependents/monitor'
require 'vets/shared_logging'
module BGS
class SubmitForm686cV2Job < Job
class Invalid686cClaim < StandardError; end
FORM_ID = '686C-674-V2'
include Sidekiq::Job
include Vets::SharedLogging
attr_reader :claim, :... |
0 | code_files/vets-api-private/app/sidekiq | code_files/vets-api-private/app/sidekiq/bgs/submit_form674_job.rb | # frozen_string_literal: true
require 'bgs/form674'
require 'dependents/monitor'
require 'vets/shared_logging'
module BGS
class SubmitForm674Job < Job
class Invalid674Claim < StandardError; end
FORM_ID = '686C-674'
include Sidekiq::Job
include Vets::SharedLogging
attr_reader :claim, :user, :use... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.