Skip to content

Commit f380180

Browse files
authored
Merge pull request #469 from mitodl/jkachel/fix-channel-lookup
Make sure there's a channel for Doof to talk to before adding it to the list of repos
2 parents b77fb2c + e3c564f commit f380180

2 files changed

Lines changed: 16 additions & 1 deletion

File tree

lib.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ def load_repos_info(channel_lookup):
344344
versioning_strategy=repo_info.get("versioning_strategy", FILE_VERSION),
345345
)
346346
for repo_info in repos_info["repos"]
347-
if repo_info.get("repo_url")
347+
if repo_info.get("repo_url") and repo_info.get("channel_name") and channel_lookup.get(repo_info.get("channel_name"))
348348
]
349349

350350
# some basic validation for sanity checking

lib_test.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,21 @@ async def test_load_repos_info(mocker):
211211
"packaging_tool": "none",
212212
"versioning_strategy": FILE_VERSION,
213213
},
214+
{
215+
"name": "bad-no-channel",
216+
"repo_url": "https://github.com/mitodl/ocw-hugo-projects.git",
217+
"project_type": "library",
218+
"packaging_tool": "none",
219+
"versioning_strategy": FILE_VERSION,
220+
},
221+
{
222+
"name": "bad-nonexistant-channel",
223+
"repo_url": "https://github.com/mitodl/ocw-hugo-projects.git",
224+
"channel_name": "ghost-channel",
225+
"project_type": "library",
226+
"packaging_tool": "none",
227+
"versioning_strategy": FILE_VERSION,
228+
},
214229
]
215230
},
216231
)

0 commit comments

Comments
 (0)