@@ -71,19 +71,20 @@ test.serial('Publish a release', async t => {
7171 process . env . GL_TOKEN = 'gitlab_token' ;
7272 const nextRelease = { gitHead : '123' , gitTag : 'v1.0.0' , notes : 'Test release note body' } ;
7373 const options = { branch : 'master' , repositoryUrl : `https://gitlab.com/${ owner } /${ repo } .git` } ;
74+ const encodedRepoId = encodeURIComponent ( `${ owner } /${ repo } ` ) ;
7475
7576 const gitlab = authenticate ( )
76- . get ( `/projects/${ owner } %2F ${ repo } ` )
77+ . get ( `/projects/${ encodedRepoId } ` )
7778 . reply ( 200 , { permissions : { project_access : { access_level : 30 } } } )
78- . post ( `/projects/${ owner } %2F ${ repo } /repository/tags/${ nextRelease . gitTag } /release` , {
79+ . post ( `/projects/${ encodedRepoId } /repository/tags/${ nextRelease . gitTag } /release` , {
7980 tag_name : nextRelease . gitTag ,
8081 description : nextRelease . notes ,
8182 } )
8283 . reply ( 200 ) ;
8384
8485 const result = await t . context . m . publish ( { } , { nextRelease, options, logger : t . context . logger } ) ;
8586
86- t . is ( result . url , `https://gitlab.com/${ owner } / ${ repo } /tags/${ nextRelease . gitTag } ` ) ;
87+ t . is ( result . url , `https://gitlab.com/${ encodedRepoId } /tags/${ nextRelease . gitTag } ` ) ;
8788 t . deepEqual ( t . context . log . args [ 0 ] , [ 'Verify GitLab authentication (%s)' , 'https://gitlab.com/api/v4' ] ) ;
8889 t . deepEqual ( t . context . log . args [ 1 ] , [ 'Published GitLab release: %s' , nextRelease . gitTag ] ) ;
8990 t . true ( gitlab . isDone ( ) ) ;
@@ -94,12 +95,13 @@ test.serial('Verify Github auth and release', async t => {
9495 const owner = 'test_user' ;
9596 const repo = 'test_repo' ;
9697 const options = { repositoryUrl : `https://github.com/${ owner } /${ repo } .git` } ;
98+ const encodedRepoId = encodeURIComponent ( `${ owner } /${ repo } ` ) ;
9799 const nextRelease = { gitHead : '123' , gitTag : 'v1.0.0' , notes : 'Test release note body' } ;
98100
99101 const gitlab = authenticate ( )
100- . get ( `/projects/${ owner } %2F ${ repo } ` )
102+ . get ( `/projects/${ encodedRepoId } ` )
101103 . reply ( 200 , { permissions : { project_access : { access_level : 30 } } } )
102- . post ( `/projects/${ owner } %2F ${ repo } /repository/tags/${ nextRelease . gitTag } /release` , {
104+ . post ( `/projects/${ encodedRepoId } /repository/tags/${ nextRelease . gitTag } /release` , {
103105 tag_name : nextRelease . gitTag ,
104106 description : nextRelease . notes ,
105107 } )
@@ -108,7 +110,7 @@ test.serial('Verify Github auth and release', async t => {
108110 await t . notThrows ( t . context . m . verifyConditions ( { } , { options, logger : t . context . logger } ) ) ;
109111 const result = await t . context . m . publish ( { } , { nextRelease, options, logger : t . context . logger } ) ;
110112
111- t . is ( result . url , `https://gitlab.com/${ owner } / ${ repo } /tags/${ nextRelease . gitTag } ` ) ;
113+ t . is ( result . url , `https://gitlab.com/${ encodedRepoId } /tags/${ nextRelease . gitTag } ` ) ;
112114 t . deepEqual ( t . context . log . args [ 0 ] , [ 'Verify GitLab authentication (%s)' , 'https://gitlab.com/api/v4' ] ) ;
113115 t . deepEqual ( t . context . log . args [ 1 ] , [ 'Published GitLab release: %s' , nextRelease . gitTag ] ) ;
114116 t . true ( gitlab . isDone ( ) ) ;
0 commit comments