Skip to content

Commit 6d62eae

Browse files
authored
Merge pull request #393 from DSD-DBS/t4c-commit-mapping
feat: Map TeamForCapella commits 1:1 to Git commits
2 parents 0865902 + 92f5c91 commit 6d62eae

File tree

11 files changed

+284
-122
lines changed

11 files changed

+284
-122
lines changed

cli/cdi/jupyter/build.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ def jupyter(
3434
base_image_tag = base_image_tag.format(
3535
cdi_revision=git.get_current_cdi_revision()
3636
)
37+
image_tag = image_tag.format(cdi_revision=git.get_current_cdi_revision())
3738

3839
if not skip_base_image:
3940
base_build.command(

cli/cdi/jupyter/run.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
import typer
88

9-
from cdi import args, docker, helpers
9+
from cdi import args, docker, git, helpers
1010
from cdi import logging as _logging
1111
from cdi.base import args as base_args
1212
from cdi.jupyter import build as jupyter_builder
@@ -40,6 +40,7 @@ def jupyter(
4040
_verbose: _logging.VerboseOption = False,
4141
) -> None:
4242
helpers.print_cli_options(locals(), "running Jupyter")
43+
image_tag = image_tag.format(cdi_revision=git.get_current_cdi_revision())
4344

4445
if not skip_build:
4546
jupyter_builder.jupyter(

cli/cdi/syncer/args.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,3 +156,24 @@ class FileHandler(str, enum.Enum):
156156
dir_okay=True,
157157
),
158158
]
159+
160+
161+
class CommitMapping(str, enum.Enum):
162+
EXACT = "exact"
163+
GROUPED = "grouped"
164+
165+
166+
CommitMappingOption = t.Annotated[
167+
CommitMapping,
168+
typer.Option(
169+
"--commit-mapping",
170+
help=(
171+
"Specify the commit mapping of T4C to Git commits."
172+
" With the 'exact' option, every TeamForCapella commit is mapped to an individual Git commit."
173+
" The 'exact' option is limited to 20 commits. If there are more than 20 T4C commits since the last run,"
174+
" it falls back to the 'grouped' option. The 'grouped' option creates one Git commit with all T4C changes since"
175+
" the last commit."
176+
),
177+
rich_help_panel="Importer Options",
178+
),
179+
]

cli/cdi/syncer/run.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@ def t4c2git(
218218
t4c_server_port: syncer_args.T4CServerPortOption = 2036,
219219
t4c_username: syncer_args.T4CUsername = "admin",
220220
t4c_password: syncer_args.T4CPassword = None,
221+
commit_mapping: syncer_args.CommitMappingOption = syncer_args.CommitMapping.EXACT,
221222
_verbose: _logging.VerboseOption = False,
222223
) -> None:
223224
helpers.print_cli_options(locals(), "running T4C Importer")
@@ -320,6 +321,8 @@ def t4c2git(
320321
environment["T4C_USERNAME"] = t4c_username
321322
environment["T4C_PASSWORD"] = t4c_password
322323

324+
environment["CDI_COMMIT_MAPPING"] = commit_mapping.value
325+
323326
if debug:
324327
volumes[pathlib.Path("./t4c/t4c_cli")] = pathlib.PurePosixPath(
325328
"/opt/.venv/lib/python3.11/site-packages/t4c_cli"

cli/pyproject.toml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,6 @@ exclude_also = [
5050
]
5151
skip_covered = true
5252

53-
[tool.docformatter]
54-
wrap-descriptions = 72
55-
wrap-summaries = 79
56-
5753
[tool.mypy]
5854
check_untyped_defs = true
5955
disallow_incomplete_defs = true

0 commit comments

Comments
 (0)