Skip to content
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

Closed
wants to merge 24 commits into from

Conversation

itowtips
Copy link
Contributor

No description provided.

@@ -291,10 +291,12 @@ ja:
imported: インポートしました。
approved: 承認しました。
started_import: インポートを開始しました。
started_export: エクスポートを開始しました。

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: 削除処理を開始しました。

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 は日本語ロケールにのみ存在します。

Copy link

@github-actions github-actions bot left a 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

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?

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") }

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

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

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' })

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' })

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' })

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' })

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' })

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?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [rubocop] reported by reviewdog 🐶
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"

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]

@itowtips itowtips closed this Oct 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant