feat: github-project-export (org Project v2 → TSV)#27
Conversation
Add foc-pr-report uv package: REST board q filter, Markdown table, reviewer enrichment via PR reviews API. Add foc_project14_client for shared Project 14 GraphQL and REST helpers. Refactor foc_wg_pr_notifier to use shared fetch and field_values_by_name. Document token scope, fetch behavior, and reviewer vs requested-review semantics. Made-with: Cursor
- Add synthetic empty row (no assignee / no reviewer) with board search links - Add Total row and column to PR count by repository and status - Rename first workload column to who; document output in README - Wire CLI through render_full_markdown for both tables Made-with: Cursor
Mirror the repository table structure with a ## section title and align README wording. Made-with: Cursor
|
The output of running this input was fed into https://docs.google.com/spreadsheets/d/1EgR9BRsfvsQlbcvT6-gKfXnNFWlmkwLDBb01Bdd3SxE/edit {
"projectUrl": "https://github.com/orgs/FilOzone/projects/14",
"queryParts": [
"-status:\"🎉 Done\"",
"milestone:\"M4.1: mainnet ready\",\"M4.2: mainnet GA\""
],
"fields": [
"Repository",
"Id",
"url",
"Title",
"Status",
"Kind",
"Milestone",
"Assignees",
"Reviewers",
"Cycle Theme",
"Dev Days Estimate"
],
"outputFile": null
} |
There was a problem hiding this comment.
Pull request overview
Adds a new github-project-export/ Python CLI that exports GitHub Organization Project v2 items to TSV based on a JSON config (board URL, filter query, selected fields, optional output file), reusing a shared foc_project14_client for REST item/field fetching and including a live integration test fixture.
Changes:
- Introduces the
github-project-exportuv package with config parsing, REST export logic, TSV writer, and synthetic columns. - Adds documentation/spec artifacts for the feature (spec/plan/research/quickstart/contracts/tasks) plus root README linkage.
- Refactors existing tooling to reuse the shared project client and updates supporting docs/locks.
Reviewed changes
Copilot reviewed 33 out of 35 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| specs/001-export-board-issues/tasks.md | Task breakdown/checklist for implementation phases |
| specs/001-export-board-issues/spec.md | Feature spec defining JSON schema + TSV behavior |
| specs/001-export-board-issues/research.md | REST + server-side q approach rationale |
| specs/001-export-board-issues/quickstart.md | Quickstart instructions for running the exporter |
| specs/001-export-board-issues/plan.md | Implementation plan and structure |
| specs/001-export-board-issues/data-model.md | JSON→TSV data model and validation rules |
| specs/001-export-board-issues/contracts/cli.md | CLI contract (args, exit codes, stdout/stderr rules) |
| specs/001-export-board-issues/checklists/requirements.md | Spec quality checklist for the feature |
| README.md | Adds repo-level entry for the new exporter tool |
| github-project-export/uv.lock | Locks dependencies for new uv package |
| github-project-export/tests/test_export_example_live.py | Live integration test (CLI vs golden TSV) |
| github-project-export/tests/fixtures/fixture_1_output.tsv | Golden expected TSV output |
| github-project-export/tests/fixtures/fixture_1_input.json | Fixture JSON config for the integration test |
| github-project-export/README.md | Tool README: schema, usage, synthetic keys |
| github-project-export/pyproject.toml | Package metadata, deps, scripts, pytest markers |
| github-project-export/github_project_export/tsv_write.py | TSV writer utilities |
| github-project-export/github_project_export/synthetic.py | Synthetic column key normalization + extraction |
| github-project-export/github_project_export/rest_export.py | REST fetch + row materialization by column config |
| github-project-export/github_project_export/config_schema.py | JSON config loading/validation |
| github-project-export/github_project_export/cli.py | CLI entrypoint wiring config → export → TSV |
| github-project-export/github_project_export/board_url.py | projectUrl parsing and validation |
| github-project-export/github_project_export/init.py | Package marker + version |
| github-project-export/examples/export.example2.json | Example config (broader columns) |
| github-project-export/examples/export.example1.json | Example config (matches integration fixture) |
| github-project-export/.gitignore | Package-local ignores for venv/cache |
| foc-pr-report/uv.lock | Dependency lock updates |
| foc-pr-report/README.md | Documentation updates around REST filtering and reviewers |
| foc-pr-report/pyproject.toml | Packaging metadata updates |
| foc-pr-report/foc_pr_report/report.py | Markdown report rendering + repo/status matrix |
| foc-pr-report/foc_pr_report/cli.py | CLI wiring for FOC PR report |
| foc-pr-report/foc_pr_report/init.py | Package marker |
| foc-pr-report/.gitignore | Package-local ignores |
| foc_wg_pr_notifier.py | Refactor to reuse shared foc_project14_client utilities |
| foc_project14_client.py | Shared client: GraphQL + REST helpers for Projects v2 |
| .cursor/rules/specify-rules.mdc | Auto-generated dev guidelines rules file |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
rjan90
left a comment
There was a problem hiding this comment.
Wanted to check: both foc-pr-report and github-project-export import foc_project14_client from the repo root, but their wheels only package the package-local modules (foc-pr-report/pyproject.toml, github-project-export/pyproject.toml). I think that means the installed entry points only work from this monorepo checkout, not as standalone packages.
Was that the intended distribution model?
Good point. I hadn't looked into that too much yet. I think that happened maybe because I am fine just running from the monorepo as I assume primary users are you and I, but I am open to input and am game to follow you lead, and I'm also game to structure it better later as well. |
|
(I haven't looked at the copilot feedback yet or reviewed the latest READMEs. I'll mark back as draft until I do. I just wanted to get something up that I could point to from https://docs.google.com/spreadsheets/d/1EgR9BRsfvsQlbcvT6-gKfXnNFWlmkwLDBb01Bdd3SxE/edit?gid=0#gid=0 ) |
…x unknown-repo links - Move foc_project14_client.py into foc_pr_report/ so the built package is self-contained and installable without the repo checkout - Remove sys.path mutation from cli.py; use absolute package imports instead - Update foc_wg_pr_notifier.py to import from foc_pr_report.foc_project14_client via a sys.path insert pointing at foc-pr-report/ - Fix SyntaxError on Python <3.12: backslash inside nested f-string expression in render_repo_status_markdown (report.py line 194) - Fix invalid repo:unknown filter in non-zero unknown-repo cells (report.py line 223) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add 001-export-board-issues: spec (JSON config, TSV, synthetic keys), plan, research, data-model, contracts/cli, quickstart, tasks - Add requirements checklist; update Cursor specify-rules from plan Made-with: Cursor
- JSON config (project URL, queryParts, fields, outputFile) and CLI - REST listing via foc_project14_client; board fields + issue/PR synthetics - Format project Title field values (raw) from items API - Live pytest integration test with fixture_1_input.json / fixture_1_output.tsv - Document usage; align quickstart and tasks with implementation Made-with: Cursor
- Map synthetic Kind to internal type (issue vs pull_request) - Format Assignees as comma-separated logins; Reviewers from requested_reviewers/teams - Rename export.example.json to export.example1.json; add export.example2.json - Point README and quickstart at example1 Made-with: Cursor
… docs - Import foc_project14_client from foc_pr_report package (foc-pr-report/foc_pr_report/) via sys.path insert; removes lazy import and type-ignore in rest_export.py - Wrap parse_org_project_url ValueError as ConfigError so bad projectUrl produces a clean exit-1 message instead of an unhandled traceback - Fix _normalize_tsv double-newline when there are zero data rows - README: remove "classic" from "Projects v2" description; fix broken ../foc_project14_client.py link; remove stale sys.path impl note - Spec: update requirements checklist title and validation record CSV→TSV - Spec: fix tasks.md format-validation claim to match actual [x] state - .cursor/rules: fix wrong src/ project structure and template placeholder Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
bca68c5 to
672ec3b
Compare
|
The packaging question from @rjan90 is addressed: this PR is now retargeted to |
|
@rjan90 : no urgency on this, and I can handle too when I get back, but I think I have addressed the main comments now. |
|
I have this targeting master now that #24 was merged |
Summary
Adds
github-project-export/, a small CLI that exports GitHub Organization Project v2 items to TSV from a JSON config (board URL, project searchq, columnfields, optionaloutputFile). Uses the REST list-items API via sharedfoc_project14_client.Highlights
Kind/url/Repository, etc.); project Title field values use GitHubrawshapeexamples/export.example1.json,export.example2.jsonpytest) with token: comparesfixture_1_input.json→fixture_1_output.tsvUsage
Docs:
github-project-export/README.md, root README section; quickstart underspecs/001-export-board-issues/.Made with Cursor