Skip to content

Commit 3b30592

Browse files
committed
added layer of retries on gdrive upload + updated lt-lcms/lt-google-api
1 parent 2c6a04b commit 3b30592

File tree

13 files changed

+62
-63
lines changed

13 files changed

+62
-63
lines changed

Gemfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ gemspec
1818

1919
gem 'lt-google-api', github: 'learningtapestry/lt-google-api',
2020
branch: 'ruby-3-upgrade',
21-
ref: '3dd76b6'
21+
ref: '08cece7'
2222

2323
gem 'lt-lcms', github: 'learningtapestry/lt-lcms',
2424
branch: 'ruby-3-upgrade',
25-
ref: '9394667'
25+
ref: 'a673e78'
2626

2727
gem 'wicked_pdf', github: 'learningtapestry/wicked_pdf',
2828
branch: 'puppeteer-support',

Gemfile.lock

Lines changed: 29 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
GIT
22
remote: https://github.com/learningtapestry/lt-google-api.git
3-
revision: 3dd76b67695ce6ddf91c80512eb3cb096b810b4b
4-
ref: 3dd76b6
3+
revision: 08cece7288b1a5efd30f4ff33158f54fe1b726ba
4+
ref: 08cece7
55
branch: ruby-3-upgrade
66
specs:
7-
lt-google-api (0.3.0)
8-
google-apis-drive_v3 (~> 0.46)
9-
googleauth (~> 1.9)
7+
lt-google-api (0.3.2)
8+
google-apis-drive_v3 (~> 0.66)
9+
googleauth (~> 1.14)
1010

1111
GIT
1212
remote: https://github.com/learningtapestry/lt-lcms.git
13-
revision: 93946677b63120c132c7c2005a8f0e49700553ac
14-
ref: 9394667
13+
revision: a673e780638cd897f187444130274f9f41be961c
14+
ref: a673e78
1515
branch: ruby-3-upgrade
1616
specs:
17-
lt-lcms (0.6.0)
18-
google-apis-core (~> 0.11, >= 0.11.1)
19-
httparty (~> 0.18)
17+
lt-lcms (0.6.2)
18+
google-apis-core (~> 0.18)
19+
httparty (~> 0.22)
2020
nokogiri (~> 1.10, >= 1.10.8)
2121
rubyzip (~> 2)
2222

@@ -52,7 +52,8 @@ PATH
5252
elasticsearch-persistence (~> 7.0)
5353
elasticsearch-rails (~> 7.0)
5454
fog-aws (~> 3.5, >= 3.5.2)
55-
google-api-client (< 1)
55+
google-apis-drive_v3 (~> 0.66)
56+
google-apis-script_v1 (~> 0.28)
5657
hiredis (~> 0.6.3)
5758
httparty (~> 0.18)
5859
jbuilder (~> 2.10)
@@ -359,36 +360,27 @@ GEM
359360
fugit (1.8.1)
360361
et-orbi (~> 1, >= 1.2.7)
361362
raabro (~> 1.4)
362-
gems (1.2.0)
363363
globalid (1.2.1)
364364
activesupport (>= 6.1)
365-
google-api-client (0.53.0)
366-
google-apis-core (~> 0.1)
367-
google-apis-generator (~> 0.1)
368-
google-apis-core (0.11.1)
365+
google-apis-core (0.18.0)
369366
addressable (~> 2.5, >= 2.5.1)
370-
googleauth (>= 0.16.2, < 2.a)
371-
httpclient (>= 2.8.1, < 3.a)
367+
googleauth (~> 1.9)
368+
httpclient (>= 2.8.3, < 3.a)
372369
mini_mime (~> 1.0)
370+
mutex_m
373371
representable (~> 3.0)
374372
retriable (>= 2.0, < 4.a)
375-
rexml
376-
webrick
377-
google-apis-discovery_v1 (0.14.0)
378-
google-apis-core (>= 0.11.0, < 2.a)
379-
google-apis-drive_v3 (0.46.0)
380-
google-apis-core (>= 0.11.0, < 2.a)
381-
google-apis-generator (0.12.0)
382-
activesupport (>= 5.0)
383-
gems (~> 1.2)
384-
google-apis-core (>= 0.11.0, < 2.a)
385-
google-apis-discovery_v1 (~> 0.5)
386-
thor (>= 0.20, < 2.a)
387-
google-cloud-env (2.1.0)
373+
google-apis-drive_v3 (0.66.0)
374+
google-apis-core (>= 0.15.0, < 2.a)
375+
google-apis-script_v1 (0.28.0)
376+
google-apis-core (>= 0.15.0, < 2.a)
377+
google-cloud-env (2.2.1)
388378
faraday (>= 1.0, < 3.a)
389-
googleauth (1.9.1)
379+
google-logging-utils (0.2.0)
380+
googleauth (1.14.0)
390381
faraday (>= 1.0, < 3.a)
391-
google-cloud-env (~> 2.1)
382+
google-cloud-env (~> 2.2)
383+
google-logging-utils (~> 0.1)
392384
jwt (>= 1.4, < 3.0)
393385
multi_json (~> 1.11)
394386
os (>= 0.9, < 2.0)
@@ -399,7 +391,8 @@ GEM
399391
http-accept (1.7.0)
400392
http-cookie (1.0.5)
401393
domain_name (~> 0.5)
402-
httparty (0.21.0)
394+
httparty (0.23.1)
395+
csv
403396
mini_mime (>= 1.0.0)
404397
multi_xml (>= 0.5.2)
405398
httpclient (2.8.3)
@@ -450,6 +443,7 @@ GEM
450443
multipart-post (2.3.0)
451444
mustermann (3.0.0)
452445
ruby2_keywords (~> 0.0.1)
446+
mutex_m (0.3.0)
453447
net-imap (0.3.7)
454448
date
455449
net-protocol
@@ -707,7 +701,6 @@ GEM
707701
nokogiri (~> 1.6)
708702
rubyzip (>= 1.3.0)
709703
selenium-webdriver (> 3.141, < 5.0)
710-
webrick (1.8.1)
711704
websocket-driver (0.7.6)
712705
websocket-extensions (>= 0.1.0)
713706
websocket-extensions (0.1.5)
@@ -724,6 +717,7 @@ PLATFORMS
724717
aarch64-linux
725718
arm64-darwin-21
726719
arm64-darwin-23
720+
arm64-darwin-24
727721
x86_64-linux
728722

729723
DEPENDENCIES

app/forms/lcms/engine/curriculum_form.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class CurriculumForm
1111

1212
def initialize(params = {})
1313
parsed_change_log = parse_change_log params
14-
super params.merge(change_log: parsed_change_log)
14+
super(params.merge(change_log: parsed_change_log))
1515
end
1616

1717
def save

app/helpers/lcms/engine/resource_helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def resource_breadcrumbs_with_links(resource)
3535

3636
[].tap do |result|
3737
pieces.each_with_index do |piece, idx|
38-
((result << piece) && next) if idx.zero?
38+
(result << piece) && next if idx.zero?
3939

4040
slug = Slug.build_from(pieces[0..idx])
4141

app/middleware/remove_session.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,10 @@ def call(env)
1616
# Don't delete the session cookie if:
1717
# - We're in the process of logging in (breaks CSRF for sign in form)
1818
# - We're logged in (needed for Devise)
19-
skip_delete = (
19+
skip_delete =
2020
path =~ %r{^/users} ||
2121
user_key.present? ||
2222
headers[SET_COOKIE].blank?
23-
)
2423

2524
signing_out = path == '/users/sign_out'
2625

app/services/lcms/engine/html_sanitizer.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class HtmlSanitizer # rubocop:disable Metrics/ClassLength
1212
SKIP_P_CHECK = %w(ul ol table).freeze
1313
STRIP_ELEMENTS = %w(a div h1 h2 h3 h4 h5 h6 p span table).freeze
1414

15-
class << self # rubocop:todo Metrics/ClassLength
15+
class << self # rubocop:disable Metrics/ClassLength
1616
def clean_content(html, context_type)
1717
return html unless context_type.to_s.casecmp('gdoc').zero?
1818

@@ -334,7 +334,7 @@ def post_processing_images_gdoc(nodes)
334334

335335
css = ':not(.u-ld-not-image-wrap) > img:not([src*=googleapis]):not(.o-ld-icon):not(.o-ld-latex)'
336336
nodes.css(css).each do |img|
337-
img = img.parent.replace(img) if img.parent.name == 'span' || img.parent.name == 'p'
337+
img = img.parent.replace(img) if %w(span p).include?(img.parent.name)
338338
img.replace(%(
339339
<table class='o-simple-table o-ld-image-wrap--math'>
340340
<tr>
@@ -382,7 +382,7 @@ def remove_spans_wo_attrs(env)
382382
def remove_empty_paragraphs(env)
383383
node = env[:node]
384384

385-
node.unlink if node.element? && (node.name == 'p' || node.name == 'span') && node.inner_html.squish.blank?
385+
node.unlink if node.element? && %w(p span).include?(node.name) && node.inner_html.squish.blank?
386386
end
387387

388388
# replace inline borders style with width = 0 as they're not processing correct for pdf

app/services/lcms/engine/react_materials_resolver.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def replace_react(node, document) # rubocop:disable Metrics/PerceivedComplexity
2323
else
2424
JSON.parse(data)
2525
end
26-
node.remove && return if (raw_props['material_ids']).empty?
26+
node.remove && return if raw_props['material_ids'].empty?
2727

2828
props = PreviewsMaterialSerializer.new(raw_props, document)
2929
node.remove && return if props.data && props.data.empty?

config/initializers/elasticsearch.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
host: ENV.fetch('ELASTICSEARCH_ADDRESS', nil),
77
adapter: :net_http
88
)
9-
Hashie.logger = Logger.new('/dev/null')
9+
Hashie.logger = Logger.new(File::NULL)

lcms-engine.gemspec

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ Gem::Specification.new do |s|
4747
s.add_dependency 'elasticsearch-persistence', '~> 7.0'
4848
s.add_dependency 'elasticsearch-rails', '~> 7.0'
4949
s.add_dependency 'fog-aws', '~> 3.5', '>= 3.5.2'
50-
s.add_dependency 'google-api-client', '< 1'
50+
s.add_dependency 'google-apis-drive_v3', '~> 0.66'
51+
s.add_dependency 'google-apis-script_v1', '~> 0.28'
5152
s.add_dependency 'hiredis', '~> 0.6.3'
5253
s.add_dependency 'httparty', '~> 0.18'
5354
s.add_dependency 'jbuilder', '~> 2.10'

lib/doc_template/document.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def parse_node(node)
106106
context_type: @opts[:context_type],
107107
data: parsed_tag.tag_data,
108108
materials: parsed_tag.materials,
109-
optional: (parsed_tag.try(:optional?) || false),
109+
optional: parsed_tag.try(:optional?) || false,
110110
placeholder: parsed_tag.placeholder,
111111
part_type: tag_name.to_s.underscore
112112
}

0 commit comments

Comments
 (0)