Merge branch 'master' into fix-statistics

This commit is contained in:
Sergei Tsõganov 2022-12-13 11:42:27 +02:00 committed by GitHub
commit 6c37490694
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 44 additions and 13 deletions

View file

@ -6,7 +6,7 @@ jobs:
test:
services:
postgres:
image: postgres:14
image: postgres:15
ports: ["5432:5432"]
env:
POSTGRES_PASSWORD: password

View file

@ -1,5 +1,6 @@
07.12.2022
* return contact detaisl with authinfo pw of linked domain https://github.com/internetee/registry/issues/2492
* fixed disputed status removal https://github.com/internetee/registry/issues/2503
06.12.2022
* save status notes to domain history https://github.com/internetee/registry/issues/2484

View file

@ -16,11 +16,11 @@ gem 'uglifier'
gem 'figaro', '~> 1.2'
# model related
gem 'paper_trail', '~> 13.0'
gem 'paper_trail', '~> 14.0'
gem 'pg', '1.4.5'
# 1.8 is for Rails < 5.0
gem 'ransack', '~> 2.6.0'
gem 'truemail', '~> 2.4' # validates email by regexp, mail server existence and address existence
gem 'truemail', '~> 3.0' # validates email by regexp, mail server existence and address existence
gem 'validates_email_format_of', '1.7.2' # validates email against RFC 2822 and RFC 3696
# 0.7.3 is the latest for Rails 4.2, however, it is absent on Rubygems server

View file

@ -331,10 +331,10 @@ GEM
newrelic_rpm (= 8.1.0)
newrelic_rpm (8.1.0)
nio4r (2.5.8)
nokogiri (1.13.9)
nokogiri (1.13.10)
mini_portile2 (~> 2.8.0)
racc (~> 1.4)
nokogiri (1.13.9-x86_64-linux)
nokogiri (1.13.10-x86_64-linux)
racc (~> 1.4)
nori (2.6.0)
omniauth (2.1.0)
@ -356,9 +356,9 @@ GEM
validate_url
webfinger (~> 1.2)
orm_adapter (0.5.0)
paper_trail (13.0.0)
activerecord (>= 5.2)
request_store (~> 1.1)
paper_trail (14.0.0)
activerecord (>= 6.0)
request_store (~> 1.4)
pdfkit (0.8.7.2)
pg (1.4.5)
pg_query (2.1.2)
@ -371,7 +371,7 @@ GEM
public_suffix (5.0.0)
puma (5.6.4)
nio4r (~> 2.0)
racc (1.6.0)
racc (1.6.1)
rack (2.2.4)
rack-oauth2 (1.21.3)
activesupport
@ -484,7 +484,7 @@ GEM
thor (1.2.1)
tilt (2.0.11)
timeout (0.3.0)
truemail (2.4.9)
truemail (3.0.3)
simpleidn (~> 0.2.1)
tzinfo (2.0.5)
concurrent-ruby (~> 1.0)
@ -492,7 +492,7 @@ GEM
execjs (>= 0.3.0, < 3)
unf (0.1.4)
unf_ext
unf_ext (0.0.7.7)
unf_ext (0.0.8.2)
validate_email (0.1.6)
activemodel (>= 3.0)
mail (>= 2.2.5)
@ -572,7 +572,7 @@ DEPENDENCIES
nokogiri (~> 1.13.0)
omniauth-rails_csrf_protection
omniauth-tara!
paper_trail (~> 13.0)
paper_trail (~> 14.0)
pdfkit
pg (= 1.4.5)
pg_query (>= 0.9.0)
@ -591,7 +591,7 @@ DEPENDENCIES
simpleidn (= 0.2.1)
spy
strong_migrations
truemail (~> 2.4)
truemail (~> 3.0)
uglifier
validates_email_format_of (= 1.7.2)
webdrivers

View file

@ -8,6 +8,7 @@ class DisputeStatusUpdateJob < ApplicationJob
close_disputes
activate_disputes
clean_disputed
@logger.info "DisputeStatusUpdateJob - All done. Closed #{@backlog['closed']} and " \
"activated #{@backlog['activated']} disputes."
@ -15,6 +16,13 @@ class DisputeStatusUpdateJob < ApplicationJob
show_failed_disputes unless @backlog['activate_fail'].empty? && @backlog['close_fail'].empty?
end
def clean_disputed
domains = Domain.where("array_to_string(statuses, '||') ILIKE ?", '%disputed%')
domains.each do |domain|
domain.unmark_as_disputed unless domain.disputed?
end
end
def close_disputes
disputes = if @include_closed
Dispute.where('expires_at < ?', Time.zone.today).all

View file

@ -73,4 +73,26 @@ class DisputeStatusUpdateJobTest < ActiveJob::TestCase
whois_record.reload
assert_not whois_record.json['status'].include? 'disputed'
end
def test_close_dispute_with_domains_with_dispute_status
travel_to Time.zone.parse('2010-07-05')
domain = domains(:shop)
domain.statuses << DomainStatus::DISPUTED
domain.save && domain.reload
dispute = disputes(:closed)
dispute.domain_name = domain.name
dispute.save && dispute.reload
assert domain.statuses.include? DomainStatus::DISPUTED
perform_enqueued_jobs do
DisputeStatusUpdateJob.perform_now
end
domain.reload
refute domain.statuses.include? DomainStatus::DISPUTED
end
end