qa_server 7.6.0 → 7.7.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 76e06f7b15b4f8041797890dd3e4f7c362d73e73a31808060361cbcf16b4fe46
4
- data.tar.gz: efbd4527118c03ea42c1075a69196fd4aa6696a524d2c675085a280aa0838d5d
3
+ metadata.gz: 57808d7b02e3ca992f1d927f43dd6630025451e6fb6c7cebab7ed2882acd79c9
4
+ data.tar.gz: 3ab76c0ebda5fd6e1ebe9811ff522bf0a7d13e0461b28a4b7a421ac5bdd66a18
5
5
  SHA512:
6
- metadata.gz: d22de7e60cfb453837013bc4b0ca6df756bfbc9f180ea9d27f28734a6822e3606dd32f73cd1fd8eb9fd563985ce706c9e18fb4055129fa3c17a6cc11f6955deb
7
- data.tar.gz: c334da18f0a702644149e7228ecfb2407234feb3fe3e663388429f5513e3ca1a3f39ba9f364ce48213b17907b7bb0a27b4dbd53eb21d157047c7b254eeb8bacb
6
+ metadata.gz: 77d4103d2ff49636bf353f8d5ca93019fb2f477c90ff62e9f94832d9d7f387ed3be3f1577692025863882c53bbc38ae2020a1435a6d84379e73d1bee4bb06714
7
+ data.tar.gz: b99e3284b1e690236f83e088fd78ece19e743a995ad65342da4d8b75022e962b96478222529132d1965521a7a57e5c01a0b38cd5bc68e05fd6e709ea6c334970
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ### 7.7.0 (2021-04-13)
2
+
3
+ * remove unused translations
4
+ * show notification when refreshing starts on monitor status page
5
+ * hide data in Authority Connection History for non-active authorities
6
+ * loosen threshold for caution in historical uptime table
7
+ * minor tweaks missed in original sync
8
+
1
9
  ### 7.6.0 (2021-04-12)
2
10
 
3
11
  * update authority configs and test scenarios to use the new cache indexing with results stored as blobs in the index
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
  # Controller for Monitor Status header menu item
3
3
  module QaServer
4
- class MonitorStatusController < ApplicationController
4
+ class MonitorStatusController < ApplicationController # rubocop:disable Metrics/ClassLength
5
5
  layout 'qa_server'
6
6
 
7
7
  include QaServer::AuthorityValidationBehavior
@@ -77,7 +77,8 @@ module QaServer
77
77
  end
78
78
 
79
79
  def refresh?
80
- params.key?(:refresh) && validate_auth_reload_token("refresh status")
80
+ return @refresh unless @refresh.nil?
81
+ @refresh ||= params.key?(:refresh) && validate_auth_reload_token("refresh status")
81
82
  end
82
83
 
83
84
  def refresh_all?
@@ -86,15 +87,36 @@ module QaServer
86
87
  end
87
88
 
88
89
  def refresh_tests?
89
- refresh? ? (refresh_all? || params[:refresh].casecmp?('tests')) : false
90
+ return @refresh_tests unless @refresh_tests.nil?
91
+ @refresh_tests = refresh? && (refresh_all? || params[:refresh].casecmp?('tests'))
92
+ if @refresh_tests
93
+ msg = I18n.t('qa_server.monitor_status.refreshing_tests')
94
+ logger.info msg
95
+ flash.now[:success] = msg
96
+ end
97
+ @refresh_tests
90
98
  end
91
99
 
92
100
  def refresh_history?
93
- refresh? ? (refresh_all? || params[:refresh].casecmp?('history')) : false
101
+ return @refresh_history unless @refresh_history.nil?
102
+ @refresh_history = refresh? && (refresh_all? || params[:refresh].casecmp?('history'))
103
+ if @refresh_history
104
+ msg = I18n.t('qa_server.monitor_status.refreshing_history')
105
+ logger.info msg
106
+ flash.now[:success] = msg
107
+ end
108
+ @refresh_history
94
109
  end
95
110
 
96
111
  def refresh_performance?
97
- refresh? ? (refresh_all? || params[:refresh].casecmp?('performance')) : false
112
+ return @refresh_performance unless @refresh_performance.nil?
113
+ @refresh_performance = refresh? && (refresh_all? || params[:refresh].casecmp?('performance'))
114
+ if @refresh_performance
115
+ msg = I18n.t('qa_server.monitor_status.refreshing_performance')
116
+ logger.info msg
117
+ flash.now[:success] = msg
118
+ end
119
+ @refresh_performance
98
120
  end
99
121
 
100
122
  def refresh_performance_table?
@@ -117,7 +139,7 @@ module QaServer
117
139
  token = params.key?(:auth_token) ? params[:auth_token] : nil
118
140
  valid = Qa.config.valid_authority_reload_token?(token)
119
141
  return true if valid
120
- msg = "Permission denied. Unable to #{action}."
142
+ msg = I18n.t('qa_server.monitor_status.permission_denied', action: action)
121
143
  logger.warn msg
122
144
  flash.now[:error] = msg
123
145
  false
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
  # Provide access to the scenario_run_history database table which tracks scenario runs over time.
3
3
  module QaServer
4
- class ScenarioRunHistory < ApplicationRecord
4
+ class ScenarioRunHistory < ApplicationRecord # rubocop:disable Metrics/ClassLength
5
5
  self.table_name = 'scenario_run_history'
6
6
  belongs_to :scenario_run_registry
7
7
  enum scenario_type: { connection: 0, accuracy: 1, performance: 2 }, _suffix: :type
@@ -11,9 +11,9 @@ module QaServer
11
11
  BAD_MARKER = 'X'
12
12
  UNKNOWN_MARKER = '?'
13
13
 
14
- class_attribute :summary_class
15
-
14
+ class_attribute :summary_class, :authority_lister_class
16
15
  self.summary_class = QaServer::ScenarioRunSummary
16
+ self.authority_lister_class = QaServer::AuthorityListerService
17
17
 
18
18
  class << self
19
19
  # Save a scenario result
@@ -92,12 +92,21 @@ module QaServer
92
92
  days_unknown = count_days(:unknown)
93
93
  keys = (days_good.keys + days_bad.keys + days_unknown.keys).uniq.sort
94
94
  keys.each_with_object({}) do |auth, hash|
95
+ next unless active_authority? auth
95
96
  hash[auth] = { good: day_count(auth, days_good), bad: day_count(auth, days_bad) + day_count(auth, days_unknown) }
96
97
  end
97
98
  end
98
99
 
99
100
  private
100
101
 
102
+ def active_authority?(auth)
103
+ active_authorities.include? auth.to_sym
104
+ end
105
+
106
+ def active_authorities
107
+ @active_authorities = authority_lister_class.authorities_list
108
+ end
109
+
101
110
  def day_count(auth, days)
102
111
  days&.key?(auth) ? days[auth] : 0
103
112
  end
@@ -2,6 +2,9 @@
2
2
  # This presenter class provides historical testing data needed by the view that monitors status of authorities.
3
3
  module QaServer::MonitorStatus
4
4
  class HistoryPresenter
5
+ CAUTION_THRESHOLD = 0.05
6
+ WARNING_THRESHOLD = 0.1
7
+
5
8
  # @param parent [QaServer::MonitorStatusPresenter] parent presenter
6
9
  # @param historical_summary_data [Array<Hash>] summary of past failuring runs per authority to drive chart
7
10
  def initialize(parent:, historical_summary_data:)
@@ -94,8 +97,8 @@ module QaServer::MonitorStatus
94
97
  end
95
98
 
96
99
  def failure_style_class(historical_entry)
97
- return "status-neutral" if days_authority_failing(historical_entry) <= 0
98
- percent_authority_failing(historical_entry) < 0.10 ? "status-unknown" : "status-bad"
100
+ return "status-neutral" if days_authority_failing(historical_entry) <= CAUTION_THRESHOLD
101
+ percent_authority_failing(historical_entry) < WARNING_THRESHOLD ? "status-unknown" : "status-bad"
99
102
  end
100
103
 
101
104
  def passing_style_class(historical_entry)
@@ -58,7 +58,11 @@ en:
58
58
  wait_message: Fetching term...
59
59
  term_results: Results
60
60
  monitor_status:
61
- title: Monitor Status
61
+ title: Monitor Status
62
+ permission_denied: 'Permission denied. Unable to %{action}.'
63
+ refreshing_tests: Refreshing tests.
64
+ refreshing_history: Refreshing connection history.
65
+ refreshing_performance: Refreshing performance metrics.
62
66
  summary:
63
67
  title: Latest Monitored Status
64
68
  summary_table: Summary
@@ -72,7 +76,6 @@ en:
72
76
  failures:
73
77
  title: Failures During Latest Status Update
74
78
  status: Status
75
- authority: Authority
76
79
  subauthority: Subauthority
77
80
  service: Service
78
81
  action: Action
@@ -80,7 +83,6 @@ en:
80
83
  errmsg: Errors
81
84
  history:
82
85
  title: Authority Connection History
83
- since: 'Since %{date} ET'
84
86
  range: 'From %{from} to %{to}'
85
87
  authority: Authority
86
88
  days_failing: Days Failing
@@ -101,7 +103,6 @@ en:
101
103
  graph_load_time_ms: Graph Load Time (ms)
102
104
  normalization_time_ms: Normalization Time (ms)
103
105
  retrieve_time_ms: Retrieve Time (ms)
104
- full_request_time_ms: Full Request Time (ms)
105
106
  x_axis_hour: Hour
106
107
  x_axis_day: Day
107
108
  x_axis_month: Month
@@ -114,7 +115,6 @@ en:
114
115
  datatable_month_desc: 'Month'
115
116
  datatable_year_desc: 'Year'
116
117
  datarange: 'From %{from} to %{to}'
117
- authority: Authority
118
118
  average_times: Average (ms)
119
119
  fastest_times: 10th percentile (ms)
120
120
  slowest_times: 90th percentile (ms)
@@ -12,7 +12,7 @@
12
12
  "url": {
13
13
  "@context": "http://www.w3.org/ns/hydra/context.jsonld",
14
14
  "@type": "IriTemplate",
15
- "template": "http://wintermute.info-science.uiowa.edu:8081/ld4l_services/loc_vocab_batch.jsp?{?query}&{?entity}&{?maxRecords}&{?startRecord}&{?lang}",
15
+ "template": "http://services.ld4l.org/ld4l_services/loc_vocab_batch.jsp?{?query}&{?entity}&{?maxRecords}&{?startRecord}&{?lang}",
16
16
  "variableRepresentation": "BasicRepresentation",
17
17
  "mapping": [
18
18
  {
@@ -64,10 +64,10 @@ search:
64
64
  -
65
65
  query: Plantin
66
66
  subauth: imprint
67
- position: 18
67
+ position: 1
68
68
  subject_uri: "http://thesaurus.cerl.org/record/cni00007649"
69
69
  replacements:
70
- maxRecords: '30'
70
+ maxRecords: '8'
71
71
  term:
72
72
  -
73
73
  identifier: "http://thesaurus.cerl.org/record/cnp00895966"
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module QaServer
3
- VERSION = '7.6.0'
3
+ VERSION = '7.7.0'
4
4
  end
data/spec/i18n_spec.rb CHANGED
@@ -14,7 +14,6 @@ RSpec.describe I18n do
14
14
  end
15
15
 
16
16
  it 'does not have unused keys' do
17
- pending 'need to explore unused keys further'
18
17
  expect(unused_keys).to be_empty,
19
18
  "#{unused_keys.leaves.count} unused i18n keys, run `i18n-tasks unused' to show them"
20
19
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: qa_server
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.6.0
4
+ version: 7.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - E. Lynette Rayle
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-04-12 00:00:00.000000000 Z
11
+ date: 2021-04-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails