Skip to content

Promote test -> main#94

Merged
anderdc merged 15 commits into
mainfrom
test
May 14, 2026
Merged

Promote test -> main#94
anderdc merged 15 commits into
mainfrom
test

Conversation

@anderdc
Copy link
Copy Markdown
Collaborator

@anderdc anderdc commented May 14, 2026

Summary

Promotes 6 commits from test to main:

Prod schema migration (runbook)

packages/db/ is only applied to fresh volumes, so prod needs the following SQL applied manually. Only one change in this batch: the label_events unique index from #26.

The deploy order matters — applying the index against a table that still has duplicates will fail with a unique-violation. That's the intended safety check, not a bug.

1. Merge this PR and let the new code roll out first. orIgnore() in the writer paths is a behavioral no-op until the index exists, so deploying code before the index is safe.

2. Dedupe existing rows. Idempotent; no-op on a clean table. Repeat until 0 rows affected on very large tables:

DELETE FROM label_events a
USING label_events b
WHERE a.id > b.id
  AND a.repo_full_name = b.repo_full_name
  AND a.target_number IS NOT DISTINCT FROM b.target_number
  AND a.target_type    = b.target_type
  AND a.label_name     = b.label_name
  AND a.action         = b.action
  AND a.timestamp      = b.timestamp;

3. Add the unique index CONCURRENTLY so the running app keeps writing during creation. Must run outside a transaction:

CREATE UNIQUE INDEX CONCURRENTLY IF NOT EXISTS uq_label_events_natural_key
    ON label_events (repo_full_name, target_number, target_type,
                     label_name, action, timestamp)
    NULLS NOT DISTINCT;

No other packages/db/*.sql files changed in this batch.

Test plan

  • Merge PR and confirm new code is live
  • Run the dedupe DELETE against prod; record rows affected
  • Run CREATE UNIQUE INDEX CONCURRENTLY ... and verify \d label_events shows uq_label_events_natural_key
  • Trigger a backfill on a registered repo and confirm SELECT COUNT(*) FROM label_events is unchanged after the second run

anderdc and others added 15 commits April 28, 2026 15:25
When `since` is provided, behavior is unchanged: OPEN created on/after,
CLOSED closed on/after — the scoring window.

When `since` is omitted, the response now returns all currently-OPEN
issues with no time bound and no CLOSED history. Callers asking for
"current open-issue load" no longer need a synthetic epoch-since
workaround that pulls a full all-time payload.

Lets the validator's open-issue spam-multiplier count old still-open
issues that fall outside the scoring lookback window — the gap called
out in entrius/gittensor#929 / PR #930.

Co-authored-by: anderdc <me@alexanderdc.com>
* Fix stale PR file fetch completion

* Fix stale PR file write race

* Run tests before DAS build

* Drop contributor test artifacts

* Slim stale PR file completion fix

---------

Co-authored-by: mkdev11 <MkDev11@users.noreply.github.com>
* Fix label actor role evidence

* Run tests before DAS build

* Drop contributor DB view tests

---------

Co-authored-by: mkdev11 <MkDev11@users.noreply.github.com>
* Fetch base content for deleted PR files

* Tighten deleted file content regression

* Strengthen deleted file content coverage

* Drop contributor fetcher test

---------

Co-authored-by: mkdev11 <MkDev11@users.noreply.github.com>
Branch protection on main requires a 'pr-source-check' status, but no
workflow was publishing it — leaving PRs into main perma-blocked.
Mirror the workflow used in entrius/gittensor and entrius/gittensor-ui:
enforce that PRs into main originate from 'test'.
* Make label_events writes idempotent on backfill (#25)

* Move unique index into 07_label_events.sql, drop migration files
#93)

* feat(dashboard): add slim issues endpoint to replace per-miner fan-out

New DashboardModule exposing GET /api/v1/dashboard/issues?since= for the
gittensor-ui dashboard's trend chart and Issues Solved KPI. Returns slim
issue rows (one bulk call) so the UI no longer fans out N parallel
/miners/<id>/issues requests on every dashboard mount.

The mirror is roster-blind by design: every issue is returned regardless
of author. The UI blends with the gittensor miner roster client-side to
filter to subnet authors. Validator-facing /miners/<id>/issues is
unchanged.

* style(api.module): prettier formatting

---------

Co-authored-by: anderdc <me@alexanderdc.com>
# Conflicts:
#	packages/das/src/webhook/github-fetcher.service.ts
#	packages/das/src/webhook/handlers/issue.handler.ts
#	packages/das/src/webhook/handlers/label.handler.ts
@anderdc anderdc merged commit f4f181a into main May 14, 2026
3 checks passed
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.

8 participants