def METHOD_NAME(dir: str, branch: str):
    submodules = get_relevant_submodules(dir)
    fail_count = 0
    for submodule in submodules["couchbasedeps"]:
        check_result = check_couchbasedeps_commit(dir + submodule)
        if check_result == MatchType.NONE:
            print(submodule.ljust(40, "."), colored("[FAIL]", "red"))
            print(colored('\tcurrent branch is', 'cyan'), get_current_branch(dir + submodule))
            fail_count += 1
        else:
            print(submodule.ljust(40, "."), colored("[OK]", "green"))
            if check_result == MatchType.TAG:
                tag = subprocess.run("git name-rev --tags --name-only HEAD".split(), capture_output=True, cwd=dir + submodule) \
                    .stdout.decode("utf-8").strip()
                print(colored('\tOn upstream tag', 'cyan'), tag)
            else:
                print(colored('\tOn branch', 'cyan'), get_nearby_couchbase_branch(dir + submodule))
    for submodule in submodules["other"]:
        child_branch = check_other_commit(dir + submodule, branch)
        if not child_branch:
            print(submodule.ljust(40, "."), colored("[FAIL]", "red"))
            print(colored('\tcurrent branch is', 'cyan'), get_current_branch(dir + submodule), 'expected', branch)
            fail_count += 1
        else:
            print(submodule.ljust(40, "."), colored("[OK]", "green"))
            print(colored('\tOn branch', 'cyan'), child_branch)
    return fail_count