def fetch_file_name(patch_url):
    """ fetch zuul file name from a gerrit URL
    :param patch_url: Gerrit patch URL in a string format
    :returns file_name: string
    """
    splitted_patch_url = [x for x in patch_url.split('/') if x]
    if 'yaml' in splitted_patch_url[-1]:
        if splitted_patch_url[-2] == 'zuul.d':
            return splitted_patch_url[-2] + '%2F' + splitted_patch_url[-1]
        return splitted_patch_url[-1]
    raise Exception(f'No zuul yaml provided in : {patch_url}')