New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[modify] opendata harvest for ckan version up #5074
Conversation
@@ -291,10 +291,12 @@ ja: | |||
imported: インポートしました。 | |||
approved: 承認しました。 | |||
started_import: インポートを開始しました。 | |||
started_export: エクスポートを開始しました。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[locale] reported by reviewdog 🐶
ja.ss.notice.started_export は日本語ロケールにのみ存在します。
started_upload: アップロードを開始しました。 | ||
started_deliver: 配信を開始しました。 | ||
started_test_deliver: テスト配信を開始しました。 | ||
started_apply: 反映処理を開始しました。 | ||
started_purge: 削除処理を開始しました。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[locale] reported by reviewdog 🐶
ja.ss.notice.started_purge は日本語ロケールにのみ存在します。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit
rubocop
spec/spec_helper.rb|250 col 1| Lint/DuplicateMethods: Method Object#ci? is defined at both spec/spec_helper.rb:23 and spec/spec_helper.rb:250.
put_log("-- resource : same revision_id #{resource.name}") | ||
return resource | ||
end | ||
|
||
last_modified = attributes["last_modified"] | ||
last_modified = DateTime.parse(last_modified).in_time_zone.change(sec: 0) rescue nil | ||
if last_modified.present? && resource.harvest_last_modified.present? && resource.harvest_last_modified.to_i == last_modified.to_i |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[rubocop] reported by reviewdog 🐶
Layout/LineLength: Line is too long. [133/130]
|
||
def with_exporter(site, id) | ||
if name.blank? | ||
puts "Please input exporter: exporter=[1]" or exit if id.blank? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[rubocop] reported by reviewdog 🐶
Rails/Exit: Do not use exit in Rails applications.
@@ -12,21 +12,21 @@ | |||
let!(:license) { create(:opendata_license, cur_site: site, uid: "cc-by", name: "表示(CC BY)") } | |||
|
|||
context "with empty datasets" do | |||
let!(:importer) { create(:opendata_harvest_importer, cur_node: node, source_url: "http://source.example.jp", api_type: "shirasagi_scraper") } | |||
let!(:importer) { create(:opendata_harvest_importer, cur_node: node, source_url: "https://source.example.jp", api_type: "shirasagi_scraper") } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[rubocop] reported by reviewdog 🐶
[Correctable] Layout/LineLength: Line is too long. [146/130]
end | ||
|
||
def expect_same_file(file1, file2) | ||
str1 = URI.open(file1).read |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[rubocop] reported by reviewdog 🐶
Security/Open: The use of URI.open is a serious security risk.
|
||
def expect_same_file(file1, file2) | ||
str1 = URI.open(file1).read | ||
str2 = URI.open(file2).read |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[rubocop] reported by reviewdog 🐶
Security/Open: The use of URI.open is a serious security risk.
stub_request(:get, @dataset1.full_url).to_return(body: @dataset1_html, status: 200, headers: { 'Content-Type' => 'text/html' }) | ||
stub_request(:get, @dataset2.full_url).to_return(body: @dataset2_html, status: 200, headers: { 'Content-Type' => 'text/html' }) | ||
stub_request(:get, @dataset3.full_url).to_return(body: @dataset3_html, status: 200, headers: { 'Content-Type' => 'text/html' }) | ||
stub_request(:get, @dataset4.full_url).to_return(body: @dataset4_html, status: 200, headers: { 'Content-Type' => 'text/html' }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[rubocop] reported by reviewdog 🐶
[Correctable] Layout/LineLength: Line is too long. [135/130]
stub_request(:get, @dataset2.full_url).to_return(body: @dataset2_html, status: 200, headers: { 'Content-Type' => 'text/html' }) | ||
stub_request(:get, @dataset3.full_url).to_return(body: @dataset3_html, status: 200, headers: { 'Content-Type' => 'text/html' }) | ||
stub_request(:get, @dataset4.full_url).to_return(body: @dataset4_html, status: 200, headers: { 'Content-Type' => 'text/html' }) | ||
stub_request(:get, @dataset5.full_url).to_return(body: @dataset5_html, status: 200, headers: { 'Content-Type' => 'text/html' }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[rubocop] reported by reviewdog 🐶
[Correctable] Layout/LineLength: Line is too long. [135/130]
file2_url = ::File.join(site.full_url, @dataset5.resources[0].file.url) | ||
file3_url = ::File.join(site.full_url, @dataset5.resources[1].file.url) | ||
|
||
stub_request(:get, file1_url).to_return(body: ::File.read(sample_txt), status: 200, headers: { 'Content-Type' => 'text/csv' }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[rubocop] reported by reviewdog 🐶
[Correctable] Layout/LineLength: Line is too long. [134/130]
file3_url = ::File.join(site.full_url, @dataset5.resources[1].file.url) | ||
|
||
stub_request(:get, file1_url).to_return(body: ::File.read(sample_txt), status: 200, headers: { 'Content-Type' => 'text/csv' }) | ||
stub_request(:get, file2_url).to_return(body: ::File.read(sample_csv), status: 200, headers: { 'Content-Type' => 'text/csv' }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[rubocop] reported by reviewdog 🐶
[Correctable] Layout/LineLength: Line is too long. [134/130]
|
||
stub_request(:get, file1_url).to_return(body: ::File.read(sample_txt), status: 200, headers: { 'Content-Type' => 'text/csv' }) | ||
stub_request(:get, file2_url).to_return(body: ::File.read(sample_csv), status: 200, headers: { 'Content-Type' => 'text/csv' }) | ||
stub_request(:get, file3_url).to_return(body: ::File.read(sample2_xlsx), status: 200, headers: { 'Content-Type' => 'application/octet-stream' }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[rubocop] reported by reviewdog 🐶
[Correctable] Layout/LineLength: Line is too long. [152/130]
@@ -247,6 +247,10 @@ def with_env(hash) | |||
ret | |||
end | |||
|
|||
def ci? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lint/DuplicateMethods: Method Object#ci? is defined at both spec/spec_helper.rb:23 and spec/spec_helper.rb:250.
end | ||
|
||
def docker_ckan_api_key | ||
"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJqdGkiOiJBQVNLX19lQUMwQ3dxV0VjNXZKcW9hQy1zbWt1dExaU0NORWotMzlYZVZBIiwiaWF0IjoxNjg5ODM1ODMyfQ.rWZGXCfSVDN9jISBcJ8qlyVq_bMKKPOokKdUOe65LJ4" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[rubocop] reported by reviewdog 🐶
Layout/LineLength: Line is too long. [181/130]
No description provided.