• 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

37.5
/plugins/pipelines/latestCommitEvent.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 getSchema = schema.models.event.get;
1✔
7
const idSchema = schema.models.pipeline.base.extract('id');
1✔
8

9
module.exports = () => ({
434✔
10
    method: 'GET',
11
    path: '/pipelines/{id}/latestCommitEvent',
12
    options: {
13
        description: 'Get latest commit event for a given pipeline',
14
        notes: 'Return latest commit event',
15
        tags: ['api', 'pipelines'],
16
        auth: {
17
            strategies: ['token'],
18
            scope: ['user', 'build', 'pipeline']
19
        },
20

21
        handler: async (request, h) => {
UNCOV
22
            const { eventFactory } = request.server.app;
×
23

UNCOV
24
            return eventFactory
×
25
                .list({
26
                    params: {
27
                        pipelineId: request.params.id,
28
                        parentEventId: null,
29
                        type: 'pipeline'
30
                    },
31
                    paginate: {
32
                        count: 1
33
                    }
34
                })
35
                .then(async events => {
UNCOV
36
                    if (!events || Object.keys(events).length === 0) {
×
UNCOV
37
                        throw boom.notFound('Event does not exist');
×
38
                    }
39

UNCOV
40
                    return h.response(await events[0].toJson());
×
41
                })
42
                .catch(err => {
UNCOV
43
                    throw err;
×
44
                });
45
        },
46
        response: {
47
            schema: getSchema
48
        },
49
        validate: {
50
            params: joi.object({
51
                id: idSchema
52
            })
53
        }
54
    }
55
});
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