Skip to content

PR Artifacts API update - #4013

Open
BigDadBear wants to merge 2 commits into
mainfrom
bdb-pr-artifacts-api-rework
Open

BigDadBear wants to merge 2 commits into
mainfrom
bdb-pr-artifacts-api-rework

Conversation

@BigDadBear

@BigDadBear BigDadBear commented Dec 2, 2026 •

Copy link
Copy Markdown
Member

Summary

Update the PR artifact tools for the revised, number-based artifact API.

Why

The upstream API is changing its item endpoints from names to PR-scoped artifact numbers.

What changed

  • Add get and update operations by artifact number; delete also uses the number.
  • Move name-based upsert to the collection endpoint and expose artifact type.
  • Update deletion confirmation, tests, tool snapshots, and documentation.

MCP impact

  • No tool or API changes
  • Tool schema or behavior changed
  • New tool added

Get, update, and delete use artifact_number; upsert still uses name or name_key. This is a breaking API transition: coordinate deployment with the upstream change, which is not yet merged.

Prompts tested (tool changes only)

  • No natural-language prompts or live API calls were tested. Automated MCP/API tests cover list, get, upsert, update, and confirmed delete.

Security / limits

  • No security or limits impact
  • Auth / permissions considered
  • Data exposure, filtering, or token/size limits considered

GitHub enforces repository and artifact permissions; existing lockdown restrictions, response sanitization, and list pagination limits remain in place. Delete confirmation is bound to the repository, PR, and artifact number.

Tool renaming

  • I am renaming tools as part of this PR (e.g. a part of a consolidation effort)
    • I have added the new tool aliases in deprecated_tool_aliases.go
  • I am not renaming tools as part of this PR

Note: if you're renaming tools, you must add the tool aliases. For more information on how to do so, please refer to the official docs.

Lint & tests

  • Linted locally with ./script/lint
  • Tested locally with ./script/test

Both passed. Also passed UPDATE_TOOLSNAPS=true go test ./... and UPDATE_TOOLSNAPS=true go test ./pkg/github -run '^TestPullRequestArtifactTools$' -count=1.

Docs

  • Not needed
  • Updated (README / docs / examples)

script/generate-docs passed; the PR updates docs/feature-flags.md.

Skills

  • Updated relevant skills or confirmed no bundled skill applies

The existing catalog explicitly exempts both PR artifact tools because artifact management is not covered by the current bundled skills.

@BigDadBear
BigDadBear requested a review from a team as a code owner December 2, 2026 17:06
Copilot AI adaptive review requested due to automatic review settings December 2, 2026 17:07

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Coupled changes to mutation routes, commit/type semantics, and deletion-confirmation identity need maintainer validation because the authoritative API reference was unavailable (404).

No open issues 🎉

What changed in this PR

Updates the experimental PR artifact tools to support GitHub’s number-based API while retaining name-based upserts.

Changes:

  • Adds get and update operations using PR-scoped artifact numbers.
  • Updates deletion confirmation and adds artifact type support.
  • Refreshes tests, schema snapshots, and documentation.
File Description
pkg/​github/​pull_request_artifacts.go Implements number-based operations and confirmation.
pkg/​github/​pull_request_artifacts_test.go Covers new operations, validation, and request formats.
pkg/​github/​pull_request_artifact_types.go Updates tool inputs and outputs.
pkg/​github/​pull_request_artifact_names_test.go Verifies number-based targeting despite display-name collisions.
pkg/​github/​pull_request_artifact_approval_test.go Updates deletion approval tests for artifact numbers.
pkg/​github/​__toolsnaps__/​pull_request_artifact_write_ff_pull_request_artifacts.snap Records updated write schemas.
pkg/​github/​__toolsnaps__/​pull_request_artifact_read_ff_pull_request_artifacts.snap Records updated read schemas.
docs/​feature-flags.md Documents operations, artifact types, and commit selection.

Review effort: Balanced (adaptive)

Auto-generated by license-check workflow
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