Repository navigation
fix(coder/github-upload-public-key): follow pagination when checking existing keys - #1197
Merged
Edd88-pixel merged 1 commit intoOct 20, 2026
Conversation
…existing keys GitHub returns 30 keys per page by default, so a Coder key on a later page was missed and uploaded again. Request 100 keys per page and keep fetching until the key is found or a short page is returned.
Contributor
Module Scorecard Check
|
| Theme | Before | After |
|---|---|---|
| Presentation & Onboarding | 6 / 17 | 12 / 17 |
| Integration | — | — |
| Credential Hygiene | 20 / 20 | 20 / 20 |
| Restricted-Environment | 2 / 2 | 2 / 2 |
| Engineering Quality | 10 / 10 | 10 / 10 |
| Overall | 78 / 100 | 90 / 100 |
Full scorecard for this PR
| Presentation & Onboarding | Credential Hygiene | Restricted-Environment Readiness | Engineering Quality | Overall |
|---|---|---|---|---|
| 12 / 17 | 20 / 20 | 2 / 2 | 10 / 10 | 90 / 100 |
Drilldown
Presentation & Onboarding — 12 / 17
| Criterion | Max | Score | Notes |
|---|---|---|---|
| Configuration-mode examples | 12 | 12 | README documents all major modes: key_type (auth, signing, both) with dedicated examples, external_auth_id with a non-default-ID example, and key_name with a usage example. Sensible defaults are stated for each. |
| Visual preview | 5 | 0 | No image, GIF, or video embedded in the README. The frontmatter icon field references an SVG icon, which does not count. |
Credential Hygiene — 20 / 20
| Criterion | Max | Score | Notes |
|---|---|---|---|
| Secrets marked sensitive | 16 | 16 | No module input is a secret; the session token is obtained via data.coder_workspace_owner.me.session_token (Coder-managed). README examples contain no inline secrets in module usage. The CODER_EXTERNAL_AUTH_0_CLIENT_SECRET=xxxxxxx line documents Coder deployment prerequisites, not a module input. |
| Non-hardcoded auth path | 4 | 4 | The module uses coder external-auth access-token to obtain a GitHub token at runtime. README explicitly documents the GitHub External Auth prerequisite and the required scopes, providing a clear path that avoids pasting raw API keys into templates. |
Restricted-Environment Readiness — 2 / 2 (18 pts N/A)
| Criterion | Max | Score | Notes |
|---|---|---|---|
| Mirrorable artifact source | 5 | N/A | Module downloads and installs nothing of its own. It invokes curl, jq, and the coder CLI already present in the image. No download URL to override. |
| Bring-your-own binary | 10 | N/A | Module does not download or install any tool. curl and jq are prerequisites the user must pre-install; there is no install step to skip. |
| Egress transparency | 3 | N/A | Module downloads nothing of its own. It only calls the Coder API and the GitHub API at runtime. |
| Runs without sudo | 2 | 2 | run.sh never invokes sudo. All operations (curl, jq, coder CLI) run as the unprivileged workspace user. |
Engineering Quality — 10 / 10
| Criterion | Max | Score | Notes |
|---|---|---|---|
| Input quality | 6 | 6 | All five variables have clear description fields, sensible defaults (external_auth_id = "github", github_api_url = "https://api.github.com", key_type = "auth", key_name = null), and key_type includes a validation block restricting values to auth/signing/both. |
| Test coverage | 4 | 4 | main.tftest.hcl covers business logic (key_type default, signing, both, invalid rejection). main.test.ts provides end-to-end tests executing the actual run.sh in a container against a mock GitHub API server, covering: new key creation, custom/special-character key names, idempotency, signing-only, both, pagination, and skip-existing. |
Overall — 90 / 100
Raw 44 / 49 → round(44 / 49 × 100) = 90
Tip
You can run this locally by telling your agent: "review this module against .github/scorecard/SCORECARD.md".
Scored against SCORECARD.md with solstice-1. Language-model scores are advisory.
Collaborator
|
LGTM, thanks |
Edd88-pixel
merged commit Oct 20, 2026
779ce31
into
35C4n0r/feat-github-upload-public-key-signing
5 checks passed
Edd88-pixel
deleted the
35C4n0r/fix-github-upload-public-key-pagination
branch
October 20, 2026 18:13
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Stacked on #1193. Addresses this review comment.
GitHub's key list endpoints return 30 keys per page by default, so a Coder key beyond the first page was missed and the module tried to upload it again.
upload_keynow requestsper_page=100and keeps fetching pages until it finds the key or gets a page shorter than 100. This applies to both/user/keysand/user/ssh_signing_keys.Type of Change
Module Information
Path:
registry/coder/modules/github-upload-public-keyNew version:
v1.2.0(unreleased; same version as #1193)Breaking change: [ ] Yes [x] No
Testing & Validation
bun test): 10/10, with a new case where the key is on the second page for both endpoints. This case fails on the feat(coder/github-upload-public-key): add key_type to upload SSH signing keys #1193 script.bun fmt)Related Issues
Stacked on #1193
Note
This PR was generated by Coder Agents on behalf of @35C4n0r, using Claude.