Skip to content

feat: sync portfolio projects from GitHub - #8

Merged
Tiancheng-Xu merged 1 commit into
mainfrom
feature/portfolio-auto-sync
Aug 14, 2026
Merged

feat: sync portfolio projects from GitHub#8
Tiancheng-Xu merged 1 commit into
mainfrom
feature/portfolio-auto-sync

Conversation

@Tiancheng-Xu

Copy link
Copy Markdown
Owner

Summary\n- add GitHub App webhook Worker with KV and 30-minute recovery\n- merge validated remote project metadata into the Dashboard with static fallback\n- add Portfolio Sync project card and repository contract\n\n## Production\n- Worker: https://portfolio-sync.baby2b.online\n- Health: https://portfolio-sync.baby2b.online/health\n- GitHub permission: contents read-only

Copilot AI lite review requested due to automatic review settings August 14, 2026 04:23
@Tiancheng-Xu
Tiancheng-Xu merged commit d9fca99 into main Aug 14, 2026
5 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds an automated “Portfolio Sync” pipeline that periodically and event-driven syncs eligible GitHub repositories into a public KV-backed project index, and updates the web Dashboard to merge that remote index over the curated static fallback list.

Changes:

  • Introduces a Cloudflare Worker (webhook + cron) that verifies GitHub App webhooks, scans installation repositories for manifest/metadata contracts, and publishes a versioned project envelope to Workers KV.
  • Adds Dashboard runtime fetching/validation and merge logic to overlay synced status/progress/links while retaining curated copy and a static fallback.
  • Documents the sync design/contract and adds CI to dry-run validate the Worker bundle/config on PRs.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
workers/portfolio-sync-webhook/wrangler.jsonc New Worker config: KV binding, cron trigger, custom domain route, env vars.
workers/portfolio-sync-webhook/src/index.mjs New Worker implementation: webhook verification, GitHub App auth, repo scanning, KV publishing, health/projects endpoints.
workers/portfolio-sync-webhook/package.json Adds Worker deploy and dry-run scripts pinned to a Wrangler version.
docs/superpowers/specs/2026-08-14-portfolio-sync-design.md Documents architecture, trust boundaries, and failure behavior.
docs/superpowers/plans/2026-08-14-portfolio-sync.md Implementation plan for Worker/Dashboard/Evidence tasks.
docs/portfolio-project-contract.md Defines the publish + portfolio metadata contract used by the sync.
apps/web/apps/web/src/features/portfolio/dashboard-content.tsx Fetches synced envelope on mount and displays last sync timestamp with fallback behavior.
apps/web/apps/web/src/data/portfolio-sync.ts Adds envelope validation + merge logic for curated vs synced projects.
apps/web/apps/web/src/data/portfolio-projects.ts Extends project model with sourceUpdatedAt and adds the Portfolio Sync project card.
.github/workflows/verify-portfolio-sync.yml New CI workflow to run Wrangler deploy dry-run for the Worker on PRs/pushes.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +13 to +29
function isProject(value: unknown): value is PortfolioProject {
if (!value || typeof value !== "object") return false;
const project = value as Partial<PortfolioProject>;
return Boolean(
project.id &&
project.title &&
project.desc &&
project.architecture &&
project.evidenceUrl &&
project.repo &&
Array.isArray(project.skills) &&
Array.isArray(project.evidence) &&
Array.isArray(project.details) &&
(project.status === "已完成" || project.status === "进行中") &&
typeof project.progress === "number",
);
}
Comment on lines +129 to +140
const results = await Promise.all(
candidates.map(async (repo) => {
try {
return await projectFromRepository(repo, token);
} catch (error) {
warnings.push(
error instanceof Error ? error.message : "unknown repository error",
);
return null;
}
}),
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants