Skip to content

fix(selfhost): widen 2 more GitHub-id columns found via a live-schema sweep - #5062

Merged
JSONbored merged 2 commits into
mainfrom
fix/orb-github-installation-remaining-ids
Jul 11, 2026
Merged

fix(selfhost): widen 2 more GitHub-id columns found via a live-schema sweep#5062
JSONbored merged 2 commits into
mainfrom
fix/orb-github-installation-remaining-ids

Conversation

@JSONbored

@JSONbored JSONbored commented Jul 11, 2026

Copy link
Copy Markdown
Owner

Summary

Follow-up to #5059 / #5060 (merged): after that PR merged, I ran one more, more-thorough check directly against the live edge-nl-01 Postgres schema (information_schema.columns for every remaining integer column shaped like an id) rather than trusting the migration-file grep alone. It caught two the first pass missed:

  • installations.app_id -- GitHub's own numeric App id, added by a later ALTER TABLE ... ADD COLUMN migration (0071), not the original CREATE TABLE the first grep matched against.
  • orb_github_installations.account_id -- same shape, added by migration 0077.

Everything else the live-schema query surfaced was either the one already-excluded local-counter exception (orb_signals.id) or Postgres's own system catalogs (pg_locks, pg_stat_activity, etc.) -- confirmed nothing else is missing.

Both statements were dry-run validated against production before being written into code, then applied directly (the underlying bug is live and actively occurring, same as #5059/#5060).

Closes #5070

Test plan

  • npm run typecheck -- clean
  • selfhost-pg-adapter-github-id-widening.test.ts -- explicit toContain assertions for both new columns, not just the length/shape check
  • npm run test:coverage (full, unsharded) -- 719 files / 14227 tests passed, 0 failures
  • npm audit --audit-level=moderate -- 0 vulnerabilities
  • Both ALTER statements dry-run validated then applied against the live edge-nl-01 Postgres schema
  • src/selfhost/pg-adapter.ts is in codecov.yml's ignore list (Postgres runtime adapter) -- patch-coverage gate does not block on this PR

… sweep

installations.app_id and orb_github_installations.account_id were both
added by later ALTER TABLE ... ADD COLUMN migrations (0071, 0077) rather
than the original CREATE TABLE statements the first pass grepped -- a
direct information_schema query against the live edge-nl-01 schema for
every remaining integer id-shaped column caught both (everything else
that surfaced was either the one legitimate local-counter exception
already excluded, or Postgres's own system catalogs).
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@codecov

codecov Bot commented Jul 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.13%. Comparing base (3832ee3) to head (d23632f).
⚠️ Report is 6 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5062   +/-   ##
=======================================
  Coverage   94.13%   94.13%           
=======================================
  Files         465      465           
  Lines       39554    39554           
  Branches    14433    14433           
=======================================
  Hits        37235    37235           
  Misses       1664     1664           
  Partials      655      655           
Flag Coverage Δ
shard-1 46.48% <ø> (-0.02%) ⬇️
shard-2 33.45% <ø> (-0.12%) ⬇️
shard-3 31.58% <ø> (+0.25%) ⬆️
shard-4 32.69% <ø> (+0.01%) ⬆️
shard-5 33.19% <ø> (-0.24%) ⬇️
shard-6 45.14% <ø> (+0.19%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 11, 2026
@loopover-orb

loopover-orb Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Warning

🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨

⏸️ Gittensory review result - manual review recommended

Review updated: 2026-07-11 12:17:23 UTC

2 files · 1 AI reviewer · 2 blockers · readiness 93/100 · CI green · unstable

⏸️ Suggested Action - Manual Review

  • No linked issue detected — If this PR is intended to solve an issue, link it explicitly in the PR body.
  • Maintainer requires a linked issue — Link the relevant issue (for example Closes #123) before opening the PR.

Review summary
This PR adds two more `ALTER TABLE ... TYPE bigint` statements (installations.app_id, orb_github_installations.account_id) to the existing idempotent, fail-open GitHub-id widening list, and bumps the test's statement-count assertion from >=18 to >=20 to match. The change is narrow, follows the exact pattern already established and merged in #5059/#5060, is additive-only DDL, and the array/test-count math checks out (20 entries, assertion updated correctly).

Nits — 6 non-blocking
  • src/selfhost/pg-adapter.ts's block comment above `widenGithubIdColumnsToBigint` still says "all 19 ALTERs commit together" but the array now has 20 statements after this diff — update that comment to 20 so it doesn't drift further out of sync next time a column is added.
  • The updated test only asserts array length and a regex shape (as with the sibling autovacuum/widening tests), not that `installations.app_id` and `orb_github_installations.account_id` are the specific new entries — consider adding two `toContain` assertions for the new statements, mirroring the existing 'covers the column that was seen actively overflowing' test, so a future edit can't silently drop one of these two columns while still passing the length check.
  • Fix the stale '19 ALTERs' count in the comment at pg-adapter.ts (near widenGithubIdColumnsToBigint) to '20 ALTERs'.
  • Add explicit `toContain` checks for the two new ALTER statements in selfhost-pg-adapter-github-id-widening.test.ts, same style as the existing request_comment_id/response_comment_id assertions.
  • nit: src/selfhost/pg-adapter.ts:173 still says the simple-query batch contains "all 19 ALTERs" even though the list now contains 20 statements, so the comment should be updated to avoid stale operational documentation.
  • Code changes lack test evidence — Add focused regression tests or explain why existing coverage is sufficient.

Concerns raised — review before merging

  • No linked issue detected — If this PR is intended to solve an issue, link it explicitly in the PR body.
  • Maintainer requires a linked issue — Link the relevant issue (for example Closes #123) before opening the PR.
Signal Result Evidence
Code review ❌ 2 blockers 1 reviewer
Linked issue ⚠️ Missing No linked issue or no-issue rationale found.
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ✅ 20/20 Low review scope from cached public metadata (no linked issue context).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 47 registered-repo PR(s), 39 merged, 423 issue(s).
Contributor context ✅ Confirmed Gittensor contributor JSONbored; Gittensor profile; 47 PR(s), 423 issue(s).
Gate result ❌ Blocking Repo-configured hard blocker found.
Improvement ⚠️ ℹ️ None detected risk: low · value: none — No structural-improvement signals were detected for this PR.
Review context
  • Author: JSONbored
  • Role context: owner (maintainer lane)
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: not available
  • Official Gittensor activity: 47 PR(s), 423 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Treat this as maintainer-lane context rather than normal contributor-lane activity.
  • Explain no-issue PR.
  • Link the issue being solved, or explicitly explain why this is a no-issue PR.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.

🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed


💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →.

Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.

  • Re-run Gittensory review

@loopover-orb loopover-orb Bot added the manual-review Gittensor contributor context label Jul 11, 2026
- Fix the stale "19 ALTERs" comment (array has grown twice since it was
  written); rephrase to "every ALTER in the list" so a future column
  addition can't leave the same stale count behind again.
- Add explicit toContain assertions for the two new columns instead of
  relying on the length/shape check alone, mirroring the existing
  request_comment_id/response_comment_id test.

Closes #5070
@JSONbored
JSONbored merged commit 2205cde into main Jul 11, 2026
18 checks passed
@JSONbored
JSONbored deleted the fix/orb-github-installation-remaining-ids branch July 11, 2026 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. manual-review Gittensor contributor context

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Self-host Postgres: installations.app_id and orb_github_installations.account_id also overflow-risk (INTEGER)

1 participant