EOX GitLab Instance
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
vs-starter
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
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
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Data Handling
vs-starter
Commits
e6d9fdf8
Commit
e6d9fdf8
authored
5 months ago
by
Bernhard Mallinger
Browse files
Options
Downloads
Patches
Plain Diff
Use collection name as default product type name
parent
fb4a515a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!7
values simplification tool
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
update_values/main.py
+14
-0
14 additions, 0 deletions
update_values/main.py
update_values/test_main.py
+11
-0
11 additions, 0 deletions
update_values/test_main.py
with
25 additions
and
0 deletions
update_values/main.py
+
14
−
0
View file @
e6d9fdf8
...
...
@@ -22,6 +22,20 @@ class ConfigChange(BaseModel):
product_types
:
list
[
ProductType
]
preprocessing_config
:
str
|
None
=
None
@classmethod
def
model_validate
(
cls
,
obj
:
dict
,
**
kwargs
,
):
# set default product type name
for
product_type
in
obj
.
get
(
"
product_types
"
,
[]):
if
not
product_type
.
get
(
"
name
"
):
product_type
[
"
name
"
]
=
obj
.
get
(
"
collection
"
)
return
super
().
model_validate
(
obj
,
**
kwargs
)
@click.command
()
@click.argument
(
"
config-change-file
"
,
type
=
click
.
File
(
"
r
"
))
@click.argument
(
...
...
This diff is collapsed.
Click to expand it.
update_values/test_main.py
+
11
−
0
View file @
e6d9fdf8
...
...
@@ -73,3 +73,14 @@ def test_change_2(change_file):
assert
values
==
yaml
.
safe_load
(
Path
(
"
./update_values/test-values/viewserver2/output-values.yaml
"
).
open
()
)
def
test_collection_name_is_default_product_type_name
():
config_change
=
ConfigChange
.
model_validate
(
{
"
stack
"
:
1
,
"
collection
"
:
"
yeah
"
,
"
product_types
"
:
[{
"
coverage_type
"
:
"
RGB
"
}],
}
)
assert
config_change
.
collection
==
config_change
.
product_types
[
0
].
name
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