Skip to content

Commit

Permalink
fix: add defaultName and defaultUri for sonar system auto population …
Browse files Browse the repository at this point in the history
…[1] (#540)
  • Loading branch information
adong authored Nov 8, 2023
1 parent dd4d7fe commit 36894c5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
14 changes: 11 additions & 3 deletions models/pipeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,19 @@ const mutate = require('../lib/mutate');

const STATES = ['ACTIVE', 'INACTIVE'];
const BADGE = Joi.object({
name: Joi.string().max(128).description('The dashboard name for a badge').example('screwdriver/ui'),
defaultName: Joi.string()
.max(128)
.description('Auto populated dashboard name for a badge')
.example('screwdriver/ui'),
defaultUri: Joi.string()
.max(500)
.description('Auto populated url for the badge application dashboard')
.example('https://sonar.screwdriver.cd/dashboard?id=112233'),
name: Joi.string().max(128).description('The dashboard name for a badge').example('my-screwdriver/ui'),
uri: Joi.string()
.max(500)
.description('Unique identifier for the badge application dashboard')
.example('https://sonar.screwdriver.cd/dashboard?id=112233')
.description('The url the badge application dashboard')
.example('https://my-sonar.screwdriver.cd/dashboard?id=112233')
});

const CREATE_MODEL = {
Expand Down
7 changes: 5 additions & 2 deletions test/data/pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,8 @@ scmRepo:
state: ACTIVE
badges:
sonar:
name: screwdriver-cd/screwdriver
uri: https://sonar.screwdriver.cd/dashboard?id=123123
name: my-screwdriver-cd/screwdriver
uri: https://beta.sonar.screwdriver.cd/dashboard?id=123123
defaultName: screwdriver-cd/screwdriver
defaultUri: https://sonar.screwdriver.cd/dashboard?id=123123

0 comments on commit 36894c5

Please sign in to comment.