• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

decentraland / squid-management-server / 24798481661
54%
main: 48%

Build:
Build:
LAST BUILD BRANCH: security/pin-github-actions-sha
DEFAULT BRANCH: main
Ran 22 Apr 2026 07:33PM UTC
Jobs 1
Files 13
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

22 Apr 2026 07:32PM UTC coverage: 51.332% (+5.8%) from 45.54%
24798481661

Pull #75

github

LautaroPetaccio
refactor: extract purge queries to queries.ts and reuse existing ones

The queries used by purgeOldSchemas were inlined in component.ts; move
them next to the other SQL builders and, while doing so, drop a
duplicate of the already-existing getSchemaByServiceNameQuery.

New exports in src/ports/squids/queries.ts:
- getSquidSchemasQuery() — enumerates schema_name LIKE 'squid_%'.
- getSchemaAgesQuery(schemas) — MAX(indexers.created_at) per schema.
- getActivelyPromotedSchemasQuery() — the currently promoted set.
- buildDropSchemaStatement(schema) — returns the plain-string
  `DROP SCHEMA <name> CASCADE` with identifier escaping, because
  the name is an identifier and not a parameterisable value.
- getDeleteIndexersBySchemaQuery(schema) — removes the indexers
  rows that reference a dropped schema.

The running-service lookup now reuses getSchemaByServiceNameQuery
instead of re-writing the same statement inline.

Testing fallout:
- jest.mock('../../src/ports/squids/queries') was auto-mocking every
  export, so my SQL-text-based router in the purge tests was seeing
  undefined statements. Replaced the bare jest.mock with a factory
  that keeps the real implementations and only stubs getPromoteQuery
  (the promote test's existing stub).
- The router's "latest schema per service" branch was also matching
  against "FROM public.indexers WHERE service" as a contiguous
  substring; the real getSchemaByServiceNameQuery splits that across
  a newline. Loosened the check to `public.indexers` + `WHERE service`.
- ECS mocks for the happy-path purge test switched from
  `mockImplementation` with `instanceof` checks to
  `mockResolvedValueOnce` chains (jest auto-mocked classes don't
  preserve instanceof reliably, so the instanceof branches were
  silently falling through).
Pull Request #75: Purge old, unused squid schemas on a daily schedule

72 of 160 branches covered (45.0%)

Branch coverage included in aggregate %.

66 of 86 new or added lines in 3 files covered. (76.74%)

1 existing line in 1 file now uncovered.

217 of 403 relevant lines covered (53.85%)

5.07 hits per line

Uncovered Changes

Lines Coverage ∆ File
18
0.0
0.0% src/components.ts
2
74.79
8.12% src/ports/squids/component.ts

Coverage Regressions

Lines Coverage ∆ File
1
0.0
0.0% src/components.ts
Jobs
ID Job ID Ran Files Coverage
1 24798481661.1 22 Apr 2026 07:33PM UTC 13
51.33
GitHub Action Run
Source Files on build 24798481661
  • Tree
  • List 13
  • Changed 4
  • Source Changed 0
  • Coverage Changed 4
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Pull Request #75
  • PR Base - chore/dependency-overhaul (#24787181135)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc