• 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

28.57
/plugins/versions.js
1
'use strict';
2

3
const fs = require('fs');
1✔
4
const path = require('path');
1✔
5
const process = require('process');
1✔
6
const checker = require('license-checker');
1✔
7
const VError = require('verror');
1✔
8
const schema = require('screwdriver-data-schema');
1✔
9

10
/**
11
 * Hapi interface for plugin to return package list
12
 * @method register
13
 * @param  {Hapi.Server}    server
14
 */
15
const versionsTemplate = {
1✔
16
    name: 'versions',
17
    async register(server) {
18
        // Designed to match Screwdriver specific packages
UNCOV
19
        const SD_REGEX = /^screwdriver-/;
×
UNCOV
20
        let start = process.cwd();
×
21

UNCOV
22
        if (!fs.existsSync(path.resolve(process.cwd(), './node_modules'))) {
×
UNCOV
23
            start = path.resolve(process.cwd(), '../..');
×
24
        }
25

26
        // Load licenses
UNCOV
27
        return checker.init(
×
28
            {
29
                production: true,
30
                start
31
            },
32
            (err, json) => {
UNCOV
33
                if (err) {
×
UNCOV
34
                    return new VError(err, 'Unable to load package dependencies');
×
35
                }
UNCOV
36
                const depArray = Object.keys(json).map(key => ({ name: key, ...json[key] }));
×
UNCOV
37
                const depDisplay = depArray.map(dep => ({
×
38
                    name: dep.name.split('@').slice(0, -1).join('@'),
39
                    repository: dep.repository || 'UNKNOWN',
×
40
                    licenses: dep.licenses || 'UNKNOWN'
×
41
                }));
UNCOV
42
                const sdVersions = depArray.filter(dep => SD_REGEX.test(dep.name)).map(dep => dep.name);
×
43

UNCOV
44
                return server.route({
×
45
                    method: 'GET',
46
                    path: '/versions',
47
                    handler: (request, h) =>
UNCOV
48
                        h.response({
×
49
                            // List of Screwdriver package versions
50
                            versions: sdVersions,
51
                            // List of licenses for third-party dependencies
52
                            licenses: depDisplay
53
                        }),
54
                    config: {
55
                        description: 'API Package Versions',
56
                        notes: 'Returns list of Screwdriver package versions and third-party dependencies',
57
                        tags: ['api'],
58
                        plugins: {
59
                            'hapi-rate-limit': {
60
                                enabled: false
61
                            }
62
                        },
63
                        response: {
64
                            schema: schema.api.versions
65
                        }
66
                    }
67
                });
68
            }
69
        );
70
    }
71
};
72

73
module.exports = versionsTemplate;
1✔
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