canvas_sync 0.18.9 → 0.18.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 490c7e8d4a1b61e5bd17dd938a0387f68718789bb05ad8c071d1a7dca83374ac
4
- data.tar.gz: 06e933489bb8fd39f8af4a2c8498032faf7edf064a1df5cf882659823fa0f597
3
+ metadata.gz: 1223506dbbaaa180f70770aaabd92c3ffe931ae491bd392b2bbaa2ce520de2c8
4
+ data.tar.gz: b0b5bc307fe639c3281f51658e995e2fc661186cd5b73918027e0fe01f7487e6
5
5
  SHA512:
6
- metadata.gz: 43fb1c9a539c970093c742ef2dd8cb1737a46f3b47ed1958b25fb3e3703ca3195677024d62d438d101ac913a53dbd86291fdaa3bd290c78e0b318064f6c27ddf
7
- data.tar.gz: a08e7076c32de83470a32d2238ed0ac77055d3afa65411c0663330803e58b7edf2c9fa6a3b121c2835ec2347a23c40499248d35199c83de3f99347c71d7e77c9
6
+ metadata.gz: 40d9c62d733a904611600f4fe6d37e0eecf956d835fb0db31d10e40af8d0bed2269a72b386ae9135a2b8dc05219df80002497cf19ab88d6e579be81d80180c42
7
+ data.tar.gz: 659c99a14af5f186b3df3522642fec00b6ce7e3337a01e23e11f8c261208065834b9754d6d619b7445209dd2ed8a0eddbaabdc257a90038399a00de48eae88a1
@@ -21,7 +21,7 @@ module CanvasSync::Concerns
21
21
  end
22
22
 
23
23
  def get_lti_cust_param(key)
24
- nkey = key.gsub(/^custom_/, '')
24
+ nkey = key.to_s.gsub(/^custom_/, '')
25
25
 
26
26
  launch_params.dig("https://purl.imsglobal.org/spec/lti/claim/custom", nkey) || launch_params[nkey] || launch_params["custom_#{nkey}"]
27
27
  end
@@ -376,6 +376,7 @@ module CanvasSync
376
376
  "BID-#{bid}-callbacks-complete",
377
377
  "BID-#{bid}-callbacks-success",
378
378
  "BID-#{bid}-failed",
379
+ "BID-#{bid}-dead",
379
380
 
380
381
  "BID-#{bid}-batches-success",
381
382
  "BID-#{bid}-batches-complete",
@@ -98,6 +98,10 @@ module CanvasSync
98
98
  end
99
99
  end
100
100
 
101
+ def empty?
102
+ self.class.get_chain_parameter(self).empty?
103
+ end
104
+
101
105
  def get_sub_chain(sub_type)
102
106
  matching_jobs = find_matching_jobs(sub_type).to_a
103
107
  raise "Found multiple \"#{sub_type}\" jobs in the chain" if matching_jobs.count > 1
@@ -1,6 +1,7 @@
1
1
 
2
2
  @color-green: #25c766;
3
- @color-red: #c7254e;
3
+ @color-darkred: #8f0000;
4
+ @color-red: #e03963;
4
5
  @color-yellow: #c4c725;
5
6
 
6
7
  .code-wrap.batch-context .args-extended {
@@ -30,6 +31,9 @@
30
31
  &.failed {
31
32
  color: @color-red;
32
33
  }
34
+ &.dead {
35
+ color: @color-darkred;
36
+ }
33
37
  &.success {
34
38
  color: @color-green;
35
39
  }
@@ -156,7 +160,7 @@
156
160
  }
157
161
 
158
162
  .status-block {
159
- width: 10em;
163
+ width: 12em;
160
164
  text-align: center;
161
165
  }
162
166
  }
@@ -12,6 +12,8 @@ const StatusBlock = (props) => html`
12
12
  |
13
13
  <span class="tree-stat failed">${props.failed_count}</span>
14
14
  |
15
+ <span class="tree-stat dead">${props.dead_count}</span>
16
+ |
15
17
  <span class="tree-stat success">${props.successful_count}</span>
16
18
  /
17
19
  <span class="tree-stat total">${props.total_count}</span>
@@ -96,7 +98,7 @@ class TreeRoot extends Component {
96
98
  const tree_data = JSON.parse(document.querySelector('#batch-tree #initial-data').innerHTML);
97
99
  return html`
98
100
  <div class="tree-header">
99
- <${StatusBlock} pending_count="pending" failed_count="failed" successful_count="successful" total_count="total" />
101
+ <${StatusBlock} pending_count="pending" failed_count="failed" dead_count="dead" successful_count="successful" total_count="total" />
100
102
  </div>
101
103
  <${TreeLevel} data=${tree_data} />
102
104
  `;
@@ -5,12 +5,13 @@
5
5
  <th rowspan="2"><%= t('BID') %></th>
6
6
  <th rowspan="2"><%= t('Description') %></th>
7
7
 
8
- <th colspan="4"><%= t('Jobs') %></th>
8
+ <th colspan="5"><%= t('Jobs') %></th>
9
9
  <th colspan="4"><%= t('Sub-Batches') %></th>
10
10
  </tr>
11
11
  <tr>
12
12
  <th><%= t('Pending') %></th>
13
13
  <th><%= t('Failed') %></th>
14
+ <th><%= t('Dead') %></th>
14
15
  <th><%= t('Complete') %></th>
15
16
  <th><%= t('Total') %></th>
16
17
 
@@ -30,6 +31,7 @@
30
31
 
31
32
  <td><%= status.pending %></th>
32
33
  <td><%= status.failures %></th>
34
+ <td><%= status.dead %></th>
33
35
  <td><%= status.completed_count %></th>
34
36
  <td><%= status.job_count %></th>
35
37
 
@@ -68,6 +68,7 @@ module CanvasSync::JobBatches::Sidekiq
68
68
  jobs_total = r.hget("BID-#{bid}", "job_count").to_i
69
69
  jobs_pending = r.hget("BID-#{bid}", 'pending').to_i
70
70
  jobs_failed = r.scard("BID-#{bid}-failed").to_i
71
+ jobs_dead = r.scard("BID-#{bid}-dead").to_i
71
72
  jobs_success = jobs_total - jobs_pending
72
73
 
73
74
  batches_total = r.hget("BID-#{bid}", 'children').to_i
@@ -90,6 +91,7 @@ module CanvasSync::JobBatches::Sidekiq
90
91
  pending_count: jobs_pending,
91
92
  successful_count: jobs_success,
92
93
  failed_count: jobs_failed,
94
+ dead_count: jobs_dead,
93
95
  total_count: jobs_total,
94
96
  # items: batches.map{|b| layer_data[b] },
95
97
  },
@@ -21,6 +21,10 @@ module CanvasSync
21
21
  Batch.redis { |r| r.scard("BID-#{bid}-failed") }.to_i
22
22
  end
23
23
 
24
+ def dead
25
+ Batch.redis { |r| r.scard("BID-#{bid}-dead") }.to_i
26
+ end
27
+
24
28
  def completed_count
25
29
  job_count - pending
26
30
  end
@@ -1,3 +1,3 @@
1
1
  module CanvasSync
2
- VERSION = "0.18.9".freeze
2
+ VERSION = "0.18.12".freeze
3
3
  end
data/lib/canvas_sync.rb CHANGED
@@ -170,9 +170,6 @@ module CanvasSync
170
170
  # General provisioning jobs (not term-scoped)
171
171
  ##############################
172
172
 
173
- # Terms are always synced regardless of the models option
174
- models -= ['terms']
175
-
176
173
  # Accounts, users, roles, and admins cannot be scoped to term
177
174
  try_add_model_job.call('accounts')
178
175
 
@@ -194,9 +191,10 @@ module CanvasSync
194
191
  # Per-term provisioning jobs
195
192
  ###############################
196
193
 
194
+ term_parent_chain = current_chain
195
+
197
196
  per_term_chain = JobBatches::ChainBuilder.new(model_job_map[:terms])
198
197
  per_term_chain.params[:term_scope] = term_scope
199
- current_chain << per_term_chain
200
198
  current_chain = per_term_chain
201
199
 
202
200
  term_scoped_models.each do |mdl|
@@ -207,6 +205,11 @@ module CanvasSync
207
205
  generate_provisioning_jobs(models, options)
208
206
  )
209
207
 
208
+ # Skip syncing terms if not required
209
+ if !current_chain.empty? || (models & ['terms']).present?
210
+ term_parent_chain << per_term_chain
211
+ end
212
+
210
213
  ###############################
211
214
  # Wrap it all up
212
215
  ###############################