From 9b0a4f7f03a164b66c9c70bb39c830dd23892d7e Mon Sep 17 00:00:00 2001 From: yanhuiling Date: Fri, 29 Oct 2021 02:11:07 +0000 Subject: [PATCH 1/2] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=20READ?= =?UTF-8?q?ME.en.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.en.md | 134 --------------------------------------------------- 1 file changed, 134 deletions(-) delete mode 100644 README.en.md diff --git a/README.en.md b/README.en.md deleted file mode 100644 index d6e4df60..00000000 --- a/README.en.md +++ /dev/null @@ -1,134 +0,0 @@ -# openEuler-Advisor - -## Description -Collection of automation tools for easily maintaining openEuler - -| Pharse | Rules | Requires | Automatic | Data & Tool | -|------------------|-----------------------|---|---|------| -| 1.Select & Fetch | 1.1 Official Release | official git/svn.. url | from spec, from other package system | [Software Metadata](#Software-Metadata) | -| | 1.2 Best Version | release note、test、user feedback | newest/stable/official/compatible version | | -| | 1.3 Best Version Notify | issue/PR | auto issue/PR | | -| 2.Package | 2.1 Meta data | summary, deps ... | from spec, from other package system | | -| | 2.2 Check Old Patch (while updating) | drop upstreamed patch; check conflict | | -| | 2.3 Python to RPM | way to build python package by pip | turn pip to rpm | | -| 3.Modify | 3.1 CVE & CVE official fix | CVE notify & official patch/commit | | -| | 3.2 Patch upstream | upstream bugzilla/git URL | auto bugzilla/PR | | -| 4.Test | 4.1 Upstream Test & Feedback | upstream test entry & feedback channel | standard test entry & auto feedback | | -| 5.Release | TODO | | | - - -## Software Metadata -### Configs -``` -version_control: git -src_repo: xxxx -tag_prefix: ^v -separator: . -``` - -**version_control** -The type of a software's version control system. -Now we support: `svn/github/git/hg/metacpan/gitlab.gnome/pypi` - -**src_repo** -The original official source url of a software. - -**tag_prefix** -The version name is not always the same with the tag name. -For example, if a software version is 1.0.0, the tag might be v1.0.0. `v` here is the prefix. - -**separator** -The separator of a software's version name. For example, if a software version is 1.0.0, the separator is `.`. - -### How to add a software metadata file -0. Please check if the metafile is already exist -1. Copy the [Template](./template.yaml) to [Database Dir](./upstream-info) -2. Rename the file name, it is suggested that the file name SHOULD be same with the repo name in `src-openeuler`. -3. Find the official source url of the software. -4. Check the version control type, the tag prefix and the separator -5. Fill the configs - -DONE! than you can create a Pull Request. - -### Metadata Database -[Database](./upstream-info) - -### Introduction of advisors -#### Enviroment Setting -##### 1. necessary packages install - pip3 install python-rpm-spec (ver>=0.10) - pip3 install PyYAML (ver>=5.3.1) - pip3 install requests (ver>=2.24.0) - yum install rpmdevtools (ver>=8.3) - pip3 install beautifulsoup4 (ver>=4.9.3) - yum install yum-utils (ver>=1.1.31) - -##### 2. json file config - ~/.gitee_personal_token.json - content format: {"user":"user_name","access_token":"token_passwd"} - - setting personal access token: https://gitee.com/profile/personal_access_tokens - -##### 3. gitee ssh config - if not config, please refer: https://gitee.com/help/articles/4181 - -##### 4. OBS config - if not config, please refer: https://openeuler.org/zh/docs/20.09/docs/ApplicationDev/%E6%9E%84%E5%BB%BARPM%E5%8C%85.html - -##### 5. Python enviroment config - if in development, you want to use the tool directly, please config Python path firstly: source ./develop_env.sh - -#### Use Instructions -##### 1. simple_update_robot.py - single package auto-upgrade: python3 simple_update_robot.py -u pkg pkg_name branch_name [-n new_version] - ep: python3 simple_update_robot.py -u pkg snappy master - - single package manual upgrade: python3 simple_update_robot.py pkg_name branch_name [-fc] [-d] [-s] [-n new_version] [-b] [-p] - ep: python3 simple_update_robot.py snappy openEuler-20.03-LTS -fc -d -s -n 1.8.1 - - multi-packages in a repo auto-upgrade: python3 simple_update_robot.py -u repo repo_name branch_name - ep: python3 simple_update_robot.py -u repo src-openeuler master - - you can config local yaml for auto upgrade, such as: upgrade-example.yaml - repositories: - - name: A-Tune - - name: python-py - - name: python-ply - if you want to specify upgrade version for some package: - repositories: - - name: A-Tune - u_ver: x.y.z - - name: python-py - - name: python-ply - then auto upgrade upgrade-example: python3 simple_update_robot.py -u repo upgrade-example master - -##### 2. oa_upgradable.py - display all tags of target package: python3 oa_upgradable.py pkg_name - ep: python3 oa_upgradable.py glibc - -##### 3. issue_report.py - - Automatically generates issue and CVE management forms (CSV) and result reports (Markdown), based on the openEuler version. - - useage: - ```bash - python3 issue_report.py -milestone "openEuler 20.03-LTS" "openEuler 20.09" -branch "openEuler-21.03" "openEuler-20.09" -outpath /Users/lilu/Downloads - ``` - - option: - > -milestone: openEuler' milestion, multiple inputs supported(e.g., "openEuler-21.03", "openEuler 21.03-RC1"). - > -branch: src-openEuler branches name, multiple inputs supported (e.g., "openEuler-21.03", "openEuler-20.09"). - > -outpath: output path for version control reports and release reports - -#### Consultation for advisors: - if any problem, please contact: licihua@huawei.com/zwfeng@huawei.com/shanshishi@huawei.com - - -​ -## Contribution - -1. Fork the repository -2. Create Feat_xxx branch -3. Commit your code -4. Create Pull Request - -- Gitee From 7993ae841c12c1220c257fca772497c1c5f3204b Mon Sep 17 00:00:00 2001 From: yanhuiling Date: Fri, 29 Oct 2021 02:11:43 +0000 Subject: [PATCH 2/2] =?UTF-8?q?Update=20README=20file.=20=E6=A0=B9?= =?UTF-8?q?=E6=8D=AE=E4=B8=AD=E6=96=87=E6=9B=B4=E6=96=B0readme=E8=8B=B1?= =?UTF-8?q?=E6=96=87=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.en.md | 241 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 241 insertions(+) create mode 100644 README.en.md diff --git a/README.en.md b/README.en.md new file mode 100644 index 00000000..f94d1865 --- /dev/null +++ b/README.en.md @@ -0,0 +1,241 @@ +# openEuler-Advisor + +## 1. Introduction + +openEuler-Advisor aims to provide automatic inspection and suggestions on routine work of the openEuler artifact repository. + +Important directories and scripts in the current project: + +(1) **upstream-info**: This directory contains upstream information of the software components in the artifact repository of openEuler. + +(2) **advisors**: This directory provides some automation scripts, including: + +2.1. **oa_upgradable.py**: a Python script based on **upstream-info**, which is used to query the upstream community version information and the recommended version of a software package. + +2.2. **simple_update_robot.py**: a Python script used to automatically upgrade software packages in src-openeuler, including downloading a source package of the recommended version, modifying the spec file, compiling the OBS locally, and creating PRs and issues. + +2.3. **check_missing_file.py**: a Python script used to inspect each repository in src-openeuler. If the spec file does not exist in a repository, you can directly create one. + +2.4. **check_source_url.py**: a Python script used to check the source address of each software package in src-openeuler. If the address is invalid or incorrect, an issue is automatically created to notify address modification. + +2.5. **create_repo.py** and **create_repo_with_srpm**: Python scripts that provide the function of creating repositories in batches. + +2.6. **which_archived.py**: a script used to check whether the upstream community of the software in the artifact repository has been archived so that the maintenance team can adjust the package maintenance policy in a timely manner. + +2.7. **check_repeated_repo.py**: a script used to check for duplicate software packages in src-openeuler. + +2.8. **psrtool.py**: a script used to query the SIG to which a software package belongs and the list of software packages managed by a SIG. + +2.9. **tc_reminder.py**: a script used to automatically create prompt information for TC members in openEuler. + +2.10. **review_tool.py**: a script used to generate the code review list of RPs in a specified software repository PR to standardize the PR review process. + +2.11. **issue_report.py**: a tool for automatically generating issue and CVE management tables (CSV files) and result reports (Markdown files). It provides the function of generating issue and CVE lists based on the openEuler version. + +(3) **prow**: This directory stores the script for connecting to the CI/CD framework PROW. + +## 2. Follow-up Plan + +1. The @solarhu team is developing a tool to query the dependencies of all components in openEuler. + +2. Optimize the **simple_update_robot.py** script to improve the automatic upgrade processing capability. + +3. Optimize **upstream-info** to cover all software in the openEuler artifact repository, and integrate all YAML files in the openEuler community into **upstream-info** for unified management. + +4. Optimize the upstream community code management protocol supported by **oa_upgradable.py** and add the support from fossil. + + +## 3. Tool Instructions + +### 3.1 YAML File Specifications + +The name of the YAML file in each src-openEuler repository must be the same as the repository name. For example, the name of the YAML file stored in the glibc repository is **glibc.yaml**, and the file is stored in the root directory of the repository. +In a YAML file, only the **version_control**, **src_repo**, **tag_prefix**, and **separator** fields need to be manually set. Other fields are automatically generated. + +#### 3.1.1 Description of the Fields in the YAML File + +##### 1. version_control + +Version control protocol used by the upstream repository. Currently, svn, git, hg, github, gnome, metacpan, pypi are supported. + +##### 2. src_repo + +Actual address of the upstream repository. You can use version_control and src_repo to download the corresponding code. + +##### 3. tag_prefix + +Version prefix in the tag of the upstream repository. If the git protocol is used, you can run the git tag command to display all tags. If the tag provided by the upstream is v1_0_1, **tag_prefix** must be set to **^v**. The correct version information can be obtained by matching **tag_prefix**. + +##### 4. separator + +Version separator in the tag. If the tag is v1_0_1 and **separator** is set to **_**, the correct version number 1.0.1 can be obtained by parsing the code. + +#### 3.1.2. Requirements and Examples of the Fields + +##### 1. src_repo + +1) If **version_control** is set to **svn**, **src_repo** requires a complete SVN repository address. For the example, see https://gitee.com/openeuler/openEuler-Advisor/blob/master/upstream-info/amanda.yaml. +2) If **version_control** is set to **git**, **src_repo** requires a complete GIT repository address. For the example, see https://gitee.com/openeuler/openEuler-Advisor/blob/master/upstream-info/mdadm.yaml. + +3) If **version_control** is set to **hg**, **src_repo** requires a complete HG repository address. For the example, see https://gitee.com/openeuler/openEuler-Advisor/blob/master/upstream-info/nginx.yaml. +4) If **version_control** is set to **github**, **src_repo** requires only proj/repo and does not require a complete URL. For the example, see https://gitee.com/openeuler/openEuler-Advisor/blob/master/upstream-info/asciidoc.yaml. +5) If **version_control** is set to **gnome**, **src_repo** requires only $proj and does not require a complete URL. For the example, see https://gitee.com/openeuler/openEuler-Advisor/blob/master/upstream-info/gnome-terminal.yaml. Note that many projects on gitlab.gnome.org require access permissions, which cannot be used as the upstream code repositories. +6) If **version_control** is set to **metacpan**, **src_repo** requires only $proj and does not require a complete URL. For the example, see https://gitee.com/openeuler/openEuler-Advisor/blob/master/upstream-info/perl-Authen-SASL.yaml. Pay attention to the naming specifications on metacpan. +7) If **version_control** is set to **pypi**, **src_repo** requires only $proj and does not require a complete URL. For the example, see https://gitee.com/openeuler/openEuler-Advisor/blob/master/upstream-info/python-apipkg. Pay attention to the naming rules on PyPI. + +##### 2. tag_prefix + +The tag rule varies depending on the project. For example, if the tag is v1.1, set tag_prefix to ^v. + +##### 3. separator + +The domain separator in the tag varies according to the project. Some projects use hyphens ("-") and some use underscores ("_"). The default value is period ("."). You are advised to add double quotation marks (""). + +#### 3.1.3 Method for Verifying the Upstream Code Repository Information of Open Source Software + +##### 1) Common methods for code configuration management + + git, svn, and hg can obtain the code repository information without downloading the complete code repository. The method is as follows: + +\- git: + +``` +git ls-remote --tags $repo_url +``` + +\- svn: + + svn ls -v $repo_url/tags + +\- hg: + + curl $repo_url/json-tags + +##### 2) Common methods to use code hosting websites + +\- GitHub + + curl https://api.github.com/repos/$user/$repo/release + + A list of complete release information in JSON format can be obtained. Not all projects support this function. + + curl https://api.github.com/repos/$user/$repo/tags + + A list of complete tag information in JSON format can be obtained. Not all projects support this function, and this information has been found to be wrong for some projects. + +\- metacpan + + curl https://fastapi.metacpan.org/release/$repo + + The latest version information in JSON format can be obtained. + +\- pypi + + curl https://pypi.org/pypi/$repo/json + + The information about the latest version of the project can be obtained. + +- Use of tag_prefix and tag_pattern + + The tag information of some software uses prefixes, such as release-1.2.3 or v1.2.3. + + If **tag_prefix** is set, the same prefix is deleted from all tag strings. + + For example, a piece of software has two tags: 1.2.3 and release-1.2.2. If **tag_prefix** is set to release-, the processed tags are 1.2.3 and 1.2.2. + + **tag_pattern** is used for more complex forms and is not recommended. + +- Use of separator + + If separator is set, a character can be replaced with a period (.). + + For some software, the separator for tag domain division is not period (.). In this case, you can set a separator to standardize the version tags. + + If the separator for tag domain division is period (.), setting separator does not affect the result. + +### 3.2 Introduction to Advisors +#### 3.2.1 Environment Configuration +##### a. Install necessary software packages. +``` + pip3 install python-rpm-spec (ver>=0.10) + pip3 install PyYAML (ver>=5.3.1) + pip3 install requests (ver>=2.24.0) + yum install rpmdevtools (ver>=8.3) + pip3 install beautifulsoup4 (ver>=4.9.3) + yum install yum-utils (ver>=1.1.31) + yum install libabigail (ver>=1.6) +``` + +##### b. Configure JSON files. +``` + Run the ~/.gitee_personal_token.json command to create a JSON file. + JSON file format: {"user":"gitee_user_name","access_token":"token_password"} + + Entry for setting the Gitee token password: https://gitee.com/profile/personal_access_tokens +``` + +##### c. Configure the Gitee SSH. +``` + If Gitee SSH is not configured, see https://gitee.com/help/articles/4181. +``` + +##### d. Configure the OBS. +``` + If OBS is not configured, see https://www.openeuler.org/en/. +``` + +##### e. Configure the Python environment. +``` + To use this tool in the development state, configure the Python environment path: source ./develop_env.sh. +``` + +#### 3.2.2 Usage Description +##### a. simple_update_robot.py +``` +Automatic upgrade of a single software package: python3 simple_update_robot.py -u pkg pkg_name branch_name [-n new_version] +Example: python3 simple_update_robot.py -u pkg snappy master + +Manual upgrade of a single software package: python3 simple_update_robot.py pkg_name branch_name [-fc] [-d] [-s] [-n new_version] [-b] [-p] +Example: python3 simple_update_robot.py snappy openEuler-20.03-LTS -fc -d -s -n 1.8.1 + +Upgrade of a repository containing multiple software packages: python3 simple_update_robot.py -u repo repo_name branch_name +Example: python3 simple_update_robot.py -u repo src-openeuler master + +Users can configure an automatic upgrade YAML file in the local working directory, for example, upgrade-example.yaml. + repositories: + + - name: A-Tune + - name: python-py + - name: python-ply + If you want to specify an upgrade version for some software packages, you can configure as follows: + repositories: + - name: A-Tune + u_ver: x.y.z + - name: python-py + - name: python-ply + Then use a tool to automatically upgrade upgrade-example: python3 simple_update_robot.py -u repo upgrade-example master. +``` + +##### b. oa_upgradable.py +``` +Query the upstream community information and recommended version of the software package: python3 oa_upgradable.py pkg_name +Example: python3 oa_upgradable.py glibc +``` + +##### c. issue_report.py +> ``` +> Operating environment: Python 3.8 or later +> Tool use: +> +> ```bash +> python3 issue_report.py -milestone "openEuler 20.03-LTS" "openEuler 20.09" -branch "openEuler-21.03" "openEuler-20.09" -outpath /Users/lilu/Downloads +> ``` +> Parameter description: +> +> > -milestone: milestone of the openEuler version. Multiple milestone names can be entered. For example, "openEuler-21.03" and "openEuler 21.03-RC1". +> > -branch: branch name of the src-openEuler repositories. Multiple branch names can be entered. For example, "openEuler-21.03" and "openEuler-20.09". +> > -outpath:path where the version management report and version release report are generated. +> ``` + +#### 3.2.3 Advisors Consultant +If you have any other questions, send an email to licihua@huawei.com/zwfeng@huawei.com/shanshishi@huawei.com. \ No newline at end of file -- Gitee