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

screwdriver-cd / screwdriver / #3202

25 Jul 2025 04:52PM UTC coverage: 67.669% (-27.3%) from 94.935%
#3202

push

screwdriver

web-flow
feat(3363): Update the existing endpoint to get admin for a pipeline from the specified SCM context (#3370)

1284 of 2114 branches covered (60.74%)

Branch coverage included in aggregate %.

1 of 11 new or added lines in 1 file covered. (9.09%)

1235 existing lines in 49 files now uncovered.

3417 of 4833 relevant lines covered (70.7%)

50.53 hits per line

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

44.44
/plugins/pipelines/listTriggers.js
1
'use strict';
2

3
const boom = require('@hapi/boom');
1✔
4
const joi = require('joi');
1✔
5
const schema = require('screwdriver-data-schema');
1✔
6
const { JOB_NAME } = schema.config.regex;
1✔
7
const pipelineIdSchema = schema.models.pipeline.base.extract('id');
1✔
8
const destSchema = schema.models.trigger.base.extract('dest');
1✔
9
const triggerListSchema = joi
1✔
10
    .array()
11
    .items(
12
        joi.object({
13
            jobName: JOB_NAME,
14
            triggers: joi.array().items(destSchema)
15
        })
16
    )
17
    .label('List of triggers');
18

19
module.exports = () => ({
434✔
20
    method: 'GET',
21
    path: '/pipelines/{id}/triggers',
22
    options: {
23
        description: 'Get all triggers for a given pipeline',
24
        notes: 'Returns all triggers for a given pipeline',
25
        tags: ['api', 'pipelines', 'triggers'],
26
        auth: {
27
            strategies: ['token'],
28
            scope: ['user', 'build', 'pipeline']
29
        },
30

31
        handler: async (request, h) => {
UNCOV
32
            const { pipelineFactory, triggerFactory } = request.server.app;
×
UNCOV
33
            const pipelineId = request.params.id;
×
34

UNCOV
35
            return pipelineFactory
×
36
                .get(pipelineId)
37
                .then(pipeline => {
UNCOV
38
                    if (!pipeline) {
×
UNCOV
39
                        throw boom.notFound('Pipeline does not exist');
×
40
                    }
41

UNCOV
42
                    return triggerFactory.getTriggers({ pipelineId });
×
43
                })
UNCOV
44
                .then(triggers => h.response(triggers))
×
45
                .catch(err => {
UNCOV
46
                    throw err;
×
47
                });
48
        },
49
        response: {
50
            schema: triggerListSchema
51
        },
52
        validate: {
53
            params: joi.object({
54
                id: pipelineIdSchema
55
            })
56
        }
57
    }
58
});
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