Skip to content

feat: github-project-export (org Project v2 → TSV)#27

Open
BigLep wants to merge 9 commits intomasterfrom
001-export-board-issues
Open

feat: github-project-export (org Project v2 → TSV)#27
BigLep wants to merge 9 commits intomasterfrom
001-export-board-issues

Conversation

@BigLep
Copy link
Copy Markdown
Contributor

@BigLep BigLep commented Apr 7, 2026

Summary

Adds github-project-export/, a small CLI that exports GitHub Organization Project v2 items to TSV from a JSON config (board URL, project search q, column fields, optional outputFile). Uses the REST list-items API via shared foc_project14_client.

Highlights

  • JSON-only settings (no duplicate CLI flags for filter/columns)
  • Board fields + synthetics (Kind / url / Repository, etc.); project Title field values use GitHubraw shape
  • Assignees / Reviewers as comma-separated logins (reviewers include requested users and team slugs/names)
  • Examples: examples/export.example1.json, export.example2.json
  • Live integration test (pytest) with token: compares fixture_1_input.jsonfixture_1_output.tsv

Usage

cd github-project-export && uv sync
GITHUB_TOKEN=$(gh auth token) uv run github-project-export examples/export.example1.json

Docs: github-project-export/README.md, root README section; quickstart under specs/001-export-board-issues/.

Made with Cursor

BigLep added 3 commits April 6, 2026 22:05
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
@FilOzzy FilOzzy added this to FOC Apr 7, 2026
@github-project-automation github-project-automation bot moved this to 📌 Triage in FOC Apr 7, 2026
@BigLep
Copy link
Copy Markdown
Contributor Author

BigLep commented Apr 7, 2026

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
}

@BigLep BigLep moved this from 📌 Triage to 🔎 Awaiting review in FOC Apr 7, 2026
@BigLep BigLep requested a review from Copilot April 7, 2026 05:34
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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-export uv 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.

Copy link
Copy Markdown
Contributor

@rjan90 rjan90 left a comment

Choose a reason for hiding this comment

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

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?

@BigLep
Copy link
Copy Markdown
Contributor Author

BigLep commented Apr 7, 2026

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 foc_project14_client is being used by some of the scripts you had written? (I had asked to refactor to make sure I wasn't duplicating). I haven't confirmed this.

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.

@BigLep BigLep marked this pull request as draft April 7, 2026 05:49
@BigLep
Copy link
Copy Markdown
Contributor Author

BigLep commented Apr 7, 2026

(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 )

@BigLep BigLep self-assigned this Apr 7, 2026
…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>
@BigLep BigLep changed the base branch from master to biglep/foc-project-pr-report April 11, 2026 15:25
BigLep and others added 4 commits April 11, 2026 08:27
- 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>
@BigLep BigLep force-pushed the 001-export-board-issues branch from bca68c5 to 672ec3b Compare April 11, 2026 15:28
@BigLep
Copy link
Copy Markdown
Contributor Author

BigLep commented Apr 11, 2026

The packaging question from @rjan90 is addressed: this PR is now retargeted to biglep/foc-project-pr-report (PR #24) and rebased on top of it. PR #24 moved foc_project14_client.py into foc-pr-report/foc_pr_report/. This PR's github-project-export now points its sys.path at foc-pr-report/ and imports from foc_pr_report.foc_project14_client — same pattern PR #24 established for foc_wg_pr_notifier.py. No duplicate copy of the client, no standalone-installability regression beyond what PR #24 already accepted.

@BigLep BigLep marked this pull request as ready for review April 11, 2026 15:31
@BigLep
Copy link
Copy Markdown
Contributor Author

BigLep commented Apr 11, 2026

@rjan90 : no urgency on this, and I can handle too when I get back, but I think I have addressed the main comments now.

@BigLep BigLep changed the base branch from biglep/foc-project-pr-report to master April 12, 2026 16:04
@BigLep
Copy link
Copy Markdown
Contributor Author

BigLep commented Apr 12, 2026

I have this targeting master now that #24 was merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🔎 Awaiting review

Development

Successfully merging this pull request may close these issues.

4 participants