Skip to content

支持从远程站点获取列表并对配置文件指定条目试运行以提升本地测试体验 #6

Description

@LadderOperator

对于某些镜像站支持外部贡献更新genisolist的情况,贡献者往往没有镜像站服务器的权限,无法本地运行脚本来测试配置是否正确。且即便是有服务器权限,完全运行完毕检查配置正确性也会消耗大量时间。因此,我建议增加一个指定条目试运行(类似于dry-run)功能,并支持从远程站点获取文件列表并用于配置测试。

其实现思路是:

  1. 利用rsync对指定的几个下载配置条目的对应位置,可选地从远程镜像站点或本地文件系统获取文件列表
  2. 直接对这些列表处理形成json
  3. 此功能集成至genisolist.py内,以参数可选执行。

例如,当某镜像some.mirror.site的贡献者增加多个条目AA、BB、CC之后,他可以通过python genisolist.py -R some.mirror.site -T AA BB CC 从远端测试AA、BB、CC的条目试运行结果。

我们之前实现过这一功能,谨供参考:https://git.nju.edu.cn/nju-lug/NJU-Mirror-Configs/-/blob/main/scripts/genisolist/genisolist.py

usage: Mira download list generator [-h] [-d DIR] [-R REMOTE] [-T [TEST ...]]

Generate download list for Mira

options:
  -h, --help            show this help message and exit
  -d DIR, --dir DIR     Override root directory.
  -R REMOTE, --Remote REMOTE
                        [Remote Mode] Using rsync to get file list instead of reading from local filesystem. Need the base of
                        target site, for example, `mirror.nju.edu.cn`.
  -T [TEST ...], --Test [TEST ...]
                        Test specified `distro`s (multiple arguments input is supported) in INI. If Remote Mode is on, `distro`s   
                        must be specified to avoid heavy rsync job.
  -D, --Debug           Show log in debug level.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions