Skip to content

Commit 97823d8

Browse files
JulienBortolussiAdaliaiss
authored andcommitted
Reduce the size of the build_space name's sha
1 parent de8b269 commit 97823d8

File tree

2 files changed

+4
-13
lines changed

2 files changed

+4
-13
lines changed

src/e3/anod/qualifiers_manager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -736,7 +736,7 @@ def build_space_name(self) -> str:
736736

737737
# Compute hash_suffix
738738
if self.hash_pool:
739-
hash_suffix = f"_{sha1(self.hash_pool.encode()).hexdigest()}"
739+
hash_suffix = f"_{sha1(self.hash_pool.encode()).hexdigest()[:8]}"
740740

741741
return self.base_name + qualifier_suffix + hash_suffix + kind_suffix
742742

tests/tests_e3/anod/test_qualifier_manager.py

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -406,28 +406,19 @@ def declare_qualifiers_and_components(self, qualifiers_manager):
406406
anod_no_component_1 = AnodNoComponent(
407407
"debug,version=1.2,path=/some/path,path_bis=/other/path", kind="build"
408408
)
409-
assert (
410-
anod_no_component_1.build_space_name
411-
== "my_spec_debug_1.2_ca656cbada5f82b1063b10f1e1adaeb11c98e6fe"
412-
)
409+
assert anod_no_component_1.build_space_name == "my_spec_debug_1.2_ca656cba"
413410
assert anod_no_component_1.component is None
414411

415412
anod_no_component_2 = AnodNoComponent(
416413
"version=1.2,path=/some/path,path_bis=/other/path", kind="build"
417414
)
418-
assert (
419-
anod_no_component_2.build_space_name
420-
== "my_spec_1.2_ca656cbada5f82b1063b10f1e1adaeb11c98e6fe"
421-
)
415+
assert anod_no_component_2.build_space_name == "my_spec_1.2_ca656cba"
422416
assert anod_no_component_2.component is None
423417

424418
anod_no_component_3 = AnodNoComponent(
425419
"debug,version=1.2,path=/different/path,path_bis=/path", kind="build"
426420
)
427-
assert (
428-
anod_no_component_3.build_space_name
429-
== "my_spec_debug_1.2_7a7d1e2193d81f68693fe880de86a1c54bfcbb2c"
430-
)
421+
assert anod_no_component_3.build_space_name == "my_spec_debug_1.2_7a7d1e21"
431422
assert anod_no_component_3.component is None
432423

433424
class AnodComponent(Anod):

0 commit comments

Comments
 (0)