Skip to content

feat(platform): ship scenarios for the GitHub connector #5310

Open

Description

@tale-code-bot

Part of #5272, split off while working on it (task TALE-365): one connector per change.

Status quo. GitHub (configs/platform/system/connectors/github/connector.yml) ships no scenarios, so github is not on SCENARIO_CONNECTORS in services/platform/lib/shared/schemas/shipped-connectors.test.ts. Its actions:

  • yaml-js live bodies: reads list_repos, get_repo, list_issues, get_issue, list_pull_requests, get_pull_request, get_pull_request_files, get_pull_request_diff, list_pull_requests_to_review, list_issue_comments, list_commits, search_code; writes create_issue, create_pull_request, merge_pull_request, create_pull_request_review, create_pull_request_review_comment, create_issue_comment, update_issue, add_labels_to_issue.
  • native, in services/platform/lib/connectors/natives/issue-import.ts and services/platform/lib/connectors/natives/issue-import-alerts.ts: reads list_import_issues, get_import_issue, refresh_import_issues, list_import_alerts, get_import_alert, refresh_import_alerts.

Asked. Give every action its scenarios, and add github to SCENARIO_CONNECTORS:

  • Each read ships at least success, empty and error, and each write success, refusal and duplicate.
  • Each error scenario raises what the action really raises: the same message, and the HTTP status only where that error carries one.
  • Prove each scenario of a yaml-js action against its live body: give SCENARIO_PROOFS in the catalog test the vendor's answer that the scenario stands for, as the Slack and Jev entries do. Given that answer, the body returns the scenario's output or throws its error.
  • Prove each scenario of a native action against its native implementation: given what its services answer in that case, the action returns the scenario's output or throws its error.
  • Use synthetic data only: the repository is public.
  • The proofs pin the scenario names, so a renamed or removed scenario fails the catalog test.

Builds on #5272's first part, the Jev connector (task TALE-365, branch feat/jev-connector-scenarios). It turns the Slack-only proof table into SCENARIO_PROOFS for every listed connector: a proof answers each request by <METHOD> <url> with the response the live host builds (toConnectorResponse), and hands the body the credential's secrets as a live call does. Start from feature-train once that change is on it.

Native actions have no live body. Their failures are the ConnectorErrors the implementation throws, each with a code of its own, while a scenario's error is a message and an optional status that the run classifies by that status. If no native connector is on SCENARIO_CONNECTORS when this change starts, it decides how the catalog test proves a native action's scenarios and how a native failure maps onto a scenario's error, and docs/{en,de,fr}/develop/connectors.md#scenarios says so: today it describes only the proof against a live body.

Notes.

  • With 26 actions it is the largest connector.
  • Two open changes touch its yml: branch feat/github-app-connector (a GitHub App auth method) and branch feat/issue-sync-mirror-labels (issue labels in the import). Whichever lands second makes the scenarios fit.

Done means: github is on SCENARIO_CONNECTORS, the catalog test proves each of its scenarios, and docs/{en,de,fr}/develop/connectors.md#scenarios stays true.

Activity

  1. added
    feat
    service: platform
    agent-ready
    on Nov 2, 2026
  2. yannickmonney commented on Nov 14, 2026

    @yannickmonney
    Contributor

    Decision

    Rule. Ship GitHub's scenarios in five units on feature-train, with one native proof convention for every native connector.

    • How a native action is proven. The catalog test runs the registered native implementation with a context built from the same proof host the live bodies use. ctx.http answers each request by <METHOD> <url> through toConnectorResponse, with the credential's secrets, ctx.endpoint and a fixed clock. Natives whose services are not HTTP get service fakes.
    • How a native failure maps onto a scenario's error.
      • The message is the thrown message.
      • The status is vendorStatusOf(thrown), absent when it returns nothing.
      • The run's cause for the thrown error (failureCauseOf before connectorFailureOf) equals the scenario error's cause in reason and params. The only exception is the error class (errorName/errorCode), which a scenario cannot carry.
    • Every shipped scenario is proven, not only those of listed connectors. This lets a connector's scenarios land in parts.
    • error may answer with an output, as duplicate may, for an action that reports a failed read in its answer. Its proof must contain a failing service answer, so it never disguises a success.

    Answers

    • Native proof: the native implementation, with ctx.http answered by <METHOD> <url>, a fixed clock and service fakes.
    • Failure mapping: the message, vendorStatusOf, and an equal cause. GitHub's 403 rate limit carries CONNECTOR_RATE_LIMITED, so ship the 429 rate limit instead.
    • Docs: docs/{en,de,fr}/develop/connectors.md#scenarios gains the native proof paragraph, the "every shipped scenario is proven" rule, and the wider error row.
    • Too big for one PR? Yes: 26 actions, five units.
    • Wait for the GitHub App and label-mirroring branches? No. Both are stale, have no PR and are based on 0.5. Whichever lands second adapts.
    • Refresh actions: their error answers under when: {report: true} with the real report (failed, notRead, retryAfter), proven with a failing GitHub answer.
    • get_import_issue / get_import_alert: a 404 is the success scenario source_gone. Their error is a 401, a 403 that is not a rate limit, or a 5xx.
    • Write duplicates: a second record for issues, comments and reviews; a 422 Validation Failed for create_pull_request; a 405 for merge_pull_request; the same record for add_labels_to_issue and update_issue. Messages are the bodies' exact sentences.

    Rationale. A scenario is only worth having if it shows what a real run records. Comparing with the run's own status and cause functions, as strictly as the existing live-body proof, checks exactly that. One harness covers live bodies and natives and avoids a fifth convention. Proving every shipped scenario tightens the test without breaking anything today, and it makes the connector splittable. The guard on error outputs keeps the minimum kinds meaningful.

    Units (all on feature-train)

    1. test(platform): native proof harness, cause check, every-shipped-scenario rule, en/de/fr docs. Extend a landed native harness if one exists. (M)
    2. feat(shared): error may answer with an output, with the catalog test requiring a failing service answer in its proof. Depends on 1. (S)
    3. feat(platform): GitHub's 12 yaml-js reads. Depends on 1. (M)
    4. feat(platform): GitHub's 8 yaml-js writes. Depends on 1. (M)
    5. feat(platform): GitHub's 6 import natives; github joins SCENARIO_CONNECTORS. Depends on 1 to 4. (M)

    Cross-issue amendments (decisions taken together with #5321):

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-readyfeatservice: platform

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions