• 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

50.0
/plugins/command-validator.js
1
'use strict';
2

3
const boom = require('@hapi/boom');
1✔
4
const schema = require('screwdriver-data-schema');
1✔
5
const commandSchema = schema.api.commandValidator;
1✔
6
const validator = require('screwdriver-command-validator');
1✔
7

8
/**
9
 * Hapi Command Validator Plugin
10
 *  - Validates sd-command.yaml and returns the parsed command with any
11
 *    errors associated with it
12
 * @method register
13
 * @param  {Hapi.Server}    server
14
 */
15
const commandValidatorPlugin = {
1✔
16
    name: 'command-validator',
17
    async register(server) {
UNCOV
18
        server.route({
×
19
            method: 'POST',
20
            path: '/validator/command',
21
            options: {
22
                description: 'Validate a given sd-command.yaml',
23
                notes: 'returns the parsed config, validation errors, or both',
24
                tags: ['api', 'validation', 'yaml'],
25
                plugins: {
26
                    'hapi-rate-limit': {
27
                        enabled: false
28
                    }
29
                },
30
                handler: async (request, h) => {
UNCOV
31
                    try {
×
UNCOV
32
                        const commandString = request.payload.yaml;
×
33

UNCOV
34
                        const result = await validator(commandString);
×
35

UNCOV
36
                        return h.response(result);
×
37
                    } catch (err) {
UNCOV
38
                        throw boom.badRequest(err.toString());
×
39
                    }
40
                },
41
                validate: {
42
                    payload: commandSchema.input
43
                },
44
                response: {
45
                    schema: commandSchema.output
46
                }
47
            }
48
        });
49
    }
50
};
51

52
module.exports = commandValidatorPlugin;
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