diff --git a/.github/review-references.yaml b/.github/review-references.yaml new file mode 100644 index 0000000..b95c50d --- /dev/null +++ b/.github/review-references.yaml @@ -0,0 +1,32 @@ +# Cross-repository references for the apify-factory review (apify/ai-developer, `review-references`). +version: 1 + +instructions: | + This repository emulates the Apify platform for local Actor development. Find where the pull request + makes the runtime behave differently from the real platform in a way a user would notice: status + codes, error types and messages, field names and types, defaults, ordering, pagination, limits, run + and build lifecycle, events, and what an Actor sees in its container. A difference documented in + `requirements/` (`unsupported.md`, the `501` list in `api.md`, the "Known differences" sections) is + not a finding. Back every finding with the reference file and line (create public github link fixed + to a commit you have seen). + +references: + - repository: apify/apify-core + ref: latest-release + paths: + - src/api/** + - src/packages/** + - src/daemons/** + instructions: | + The real platform: the API, storages, runs, builds, webhooks, schedules. Route handlers live under + `src/api/src/routes//`, constants and limits in `src/packages/consts/`. Compare the + endpoint the pull request implements or changes with its handler here. + - repository: apify/apify-worker + instructions: | + How the platform starts a run's container: environment variables, resources and limits, lifecycle, + events and timeouts (`src/runtime/`, `src/actor/`, `src/builds/`). Compare the runtime's driver + and build with it. + - repository: apify/apify-containerd-proxy + instructions: | + How the platform routes and proxies traffic to and from a run's container (`internal/`). Compare + the runtime's container, HTTP and Standby proxies with it. diff --git a/.github/workflows/factory_review.yaml b/.github/workflows/factory_review.yaml index 7d69beb..1262e9e 100644 --- a/.github/workflows/factory_review.yaml +++ b/.github/workflows/factory_review.yaml @@ -1,7 +1,5 @@ name: apify-factory review (AI review, and auto-approval) -# Calls the review and auto-approval pipeline in apify/ai-developer. Approvals additionally need the -# repository's `factory_auto_approve` custom property set to true. on: # Taken from the default branch, never from the pull request, so a pull request cannot rewrite # its own review pipeline. Pull request code is never checked out or executed. @@ -19,11 +17,14 @@ permissions: jobs: factory-review: - uses: apify/ai-developer/.github/workflows/_factory_review.yaml@main + uses: apify/workflows/.github/workflows/factory_review.yaml@main secrets: inherit # Paths never auto-approved here, on top of the pipeline's defaults. Proposed from the # repository's layout when this workflow was added; edit them like any other code. with: + # The cross-repository references are drafted on this ai-developer branch; back to + # `main` once they land there. + ai-developer-ref: claude/review-references policy: | { "denyGlobs": [ diff --git a/.github/workflows/platform_parity_review.yaml b/.github/workflows/platform_parity_review.yaml deleted file mode 100644 index ab7777f..0000000 --- a/.github/workflows/platform_parity_review.yaml +++ /dev/null @@ -1,75 +0,0 @@ -# Hands a pull request to the Actor Runtime Review Managed Agent. The agent is defined in -# apify/apify-tooling-orchestration (`automations/actor-runtime-review/`); it compares the pull request with how the -# real Apify platform behaves and posts its comment itself. -# -# One session per pull request: `apify-agents send` finds the agent's session carrying this pull request's -# metadata, or starts it, and delivers every push behind an interrupt, so a review of an older commit is never -# finished, let alone posted. The agent re-reads the head before posting, so a push this workflow does not run for -# (paths outside the filter) still never gets a stale comment. Closing or merging the pull request archives its -# session with `apify-agents archive`. -name: Platform parity review - -on: - pull_request: - types: [opened, synchronize, ready_for_review, closed] - paths: - - src/** - - docker/** - - Dockerfile - - requirements/** - - skills/** - -permissions: - contents: read - -# One run per pull request at a time, and of the runs waiting behind it only the newest survives, so pushes reach -# the session in order and a push that is already superseded is not sent at all. -concurrency: - group: platform-parity-review-${{ github.event.pull_request.number }} - cancel-in-progress: false - -jobs: - session: - name: ${{ github.event.action == 'closed' && 'Archive the review session' || 'Send the pull request to its review session' }} - runs-on: ubuntu-latest - # Secrets are not available to PRs from forks. A draft is not reviewed, but closing one still archives. - if: >- - github.event.pull_request.head.repo.full_name == github.repository - && (github.event.action == 'closed' || !github.event.pull_request.draft) - env: - ANTHROPIC_API_KEY: ${{ secrets.ACTOR_RUNTIME_REVIEW_KEY }} - AGENT_DIR: automations/actor-runtime-review/agents - REPOSITORY: ${{ github.repository }} - PR_NUMBER: ${{ github.event.pull_request.number }} - PR_CREATED_AT: ${{ github.event.pull_request.created_at }} - - steps: - # The tooling and the agent's ids live in apify/apify-tooling-orchestration. It is an internal repository, - # which a public one can neither call reusable workflows from nor read with its own token. - - uses: actions/checkout@v4 - with: - repository: apify/apify-tooling-orchestration - ref: master - token: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }} - - uses: astral-sh/setup-uv@v7 - - run: uv sync --all-packages - - - name: Send the push to the pull request's session - if: github.event.action != 'closed' - env: - PR_URL: ${{ github.event.pull_request.html_url }} - HEAD_SHA: ${{ github.event.pull_request.head.sha }} - run: | - uv run apify-agents send "$AGENT_DIR" \ - --metadata "repository=$REPOSITORY" --metadata "pull_request=$PR_NUMBER" \ - --created-after "$PR_CREATED_AT" --title "PR #$PR_NUMBER" \ - --message "Review this pull request: $PR_URL (head commit $HEAD_SHA)." \ - | tee -a "$GITHUB_STEP_SUMMARY" - - - name: Archive the pull request's session - if: github.event.action == 'closed' - run: | - uv run apify-agents archive "$AGENT_DIR" \ - --metadata "repository=$REPOSITORY" --metadata "pull_request=$PR_NUMBER" \ - --created-after "$PR_CREATED_AT" \ - | tee -a "$GITHUB_STEP_SUMMARY" diff --git a/CLAUDE.MD b/CLAUDE.MD index 52e022b..66fc59c 100644 --- a/CLAUDE.MD +++ b/CLAUDE.MD @@ -34,6 +34,11 @@ does not emulate). When a change alters what the runtime does for its users, update `skills/actor-runtime/SKILL.md` in the same commit - it is shipped documentation, not a README. +### Additional context + +The runtime emulates code that lives in other repositories. The most important references are defined in +[review references](./.github/review-references.yaml). + ## Contribution conventions ### Requirements (`requirements/*.md`)