added filter to decide what challenges to include
This commit is contained in:
+8
-6
@@ -8,7 +8,8 @@ There are two kinds of finding:
|
||||
* blockers (repo_blockers): the README claims Testing Ready or beyond, but the
|
||||
repo shows the challenge is not finished. A blocked challenge keeps its
|
||||
status in the counts, but is left out of "ready for infra testing" and out of
|
||||
challs.txt, so it does not get deployed.
|
||||
challs.txt, so it does not get deployed. challenges.yml can exempt a challenge
|
||||
from individual repo checks.
|
||||
|
||||
Every rule is one small function that returns what it found wrong, as a list
|
||||
of messages (empty: nothing wrong). README_CHECKS and REPO_CHECKS list the rules
|
||||
@@ -28,13 +29,13 @@ from .gitlab import Repo
|
||||
|
||||
|
||||
def is_testable(c: Challenge) -> bool:
|
||||
"""Can infra deploy and test it now? The README says Testing Ready or beyond,
|
||||
and the repo has no blockers."""
|
||||
return c.claims_testable and not c.blockers
|
||||
"""Can infra deploy and test it now? It is included in this CTF, the README
|
||||
says Testing Ready or beyond, and the repo has no blockers."""
|
||||
return c.included and c.claims_testable and not c.blockers
|
||||
|
||||
|
||||
# ---------------------------------------------------------------- README ----
|
||||
# Run on every challenge whose README somebody filled in.
|
||||
# Run on every included challenge whose README somebody filled in.
|
||||
|
||||
def status_is_clear(c: Challenge) -> list[str]:
|
||||
stage, clear = stage_of(c.fields.get("Status", ""))
|
||||
@@ -196,4 +197,5 @@ def repo_blockers(c: Challenge) -> list[str]:
|
||||
d = read_description(c.repo)
|
||||
except DescriptionError as e:
|
||||
return [str(e)]
|
||||
return [msg for check in REPO_CHECKS for msg in check(c, d)]
|
||||
return [msg for check in REPO_CHECKS if check.__name__ not in c.skip_checks
|
||||
for msg in check(c, d)]
|
||||
|
||||
Reference in New Issue
Block a user