Auto fetch cards for certain projects
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 68/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- git, github-actions, python
- 領域
- build-system
調査の方向性
Start with the proposed scripts/sync_folders.py and JSON configuration, then inspect the repository’s existing GitHub Actions workflow and rendering setup. Confirm the two source folders and destination paths match the project structure, and check whether cards depend on assets outside those folders. Done means CI syncs the configured folders before rendering and the generated destination is ignored by Git.
索引モデルが issue の本文から書いたものです。
説明
Suggested setup
Put the fetch in a script so CI and local use are identical:
[
{
"path_to_folder_to_synchronize_from": "https://github.com/InseeFrLab/codif-ape-prez/tree/main/cards",
"path_to_folder_to_synchronize_to": "project/2022_codif_ape/cards"
},
{
"path_to_folder_to_synchronize_from": "https://github.com/InseeFrLab/satellite-images-docs/tree/main/cards",
"path_to_folder_to_synchronize_to": "project/2022_satellites/cards"
}
]
#scripts/sync_folders.py
"""Sync folders from other GitHub repos into this repo, based on a JSON list."""
import json
import re
import shutil
import subprocess
import sys
import tempfile
from pathlib import Path
CONFIG = Path(sys.argv[1] if len(sys.argv) > 1 else "scripts/sync_folders.json")
# https://github.com/<owner>/<repo>/tree/<branch>/<folder>
URL_RE = re.compile(
r"^https://github\.com/(?P<owner>[^/]+)/(?P<repo>[^/]+)"
r"/tree/(?P<ref>[^/]+)/(?P<folder>.+?)/?$"
)
def run(*args):
subprocess.run(args, check=True)
def sync(src_url: str, dest: str) -> None:
m = URL_RE.match(src_url)
if not m:
raise ValueError(f"Unsupported URL (expected .../tree/<branch>/<folder>): {src_url}")
repo_url = f"https://github.com/{m['owner']}/{m['repo']}.git"
ref, folder = m["ref"], m["folder"]
with tempfile.TemporaryDirectory() as tmp:
run("git", "clone", "--depth", "1", "--filter=blob:none", "--sparse",
"--branch", ref, repo_url, tmp)
run("git", "-C", tmp, "sparse-checkout", "set", folder)
source = Path(tmp) / folder
if not source.is_dir():
raise FileNotFoundError(f"{folder} not found in {repo_url}@{ref}")
dest_path = Path(dest)
if dest_path.exists():
shutil.rmtree(dest_path)
dest_path.parent.mkdir(parents=True, exist_ok=True)
shutil.copytree(source, dest_path)
print(f"Synced {src_url} -> {dest}")
def main() -> None:
for entry in json.loads(CONFIG.read_text()):
sync(
entry["path_to_folder_to_synchronize_from"],
entry["path_to_folder_to_synchronize_to"],
)
if __name__ == "__main__":
main()
In the workflow, run it before rendering:
- uses: actions/checkout@v4
- name: Sync external folders
run: uv run python scripts/sync_folders.py
- name: Render
run: uv run quarto render
Add project/2022_codif_ape/cards/ to .gitignore so the copied files never get committed. If the repo is public, no token is needed.
If the cards reference images or other assets stored outside cards/ in the upstream repo, copy those folders too (add them to sparse-checkout set), otherwise the listing thumbnails may break.
- 主要言語
- CSS
- スター
- 14
- フォーク
- 13
- 平均マージ
- 1日 9時間
- マージ済み PR(30日)
- 4
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
InseeFrLab/ssphub のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 48/100
InseeFrLab/ssphub#196 ·
-
Fusion - Harmonize contributing and readme再び着手できるかも @nicotlm が 161 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンdocumentation
InseeFrLab/ssphub#147 · 担当者 1 名 ·
-
move image to S3オープンressources
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
InseeFrLab/ssphub#143 ·
-
github_actions
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
InseeFrLab/ssphub#142 · コメント 1 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 10/100
InseeFrLab/ssphub#128 ·
InseeFrLab/ssphub の issue をすべて見る
似ている issue
-
ci javascript tests
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
jonathanong/no-mistakes#3258 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
developmentseed/async-geotiff#185 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
chore: remove the git-cliff changelog target that would overwrite CHANGELOG.md対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンchore good first issue priority: low size: XS status: needs triage
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
cubrid-lab/sqlalchemy-cubrid#1293 ·
メンテナーはふだん 1 日以内に返信