Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Break apart Contents Abstraction

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

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

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
リファクタリング
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
github, python
領域
api

調査の方向性

GithubRepo.get_contents とリンク先の GitHub Contents API ドキュメントから始め、呼び出し元をたどってディレクトリとファイルの意図を区別します。ディレクトリとファイルでそれぞれ異なる動作を定義し、1MB から 100MB のファイルに対する raw-media fallback を含めます。この issue では、100MB を超えるファイルをサポートする必要があるかどうかも決定する必要があります。

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

説明

We currently have GithubRepo.get_contents as an abstraction around GitHub's Contents API endpoint. However, this endpoint behaves differently depending on what you're asking it for, in particular:

  • a directory
  • a file
  • a file whose size is between 1MB and 100MB
  • a file whose size is above 100MB

The method tries to handle those all in one place and the flow suffers because of it.

Instead we should pick apart this abstraction into two, based on the caller's intent:

  • a directory
  • a file, with fallbacks for larger files

For instance, file content for files between 1MB and 100MB can be retrieved with the application/vnd.github.v3.raw custom media type (as the Accept header). Since we already want the metadata from the initial call (it's not provided with a raw call) this seems like a nice fallback. We can discuss whether we need to support retrieving file content which is >100MB.

主要言語
Python
スター
0
フォーク
0
平均マージ
2日 20時間
マージ済み PR(30日)
9

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

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

opensafely-core/osgithub のほかの issue

opensafely-core/osgithub の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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