Wrong default in max content length if its not defined in site configuration

オープン
#337 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
68/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
静か
技術スタック
python
領域
backend

調査の方向性

Start by comparing the default declared in ckanext/datapusher_plus/config_declaration.yaml with the value assigned in ckanext/datapusher_plus/config.py. Then inspect the checks in ckanext/datapusher_plus/jobs/stages/download.py around lines 277–286 and 423–426. Reproduce with site configuration unset and a file larger than 5 MB but smaller than 1 GB; done when the file is handled without the reported error.

索引モデルが issue の本文から書いたものです。

説明

Describe the bug

If ckan site configuration does not define ckanext.datapusher_plus.max_content_length, it should use the default declared in
https://github.com/dathere/datapusher-plus/blob/474ce971175ccf1c749299e3143276c12ed65d4d/ckanext/datapusher_plus/config_declaration.yaml#L12-L16

Instead datapusher+ uses the value defined in https://github.com/dathere/datapusher-plus/blob/474ce971175ccf1c749299e3143276c12ed65d4d/ckanext/datapusher_plus/config.py#L86-L88

which results in an error shown with wrong value.

With default values, the code passes this check as conf.PRREVIEW_ROWS is 0.
https://github.com/dathere/datapusher-plus/blob/474ce971175ccf1c749299e3143276c12ed65d4d/ckanext/datapusher_plus/jobs/stages/download.py#L277-L286

But if fails this check as not 0 equals true.

https://github.com/dathere/datapusher-plus/blob/474ce971175ccf1c749299e3143276c12ed65d4d/ckanext/datapusher_plus/jobs/stages/download.py#L423-L426

To Reproduce
Steps to reproduce the behavior:

  1. Do not define site configuration for datapusher+
  2. Upload file larger than 5Mb and smaller than 1GB

Expected behavior
File should be handled by datapusher+ without errors.

Screenshots

Image
主要言語
Python
スター
47
フォーク
33
平均マージ
2時間 28分
マージ済み PR(30日)
10

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

dathere/datapusher-plus のほかの issue

dathere/datapusher-plus の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。