Skip to content
content.py 59.4 KiB
Newer Older
    if participation is not None:
        if participation.preview_git_commit_sha:
            preview_sha = participation.preview_git_commit_sha
            if repo is not None:
                preview_sha_valid = is_commit_sha_valid(repo, preview_sha)
            else:
                with get_course_repo(course) as repo:
                    preview_sha_valid = is_commit_sha_valid(repo, preview_sha)
            if preview_sha_valid:
def list_flow_ids(repo: Repo_ish, commit_sha: bytes) -> list[str]:
    flow_ids = []
    try:
        flows_tree = get_repo_tree(repo, "flows", commit_sha)
    except ObjectDoesNotExist:
        # That's OK--no flows yet.
        pass
    else:
        for entry in flows_tree.items():
            if entry.path.endswith(b".yml"):
                flow_ids.append(entry.path[:-4].decode("utf-8"))

    return sorted(flow_ids)

# vim: foldmethod=marker