Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
renovate
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GitHub Mirror
Renovate Bot
renovate
Commits
63151a42
Unverified
Commit
63151a42
authored
4 months ago
by
Michael Kriese
Committed by
GitHub
4 months ago
Browse files
Options
Downloads
Patches
Plain Diff
fix(worker/autodiscover): retain repo order on filtering (#32402)
parent
f66b8f9a
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/workers/global/autodiscover.spec.ts
+3
-1
3 additions, 1 deletion
lib/workers/global/autodiscover.spec.ts
lib/workers/global/autodiscover.ts
+5
-1
5 additions, 1 deletion
lib/workers/global/autodiscover.ts
with
8 additions
and
2 deletions
lib/workers/global/autodiscover.spec.ts
+
3
−
1
View file @
63151a42
...
...
@@ -167,9 +167,11 @@ describe('workers/global/autodiscover', () => {
hostRules
.
find
=
jest
.
fn
(()
=>
({
token
:
'
abc
'
,
}));
// retains order
const
expectedRepositories
=
[
'
another-project/repo
'
,
'
department/dev/aProject
'
,
'
another-project/repo
'
,
'
department/dev/bProject
'
,
];
ghApi
.
getRepos
=
jest
.
fn
(()
=>
Promise
.
resolve
([
...
...
This diff is collapsed.
Click to expand it.
lib/workers/global/autodiscover.ts
+
5
−
1
View file @
63151a42
...
...
@@ -51,6 +51,10 @@ export async function autodiscoverRepositories(
}
logger
.
debug
(
`Autodiscovered
${
discovered
.
length
}
repositories`
);
logger
.
trace
(
{
length
:
discovered
.
length
,
repositories
:
discovered
},
`Autodiscovered repositories`
,
);
if
(
autodiscoverFilter
)
{
logger
.
debug
({
autodiscoverFilter
},
'
Applying autodiscoverFilter
'
);
...
...
@@ -116,5 +120,5 @@ export function applyFilters(repos: string[], filters: string[]): string[] {
matched
.
add
(
repository
);
}
}
return
[...
matched
]
;
return
repos
.
filter
((
repository
)
=>
matched
.
has
(
repository
))
;
}
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