Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
77a7dbde
Commit
77a7dbde
authored
Aug 13, 2020
by
Steve Abrams
Committed by
Nicolò Maria Mezzopera
Aug 13, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Composer package installation code block
parent
fd46e8ce
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
1 deletion
+26
-1
app/assets/javascripts/packages/details/store/getters.js
app/assets/javascripts/packages/details/store/getters.js
+1
-1
changelogs/unreleased/sabrams-fix_composer_installation_code.yml
...ogs/unreleased/sabrams-fix_composer_installation_code.yml
+5
-0
spec/frontend/packages/details/store/getters_spec.js
spec/frontend/packages/details/store/getters_spec.js
+20
-0
No files found.
app/assets/javascripts/packages/details/store/getters.js
View file @
77a7dbde
...
@@ -110,6 +110,6 @@ export const composerRegistryInclude = ({ composerPath }) => {
...
@@ -110,6 +110,6 @@ export const composerRegistryInclude = ({ composerPath }) => {
return
JSON
.
stringify
(
base
);
return
JSON
.
stringify
(
base
);
};
};
export
const
composerPackageInclude
=
({
packageEntity
})
=>
{
export
const
composerPackageInclude
=
({
packageEntity
})
=>
{
const
base
=
{
package_name
:
packageEntity
.
name
};
const
base
=
{
[
packageEntity
.
name
]:
packageEntity
.
version
};
return
JSON
.
stringify
(
base
);
return
JSON
.
stringify
(
base
);
};
};
changelogs/unreleased/sabrams-fix_composer_installation_code.yml
0 → 100644
View file @
77a7dbde
---
title
:
Fix Composer installation code snippet to include package name and version
merge_request
:
39400
author
:
type
:
fixed
spec/frontend/packages/details/store/getters_spec.js
View file @
77a7dbde
...
@@ -13,6 +13,8 @@ import {
...
@@ -13,6 +13,8 @@ import {
nugetSetupCommand
,
nugetSetupCommand
,
pypiPipCommand
,
pypiPipCommand
,
pypiSetupCommand
,
pypiSetupCommand
,
composerRegistryInclude
,
composerPackageInclude
,
}
from
'
~/packages/details/store/getters
'
;
}
from
'
~/packages/details/store/getters
'
;
import
{
import
{
conanPackage
,
conanPackage
,
...
@@ -68,6 +70,10 @@ describe('Getters PackageDetails Store', () => {
...
@@ -68,6 +70,10 @@ describe('Getters PackageDetails Store', () => {
const
nugetSetupCommandStr
=
`nuget source Add -Name "GitLab" -Source "
${
registryUrl
}
" -UserName <your_username> -Password <your_token>`
;
const
nugetSetupCommandStr
=
`nuget source Add -Name "GitLab" -Source "
${
registryUrl
}
" -UserName <your_username> -Password <your_token>`
;
const
pypiPipCommandStr
=
`pip install
${
pypiPackage
.
name
}
--index-url
${
registryUrl
}
`
;
const
pypiPipCommandStr
=
`pip install
${
pypiPackage
.
name
}
--index-url
${
registryUrl
}
`
;
const
composerRegistryIncludeStr
=
'
{"type":"composer","url":"foo"}
'
;
const
composerPackageIncludeStr
=
JSON
.
stringify
({
[
packageWithoutBuildInfo
.
name
]:
packageWithoutBuildInfo
.
version
,
});
describe
(
'
packagePipeline
'
,
()
=>
{
describe
(
'
packagePipeline
'
,
()
=>
{
it
(
'
should return the pipeline info when pipeline exists
'
,
()
=>
{
it
(
'
should return the pipeline info when pipeline exists
'
,
()
=>
{
...
@@ -214,4 +220,18 @@ describe('Getters PackageDetails Store', () => {
...
@@ -214,4 +220,18 @@ describe('Getters PackageDetails Store', () => {
expect
(
pypiSetupCommand
(
state
)).
toBe
(
pypiSetupCommandStr
);
expect
(
pypiSetupCommand
(
state
)).
toBe
(
pypiSetupCommandStr
);
});
});
});
});
describe
(
'
composer string getters
'
,
()
=>
{
it
(
'
gets the correct composerRegistryInclude command
'
,
()
=>
{
setupState
({
composerPath
:
'
foo
'
});
expect
(
composerRegistryInclude
(
state
)).
toBe
(
composerRegistryIncludeStr
);
});
it
(
'
gets the correct composerPackageInclude command
'
,
()
=>
{
setupState
();
expect
(
composerPackageInclude
(
state
)).
toBe
(
composerPackageIncludeStr
);
});
});
});
});
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment