Skip to content

feat(api): add fetch-one job flow#156

Draft
luandro wants to merge 1 commit intomainfrom
feat/consolidate-fetch-jobs
Draft

feat(api): add fetch-one job flow#156
luandro wants to merge 1 commit intomainfrom
feat/consolidate-fetch-jobs

Conversation

@luandro
Copy link
Contributor

@luandro luandro commented Mar 9, 2026

Summary

  • add a dedicated fetch-one job type with required pageId validation
  • wire fetch-one and expanded fetch-all options through the API runner and CLI
  • update tests and API docs for the consolidated fetch job behavior

Testing

  • bunx vitest run api-server/validation-schemas.test.ts api-server/fetch-job-runner.test.ts scripts/notion-fetch-all/fetchAll.test.ts scripts/notion-fetch-all/tests/index.cli.test.ts

greptile-apps[bot]

This comment was marked as off-topic.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 9, 2026

🐳 Docker Image Published

Your Docker image has been built and pushed for this PR.

Image Reference: docker.io/communityfirst/comapeo-docs-api:pr-156

Platforms: linux/amd64, linux/arm64

Testing

To test this image:

docker pull docker.io/communityfirst/comapeo-docs-api:pr-156
docker run -p 3001:3001 docker.io/communityfirst/comapeo-docs-api:pr-156

Built with commit f94f25a

@github-actions
Copy link
Contributor

github-actions bot commented Mar 9, 2026

🚀 Preview Deployment

Your documentation preview is ready!

Preview URL: https://pr-156.comapeo-docs.pages.dev

🔄 Content: Regenerated 5 pages from Notion (script changes detected)

💡 Tip: Add label fetch-all-pages to test with full content, or fetch-10-pages for broader coverage.

This preview will update automatically when you push new commits to this PR.


Built with commit f94f25a

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f94f25aa47

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +76 to +87
if (pageId) {
const rawPage = await notion.pages.retrieve({ page_id: pageId });
const page = transformPage(rawPage as any);

return {
pages: [page],
rawPages: [rawPage as Record<string, unknown>],
candidateIds: [],
fetchedCount: 1,
processedCount: 1,
};
}

Choose a reason for hiding this comment

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

P1 Badge Route page-id fetches through content generation

The new pageId fast-path returns before runFetchPipeline runs, so generateBlocks is never executed for --page-id requests. In the new fetch-one flow this function is called with export enabled, so jobs can report pagesProcessed: 1 while producing no generated docs/images to stage and commit, which makes successful fetch-one runs a no-op for content sync.

Useful? React with 👍 / 👎.

Comment on lines 941 to 944
jobType === "fetch-ready" ||
jobType === "fetch-all" ||
jobType === "notion:fetch" ||
jobType === "notion:fetch-all" ||
jobType === "notion:translate"
);

Choose a reason for hiding this comment

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

P1 Badge Keep legacy fetch jobs marked as content mutating

Removing notion:fetch and notion:fetch-all from isContentMutatingJob regresses existing API job types that are still valid in JOB_COMMANDS/validation. Those jobs will now bypass content-repo orchestration (no runContentTask commit/push workflow and weaker preflight checks), so clients using legacy fetch types can get successful runs without the expected managed content-branch sync behavior.

Useful? React with 👍 / 👎.

@luandro luandro marked this pull request as draft March 9, 2026 22:49
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.

1 participant