From e108943eae5b21a03fe27ab6e80c90d4c9378bb7 Mon Sep 17 00:00:00 2001 From: gi1tee Date: Thu, 26 Dec 2024 16:18:38 +0800 Subject: [PATCH] =?UTF-8?q?openEuler=E8=BD=AF=E4=BB=B6=E5=8C=85=E7=89=88?= =?UTF-8?q?=E6=9C=AC=E7=9B=91=E6=8E=A7=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...EP-0000 oEEP \347\264\242\345\274\225.md" | 1 + ...21\346\216\247\351\205\215\347\275\256.md" | 75 +++++++++++++++++++ 2 files changed, 76 insertions(+) create mode 100644 "oEEP/oEEP-0020 openEuler\350\275\257\344\273\266\345\214\205\347\211\210\346\234\254\347\233\221\346\216\247\351\205\215\347\275\256.md" diff --git "a/oEEP/oEEP-0000 oEEP \347\264\242\345\274\225.md" "b/oEEP/oEEP-0000 oEEP \347\264\242\345\274\225.md" index a5f7a1f..3a48b0c 100644 --- "a/oEEP/oEEP-0000 oEEP \347\264\242\345\274\225.md" +++ "b/oEEP/oEEP-0000 oEEP \347\264\242\345\274\225.md" @@ -32,6 +32,7 @@ | 0017 | P,I | [openEuler软件质量分级&执行策略](oEEP-0017%20openEuler软件质量分级&执行策略.md) | 范佳臣@disnight (fanjiachen3 at huawei.com) | 2023-10-14 | | 0018 | D,A | [openEuler全局构建参数变更记录](oEEP-0018%20openEuler全局构建参数变更记录.md) | Funda Wang (fundawang at yeah.net) | 2024-09-16 | | 0019 | P,I | [openEuler社区部分软件包自动化管理流程](oEEP-0019%20openEuler社区部分软件包自动化管理流程.md) | 曹志 (george at openeuler.sh) | 2024-11-28 | +| 0020 | P,I | [openEuler软件包版本监控配置](oEEP-0020%20openEuler软件包版本监控配置.md) | 苟中林(gouzhonglin at huawei.com) | 2024-11-29 | ## oEEP 类型分类: - D (Document, 信息整理): 信息梳理形成的文档。此类 oEPP 包含社区索引,指南,规范或其他和 openEuler 相关的信息。 diff --git "a/oEEP/oEEP-0020 openEuler\350\275\257\344\273\266\345\214\205\347\211\210\346\234\254\347\233\221\346\216\247\351\205\215\347\275\256.md" "b/oEEP/oEEP-0020 openEuler\350\275\257\344\273\266\345\214\205\347\211\210\346\234\254\347\233\221\346\216\247\351\205\215\347\275\256.md" new file mode 100644 index 0000000..a32bb79 --- /dev/null +++ "b/oEEP/oEEP-0020 openEuler\350\275\257\344\273\266\345\214\205\347\211\210\346\234\254\347\233\221\346\216\247\351\205\215\347\275\256.md" @@ -0,0 +1,75 @@ +--- +标题: openEuler软件包版本监控配置 +类别: 流程设计 +摘要: 监控软件包上游版本 +作者: 苟中林(gouzhonglin at huawei.com) +状态: 初始化 +编号: oEEP-0020 +创建日期: 2024-11-12 +修订日期: 2024-11-12 +--- + +## 背景 +为了更好的维护和更新openEuler的软件包,软件包监控服务通过CI门禁自动监控openEuler软件包的上游软件版本和架构信息,从而解决软件包自动升级和查看软件包版本支持情况。可访问[软件中心](https://easysoftware.openeuler.org/zh/)查看软件包上游版本信息 + +## 软件包监控服务如何监控上游版本信息 + +软件包监控服务通过获取[community](https://gitee.com/openeuler/community/blob/master/sig/README.md)仓库的代码仓描述文件,解析到仓库的软件包上游信息配置,从而通过配置中的上游包链接和规则拉取到软件包的上游版本。 +实现上游软件包配置方式需要在[代码仓描述文件格式](https://gitee.com/openeuler/community/blob/master/sig/README.md#%E4%BB%A3%E7%A0%81%E4%BB%93%E6%8F%8F%E8%BF%B0%E6%96%87%E4%BB%B6%E6%A0%BC%E5%BC%8F) 中新增upstream_version字段 + +### 代码仓描述文件格式 +upstream_version 清单中每个元素代表软件包上游版本信息,以关系字典的方式呈现,需要包含以下子元素: +| 名称 | 类型 | 说明 | +| :-- | :-- | :-- | +| homepage | (必选)字符串 | 表示上游能获取到版本信息的url地址,监控服务将根据homepage字段解析获取上游版本 | +| backend | (可选)枚举类型,表示上游来源 | GitHub 表示来自 https://github.com/ 的项目
gnu 表示来自 https://gnu.com 的项目
BitBucket 表示来自 https://bitbucket.org/ 的项目
Cgit 表示来自 https://git.zx2c4.com/cgit/about/ 的项目
CPAN 表示来自 https://www.cpan.org/ 的项目
CRAN 表示来自 https://cran.r-project.org/ 的项目
crates.io 表示来自 https://crates.io/ 的项目
Debian project 表示来自 http://ftp.debian.org/debian/pool/main/ 的项目
Drupal6 表示来自 https://drupal.org/project/ 的Drupal6 项目
Drupal7 表示来自 https://drupal.org/project/ 的Drupal7 项目
folder 表示上游版本信息来自于文件夹目录结构,比如 https://sourceware.org/pub/bzip2/
Freshmeat 表示来自 http://freshmeat.net/ 或者 http://freecode.com/ 的项目
GitLab 表示来自 https://about.gitlab.com/ 的项目
Gitea 表示来自 https://docs.gitea.com/ 或者 https://forgejo.org/ 的项目
GNOME 表示来自 https://download.gnome.org/sources/ 的项目
GNU Project 表示来自 https://www.gnu.org/software/ 的项目
Gogs 表示来自 https://gogs.io/ 的项目
Google code 表示来自 https://code.google.com/ 的项目
Hackage 表示来自 https://hackage.haskell.org/ 的项目
Launchpad 表示来自 https://launchpad.net/ 的项目
Maven Central 表示来自 https://search.maven.org/ 的项目
npmjs 表示来自 https://www.npmjs.org/ 的项目
Packagist 表示来自 https://packagist.org/ 的项目
pagure 表示来自 https://pagure.io/ 的项目
PEAR 表示来自 https://pear.php.net/ 的项目
PECL 表示来自 https://pecl.php.net/ 的项目
PyPI 表示来自 https://pypi.python.org/pypi 的项目
Rubygems 表示来自 https://rubygems.org/ 的项目
Sourcefoge 表示来自 https://sourceforge.net/ 的项目
Sourceforge (git) 表示来自 https://bitbucket.org/ 的项目
SourceHut 表示来自 https://sr.ht/ 的项目
Stackage 表示来自 https://www.stackage.org/ 的项目
custom 表示来自自定义网址的项目,需要额外填写`Version URL`字段和`Regex`字段 | +| version_prefix | (可选)字符串 | 可能存在的项目版本前缀,比如,很多项目版本前缀"v" | +| Version URL | (必选)字符串 | 包含版本信息的URL | +| Regex | (必选)字符串 | 正则表达式用于解析`Version URL` | + +### 代码仓描述文件样例 +``` +- name: alluxio + description: 'alluxio' + branches: + - name: master + type: protected + type: public + upstream: + upstream_version: + homepage: https://github.com/Alluxio/alluxio + regex: (?:Alluxio\s+)?v(\d+\.\d+\.\d+) + version_url: https://github.com/Alluxio/alluxio +``` + +## 用户如何查看上游软件包版本 + +用户在向[community](https://gitee.com/openeuler/community/blob/master/sig/README.md)仓库提交PR修改代码仓描述文件(upstream_version信息)。后端门禁自动检测所配置的软件包字段是否能获取上游版本。 +考虑到backend字段是监控服务特有的字段,与软件包维护者关系不大。因此软件包维护者只需维护以下4个字段,其余字段可由后端服务自动配置。 + +1. name字段,表示软件包名称 +2. upstream_version.homepage字段,表示上游url,监控服务将根据homepage字段解析获取上游版本 +3. upstream_version.version_url字段,表示解析版本的url +4. upstream_version.regex字段,表示正则表达式,配合version_url字段解析版本. + +提交pr之后,用户查看软件包上游版本的途径 + +1. 在PR评论里看到上游软件包版本 +如果CI门禁能够根据用户提交的字段查找到上游版本,返回格式如下(例子:gcc)。 +```bash +Find upstream version of package: gcc. +The version field only indicates the version at the time of the this comment, maybe not the latest version. + +upstream_version: +- homepage: https://github.com/gcc-mirror/gcc + version: 14.2.0 +``` +如果门禁无法找到上游版本,返回格式如下(例子:gcc) + +```bash +Fail to find upstream version of package: gcc. +``` + +2. 登录[软件中心](https://easysoftware.openeuler.org/zh/)的【上游软件包全景】查看 + +由于软件包上游url比较复杂,可能无法获取上游版本。为避免影响其他业务,后端门禁不影响合入PR流程。同时可以联系 [ @aca ](https://gitee.com/gi1tee) 或者软件包的maintainer。 -- Gitee