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

supabase / storage / 26155689234

20 May 2026 10:06AM UTC coverage: 57.697% (-17.2%) from 74.874%
26155689234

Pull #1115

github

web-flow
Merge d6a84934b into 9a13d3ea2
Pull Request #1115: Encapsulate storage database transaction APIs

2784 of 5519 branches covered (50.44%)

Branch coverage included in aggregate %.

122 of 145 new or added lines in 7 files covered. (84.14%)

1665 existing lines in 69 files now uncovered.

5938 of 9598 relevant lines covered (61.87%)

407.09 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

22.73
/src/http/routes/admin/queue.ts
1
import { SYSTEM_TENANT } from '@internal/queue/constants'
2
import { MoveJobs, UpgradePgBossV10 } from '@storage/events'
3
import { FastifyInstance, RequestGenericInterface } from 'fastify'
4
import { FromSchema } from 'json-schema-to-ts'
5
import { getConfig } from '../../../config'
6
import { registerApiKeyAuth } from '../../plugins/apikey'
7

8
const { pgQueueEnable } = getConfig()
25✔
9

10
const moveJobsSchema = {
25✔
11
  body: {
12
    type: 'object',
13
    properties: {
14
      fromQueue: {
15
        type: 'string',
16
      },
17
      toQueue: {
18
        type: 'string',
19
      },
20
      deleteJobsFromOriginalQueue: {
21
        type: 'boolean',
22
        default: false,
23
      },
24
    },
25
    required: ['fromQueue', 'toQueue'],
26
  },
27
} as const
28

29
interface MoveJobsRequestInterface extends RequestGenericInterface {
30
  Body: FromSchema<typeof moveJobsSchema.body>
31
}
32

33
export default async function routes(fastify: FastifyInstance) {
34
  registerApiKeyAuth(fastify)
9✔
35

36
  fastify.post('/migrate/pgboss-v10', { schema: { tags: ['queue'] } }, async (req, reply) => {
9✔
UNCOV
37
    if (!pgQueueEnable) {
×
38
      return reply.status(400).send({ message: 'Queue is not enabled' })
×
39
    }
40

UNCOV
41
    await UpgradePgBossV10.send({
×
42
      sbReqId: req.sbReqId,
43
      tenant: SYSTEM_TENANT,
44
    })
45

UNCOV
46
    return reply.send({ message: 'Migration scheduled' })
×
47
  })
48

49
  fastify.post<MoveJobsRequestInterface>(
9✔
50
    '/move',
51
    { schema: { ...moveJobsSchema, tags: ['queue'] } },
52
    async (req, reply) => {
UNCOV
53
      if (!pgQueueEnable) {
×
54
        return reply.status(400).send({ message: 'Queue is not enabled' })
×
55
      }
56

UNCOV
57
      const fromQueue = req.body.fromQueue
×
UNCOV
58
      const toQueue = req.body.toQueue
×
UNCOV
59
      const deleteJobsFromOriginalQueue = req.body.deleteJobsFromOriginalQueue || false
×
60

UNCOV
61
      await MoveJobs.send({
×
62
        fromQueue,
63
        toQueue,
64
        deleteJobsFromOriginalQueue,
65
        sbReqId: req.sbReqId,
66
        tenant: SYSTEM_TENANT,
67
      })
68

UNCOV
69
      return reply.send({ message: 'Move jobs scheduled' })
×
70
    }
71
  )
72
}
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