File tree Expand file tree Collapse file tree 5 files changed +11
-18
lines changed
datadog_checks_dev/datadog_checks/dev/tooling Expand file tree Collapse file tree 5 files changed +11
-18
lines changed Original file line number Diff line number Diff line change 27
27
'-x' : 'here' ,
28
28
}
29
29
30
+ # If we add or remove a new repo choice, make sure to keep the
31
+ # enum in ddev/src/ddev/utils/metadata.py in sync.
30
32
REPO_CHOICES = {
31
33
'core' : 'integrations-core' ,
32
34
'extras' : 'integrations-extras' ,
Original file line number Diff line number Diff line change @@ -20,20 +20,11 @@ def repo_to_override(app: Application) -> str:
20
20
pyproject_metadata ,
21
21
)
22
22
23
- repos_map = {
24
- ValidRepo .CORE : "core" ,
25
- ValidRepo .EXTRAS : "extras" ,
26
- ValidRepo .INTERNAL : "internal" ,
27
- ValidRepo .AGENT : "agent" ,
28
- ValidRepo .MARKETPLACE : "marketplace" ,
29
- ValidRepo .INTEGRATIONS_INTERNAL_CORE : "integrations-internal-core" ,
30
- }
31
-
32
23
try :
33
24
metadata = pyproject_metadata ()
34
25
if metadata is None :
35
26
raise RepoNotFoundError ()
36
- repo = repos_map [ metadata .repo ]
27
+ repo = metadata .repo . value
37
28
except (PyProjectNotFoundError , RepoNotFoundError ):
38
29
app .display_error (
39
30
"The current repo could not be inferred. Either this is not a repository or the root of "
@@ -42,7 +33,7 @@ def repo_to_override(app: Application) -> str:
42
33
43
34
repo = app .prompt (
44
35
"What repo are you trying to override? " ,
45
- type = click .Choice (list ( repos_map . values ()) ),
36
+ type = click .Choice ([ item . value for item in ValidRepo ] ),
46
37
show_choices = True ,
47
38
)
48
39
except InvalidMetadataError as e :
Original file line number Diff line number Diff line change 10
10
11
11
12
12
class ValidRepo (Enum ):
13
- CORE = "integrations- core"
14
- EXTRAS = "integrations- extras"
15
- INTERNAL = "integrations- internal"
16
- AGENT = "datadog- agent"
13
+ CORE = "core"
14
+ EXTRAS = "extras"
15
+ INTERNAL = "internal"
16
+ AGENT = "agent"
17
17
MARKETPLACE = "marketplace"
18
18
INTEGRATIONS_INTERNAL_CORE = "integrations-internal-core"
19
19
Original file line number Diff line number Diff line change 16
16
def repo_with_ddev_tool_config (repository_as_cwd : ClonedRepo ) -> Generator [ClonedRepo , None , None ]:
17
17
pyproject_path = repository_as_cwd .path / "pyproject.toml"
18
18
pyproject = load_toml_file (pyproject_path )
19
- pyproject ["tool" ]["ddev" ] = {"repo" : "integrations- core" }
19
+ pyproject ["tool" ]["ddev" ] = {"repo" : "core" }
20
20
dump_toml_data (pyproject , pyproject_path )
21
21
22
22
yield repository_as_cwd
@@ -162,4 +162,4 @@ def test_misconfigured_pyproject_fails(
162
162
result = ddev ("config" , "override" )
163
163
assert result .exit_code == 1
164
164
assert "Invalid ddev metadata found in pyproject.toml" in result .output
165
- assert "[tool.ddev.repo] is 'wrong-repo': Input should be 'integrations- core'" in result .output
165
+ assert "[tool.ddev.repo] is 'wrong-repo': Input should be 'core'" in result .output
Original file line number Diff line number Diff line change @@ -110,7 +110,7 @@ ban-relative-imports = "all"
110
110
"tests/models/config_models/deprecations.py" = [" E501" ]
111
111
112
112
[tool .ddev ]
113
- repo = " integrations- core"
113
+ repo = " core"
114
114
115
115
[project ]
116
116
name = " integrations-core"
You can’t perform that action at this time.
0 commit comments