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
217ea888
Unverified
Commit
217ea888
authored
1 year ago
by
RahulGautamSingh
Committed by
GitHub
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
fix: migrate hostType (#21432)
parent
0d000aea
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/config/migrations/custom/host-rules-migration.spec.ts
+30
-7
30 additions, 7 deletions
lib/config/migrations/custom/host-rules-migration.spec.ts
lib/config/migrations/custom/host-rules-migration.ts
+8
-0
8 additions, 0 deletions
lib/config/migrations/custom/host-rules-migration.ts
with
38 additions
and
7 deletions
lib/config/migrations/custom/host-rules-migration.spec.ts
+
30
−
7
View file @
217ea888
...
@@ -5,19 +5,42 @@ describe('config/migrations/custom/host-rules-migration', () => {
...
@@ -5,19 +5,42 @@ describe('config/migrations/custom/host-rules-migration', () => {
expect
(
HostRulesMigration
).
toMigrate
(
expect
(
HostRulesMigration
).
toMigrate
(
{
{
hostRules
:
[
hostRules
:
[
{
baseUrl
:
'
https://some.domain.com
'
,
token
:
'
123test
'
},
{
{
domainName
:
'
domain.com
'
,
token
:
'
123test
'
},
hostType
:
'
dotnet
'
,
baseUrl
:
'
https://some.domain.com
'
,
token
:
'
123test
'
,
},
{
hostType
:
'
adoptium-java
'
,
domainName
:
'
domain.com
'
,
token
:
'
123test
'
,
},
{
domainName
:
'
domain.com/
'
,
token
:
'
123test
'
},
{
domainName
:
'
domain.com/
'
,
token
:
'
123test
'
},
{
matchHost
:
'
domain.com/
'
,
token
:
'
123test
'
},
{
hostType
:
'
docker
'
,
matchHost
:
'
domain.com/
'
,
token
:
'
123test
'
},
{
hostName
:
'
some.domain.com
'
,
token
:
'
123test
'
},
{
hostName
:
'
some.domain.com
'
,
token
:
'
123test
'
},
],
],
}
as
any
,
}
as
any
,
{
{
hostRules
:
[
hostRules
:
[
{
matchHost
:
'
https://some.domain.com
'
,
token
:
'
123test
'
},
{
{
matchHost
:
'
domain.com
'
,
token
:
'
123test
'
},
hostType
:
'
dotnet-version
'
,
{
matchHost
:
'
https://domain.com/
'
,
token
:
'
123test
'
},
matchHost
:
'
https://some.domain.com
'
,
{
matchHost
:
'
https://domain.com/
'
,
token
:
'
123test
'
},
token
:
'
123test
'
,
},
{
hostType
:
'
java-version
'
,
matchHost
:
'
domain.com
'
,
token
:
'
123test
'
,
},
{
matchHost
:
'
https://domain.com/
'
,
token
:
'
123test
'
,
},
{
hostType
:
'
docker
'
,
matchHost
:
'
https://domain.com/
'
,
token
:
'
123test
'
,
},
{
matchHost
:
'
some.domain.com
'
,
token
:
'
123test
'
},
{
matchHost
:
'
some.domain.com
'
,
token
:
'
123test
'
},
],
],
}
}
...
...
This diff is collapsed.
Click to expand it.
lib/config/migrations/custom/host-rules-migration.ts
+
8
−
0
View file @
217ea888
import
is
from
'
@sindresorhus/is
'
;
import
is
from
'
@sindresorhus/is
'
;
import
type
{
HostRule
}
from
'
../../../types
'
;
import
type
{
HostRule
}
from
'
../../../types
'
;
import
{
AbstractMigration
}
from
'
../base/abstract-migration
'
;
import
{
AbstractMigration
}
from
'
../base/abstract-migration
'
;
import
{
migrateDatasource
}
from
'
./datasource-migration
'
;
export
class
HostRulesMigration
extends
AbstractMigration
{
export
class
HostRulesMigration
extends
AbstractMigration
{
override
readonly
propertyName
=
'
hostRules
'
;
override
readonly
propertyName
=
'
hostRules
'
;
...
@@ -25,6 +26,13 @@ export class HostRulesMigration extends AbstractMigration {
...
@@ -25,6 +26,13 @@ export class HostRulesMigration extends AbstractMigration {
continue
;
continue
;
}
}
if
(
key
===
'
hostType
'
)
{
if
(
is
.
string
(
value
))
{
newRule
.
hostType
??=
migrateDatasource
(
value
);
}
continue
;
}
if
(
if
(
key
===
'
endpoint
'
||
key
===
'
endpoint
'
||
key
===
'
host
'
||
key
===
'
host
'
||
...
...
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