Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
renovate
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SmartDataLab
public
applications
renovate
Commits
867c0133
Unverified
Commit
867c0133
authored
3 years ago
by
Tom Bowden
Committed by
GitHub
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
fix(manager/mix): Support umbrella projects (#11854)
Co-authored-by:
Rhys Arkins
<
rhys@arkins.net
>
parent
78a8272c
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
lib/manager/mix/artifacts.spec.ts
+5
-5
5 additions, 5 deletions
lib/manager/mix/artifacts.spec.ts
lib/manager/mix/artifacts.ts
+3
-2
3 additions, 2 deletions
lib/manager/mix/artifacts.ts
lib/manager/mix/extract.ts
+3
-2
3 additions, 2 deletions
lib/manager/mix/extract.ts
with
11 additions
and
9 deletions
lib/manager/mix/artifacts.spec.ts
+
5
−
5
View file @
867c0133
...
@@ -84,7 +84,7 @@ describe('manager/mix/artifacts', () => {
...
@@ -84,7 +84,7 @@ describe('manager/mix/artifacts', () => {
jest
.
spyOn
(
docker
,
'
removeDanglingContainers
'
).
mockResolvedValueOnce
();
jest
.
spyOn
(
docker
,
'
removeDanglingContainers
'
).
mockResolvedValueOnce
();
setGlobalConfig
({
...
adminConfig
,
binarySource
:
'
docker
'
});
setGlobalConfig
({
...
adminConfig
,
binarySource
:
'
docker
'
});
fs
.
readLocalFile
.
mockResolvedValueOnce
(
'
Old mix.lock
'
);
fs
.
readLocalFile
.
mockResolvedValueOnce
(
'
Old mix.lock
'
);
fs
.
getSiblingFileName
.
mockRe
turn
ValueOnce
(
'
mix.lock
'
);
fs
.
findLocalSiblingOrParent
.
mockRe
solved
ValueOnce
(
'
mix.lock
'
);
const
execSnapshots
=
mockExecAll
(
exec
);
const
execSnapshots
=
mockExecAll
(
exec
);
fs
.
readLocalFile
.
mockResolvedValueOnce
(
'
New mix.lock
'
);
fs
.
readLocalFile
.
mockResolvedValueOnce
(
'
New mix.lock
'
);
expect
(
expect
(
...
@@ -102,7 +102,7 @@ describe('manager/mix/artifacts', () => {
...
@@ -102,7 +102,7 @@ describe('manager/mix/artifacts', () => {
jest
.
spyOn
(
docker
,
'
removeDanglingContainers
'
).
mockResolvedValueOnce
();
jest
.
spyOn
(
docker
,
'
removeDanglingContainers
'
).
mockResolvedValueOnce
();
setGlobalConfig
({
...
adminConfig
,
binarySource
:
'
docker
'
});
setGlobalConfig
({
...
adminConfig
,
binarySource
:
'
docker
'
});
fs
.
readLocalFile
.
mockResolvedValueOnce
(
'
Old mix.lock
'
);
fs
.
readLocalFile
.
mockResolvedValueOnce
(
'
Old mix.lock
'
);
fs
.
getSiblingFileName
.
mockRe
turn
ValueOnce
(
'
mix.lock
'
);
fs
.
findLocalSiblingOrParent
.
mockRe
solved
ValueOnce
(
'
mix.lock
'
);
const
execSnapshots
=
mockExecAll
(
exec
);
const
execSnapshots
=
mockExecAll
(
exec
);
fs
.
readLocalFile
.
mockResolvedValueOnce
(
'
New mix.lock
'
);
fs
.
readLocalFile
.
mockResolvedValueOnce
(
'
New mix.lock
'
);
hostRules
.
find
.
mockReturnValueOnce
({
token
:
'
valid_test_token
'
});
hostRules
.
find
.
mockReturnValueOnce
({
token
:
'
valid_test_token
'
});
...
@@ -141,7 +141,7 @@ describe('manager/mix/artifacts', () => {
...
@@ -141,7 +141,7 @@ describe('manager/mix/artifacts', () => {
it
(
'
returns updated mix.lock in subdir
'
,
async
()
=>
{
it
(
'
returns updated mix.lock in subdir
'
,
async
()
=>
{
setGlobalConfig
({
...
adminConfig
,
binarySource
:
'
docker
'
});
setGlobalConfig
({
...
adminConfig
,
binarySource
:
'
docker
'
});
fs
.
getSiblingFileName
.
mockRe
turn
ValueOnce
(
'
subdir/mix.lock
'
);
fs
.
findLocalSiblingOrParent
.
mockRe
solved
ValueOnce
(
'
subdir/mix.lock
'
);
mockExecAll
(
exec
);
mockExecAll
(
exec
);
expect
(
expect
(
await
updateArtifacts
({
await
updateArtifacts
({
...
@@ -156,7 +156,7 @@ describe('manager/mix/artifacts', () => {
...
@@ -156,7 +156,7 @@ describe('manager/mix/artifacts', () => {
it
(
'
catches write errors
'
,
async
()
=>
{
it
(
'
catches write errors
'
,
async
()
=>
{
fs
.
readLocalFile
.
mockResolvedValueOnce
(
'
Current mix.lock
'
);
fs
.
readLocalFile
.
mockResolvedValueOnce
(
'
Current mix.lock
'
);
fs
.
getSiblingFileName
.
mockRe
turn
ValueOnce
(
'
mix.lock
'
);
fs
.
findLocalSiblingOrParent
.
mockRe
solved
ValueOnce
(
'
mix.lock
'
);
fs
.
writeLocalFile
.
mockImplementationOnce
(()
=>
{
fs
.
writeLocalFile
.
mockImplementationOnce
(()
=>
{
throw
new
Error
(
'
not found
'
);
throw
new
Error
(
'
not found
'
);
});
});
...
@@ -174,7 +174,7 @@ describe('manager/mix/artifacts', () => {
...
@@ -174,7 +174,7 @@ describe('manager/mix/artifacts', () => {
it
(
'
catches exec errors
'
,
async
()
=>
{
it
(
'
catches exec errors
'
,
async
()
=>
{
fs
.
readLocalFile
.
mockResolvedValueOnce
(
'
Current mix.lock
'
);
fs
.
readLocalFile
.
mockResolvedValueOnce
(
'
Current mix.lock
'
);
fs
.
getSiblingFileName
.
mockRe
turn
ValueOnce
(
'
mix.lock
'
);
fs
.
findLocalSiblingOrParent
.
mockRe
solved
ValueOnce
(
'
mix.lock
'
);
exec
.
mockImplementationOnce
(()
=>
{
exec
.
mockImplementationOnce
(()
=>
{
throw
new
Error
(
'
exec-error
'
);
throw
new
Error
(
'
exec-error
'
);
});
});
...
...
This diff is collapsed.
Click to expand it.
lib/manager/mix/artifacts.ts
+
3
−
2
View file @
867c0133
...
@@ -3,7 +3,7 @@ import { TEMPORARY_ERROR } from '../../constants/error-messages';
...
@@ -3,7 +3,7 @@ import { TEMPORARY_ERROR } from '../../constants/error-messages';
import
{
logger
}
from
'
../../logger
'
;
import
{
logger
}
from
'
../../logger
'
;
import
{
ExecOptions
,
exec
}
from
'
../../util/exec
'
;
import
{
ExecOptions
,
exec
}
from
'
../../util/exec
'
;
import
{
import
{
getSiblingFileName
,
findLocalSiblingOrParent
,
readLocalFile
,
readLocalFile
,
writeLocalFile
,
writeLocalFile
,
}
from
'
../../util/fs
'
;
}
from
'
../../util/fs
'
;
...
@@ -24,7 +24,8 @@ export async function updateArtifacts({
...
@@ -24,7 +24,8 @@ export async function updateArtifacts({
return
null
;
return
null
;
}
}
const
lockFileName
=
getSiblingFileName
(
packageFileName
,
'
mix.lock
'
);
const
lockFileName
=
(
await
findLocalSiblingOrParent
(
packageFileName
,
'
mix.lock
'
))
||
'
mix.lock
'
;
try
{
try
{
await
writeLocalFile
(
packageFileName
,
newPackageFileContent
);
await
writeLocalFile
(
packageFileName
,
newPackageFileContent
);
}
catch
(
err
)
{
}
catch
(
err
)
{
...
...
This diff is collapsed.
Click to expand it.
lib/manager/mix/extract.ts
+
3
−
2
View file @
867c0133
import
{
HexDatasource
}
from
'
../../datasource/hex
'
;
import
{
HexDatasource
}
from
'
../../datasource/hex
'
;
import
{
logger
}
from
'
../../logger
'
;
import
{
logger
}
from
'
../../logger
'
;
import
{
SkipReason
}
from
'
../../types
'
;
import
{
SkipReason
}
from
'
../../types
'
;
import
{
getSiblingFileName
,
localPathExists
}
from
'
../../util/fs
'
;
import
{
findLocalSiblingOrParent
,
localPathExists
}
from
'
../../util/fs
'
;
import
type
{
PackageDependency
,
PackageFile
}
from
'
../types
'
;
import
type
{
PackageDependency
,
PackageFile
}
from
'
../types
'
;
const
depSectionRegExp
=
/defp
\s
+deps.*do/g
;
const
depSectionRegExp
=
/defp
\s
+deps.*do/g
;
...
@@ -67,7 +67,8 @@ export async function extractPackageFile(
...
@@ -67,7 +67,8 @@ export async function extractPackageFile(
}
}
}
}
const
res
:
PackageFile
=
{
deps
};
const
res
:
PackageFile
=
{
deps
};
const
lockFileName
=
getSiblingFileName
(
fileName
,
'
mix.lock
'
);
const
lockFileName
=
(
await
findLocalSiblingOrParent
(
fileName
,
'
mix.lock
'
))
||
'
mix.lock
'
;
// istanbul ignore if
// istanbul ignore if
if
(
await
localPathExists
(
lockFileName
))
{
if
(
await
localPathExists
(
lockFileName
))
{
res
.
lockFiles
=
[
lockFileName
];
res
.
lockFiles
=
[
lockFileName
];
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment