Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
openEuler-Advisor
提交
1814be46
O
openEuler-Advisor
项目概览
openeuler
/
openEuler-Advisor
通知
35
Star
4
Fork
4
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
openEuler-Advisor
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
1814be46
编写于
7月 30, 2020
作者:
Y
Yiru Wang Mac
浏览文件
操作
浏览文件
下载
差异文件
fix search logic based on new database structure
上级
554a18fb
dec3661c
变更
9
展开全部
显示空白变更内容
内联
并排
Showing
9 changed file
with
521 addition
and
39 deletion
+521
-39
advisors/simple-update-robot.py
advisors/simple-update-robot.py
+11
-4
advisors/version_recommend.py
advisors/version_recommend.py
+381
-32
packageship/doc/design/packageLifeCycle.md
packageship/doc/design/packageLifeCycle.md
+85
-0
packageship/doc/design/pkgimg/issue_display.png
packageship/doc/design/pkgimg/issue_display.png
+0
-0
packageship/doc/design/pkgimg/lifecycle.png
packageship/doc/design/pkgimg/lifecycle.png
+0
-0
packageship/doc/design/pkgimg/lifecycle_2.png
packageship/doc/design/pkgimg/lifecycle_2.png
+0
-0
packageship/doc/design/pkgimg/lifecycle_display.png
packageship/doc/design/pkgimg/lifecycle_display.png
+0
-0
packageship/packageship/application/initsystem/data_import.py
...ageship/packageship/application/initsystem/data_import.py
+4
-0
upstream-info/PyYAML.yaml
upstream-info/PyYAML.yaml
+40
-3
未找到文件。
advisors/simple-update-robot.py
浏览文件 @
1814be46
...
@@ -21,6 +21,7 @@ import subprocess
...
@@ -21,6 +21,7 @@ import subprocess
import
os.path
import
os.path
import
re
import
re
import
datetime
import
datetime
import
version_recommend
def
download_source_url
(
spec
,
o_ver
,
n_ver
):
def
download_source_url
(
spec
,
o_ver
,
n_ver
):
"""
"""
...
@@ -91,7 +92,6 @@ def create_spec(repo, spec_str, o_ver, n_ver, src_fn=None):
...
@@ -91,7 +92,6 @@ def create_spec(repo, spec_str, o_ver, n_ver, src_fn=None):
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
pars
=
argparse
.
ArgumentParser
()
pars
=
argparse
.
ArgumentParser
()
pars
.
add_argument
(
"pkg"
,
type
=
str
,
help
=
"The package to be upgraded"
)
pars
.
add_argument
(
"pkg"
,
type
=
str
,
help
=
"The package to be upgraded"
)
pars
.
add_argument
(
"-o"
,
"--old_version"
,
type
=
str
,
help
=
"Current upstream version of package"
)
pars
.
add_argument
(
"-n"
,
"--new_version"
,
type
=
str
,
help
=
"New upstream version of package will be upgrade to"
)
pars
.
add_argument
(
"-n"
,
"--new_version"
,
type
=
str
,
help
=
"New upstream version of package will be upgrade to"
)
pars
.
add_argument
(
"-s"
,
"--create_spec"
,
help
=
"Create spec file"
,
action
=
"store_true"
)
pars
.
add_argument
(
"-s"
,
"--create_spec"
,
help
=
"Create spec file"
,
action
=
"store_true"
)
pars
.
add_argument
(
"-d"
,
"--download"
,
help
=
"Download upstream source code"
,
action
=
"store_true"
)
pars
.
add_argument
(
"-d"
,
"--download"
,
help
=
"Download upstream source code"
,
action
=
"store_true"
)
...
@@ -101,12 +101,15 @@ if __name__ == "__main__":
...
@@ -101,12 +101,15 @@ if __name__ == "__main__":
args
=
pars
.
parse_args
()
args
=
pars
.
parse_args
()
my_gitee
=
gitee
.
Gitee
()
my_gitee
=
gitee
.
Gitee
()
my_version
=
version_recommend
.
VersionType
()
spec_string
=
my_gitee
.
get_spec
(
args
.
pkg
)
spec_string
=
my_gitee
.
get_spec
(
args
.
pkg
)
s_spec
=
Spec
.
from_string
(
spec_string
)
s_spec
=
Spec
.
from_string
(
spec_string
)
cur_ver
=
replace_macros
(
s_spec
.
version
,
s_spec
)
if
args
.
fork
:
if
args
.
fork
:
my_gitee
.
fork_repo
(
args
.
pkg
)
if
not
my_gitee
.
fork_repo
(
args
.
pkg
):
print
(
"The repo of {pkg} seems to have been forked."
.
format
(
pkg
=
args
.
pkg
))
if
args
.
clone
:
if
args
.
clone
:
user
=
my_gitee
.
token
[
"user"
]
user
=
my_gitee
.
token
[
"user"
]
...
@@ -114,7 +117,7 @@ if __name__ == "__main__":
...
@@ -114,7 +117,7 @@ if __name__ == "__main__":
os
.
chdir
(
args
.
pkg
)
os
.
chdir
(
args
.
pkg
)
if
args
.
download
:
if
args
.
download
:
source_file
=
download_source_url
(
s_spec
,
args
.
old_version
,
args
.
new_version
)
source_file
=
download_source_url
(
s_spec
,
cur_ver
,
args
.
new_version
)
if
source_file
:
if
source_file
:
print
(
source_file
)
print
(
source_file
)
else
:
else
:
...
@@ -130,7 +133,11 @@ if __name__ == "__main__":
...
@@ -130,7 +133,11 @@ if __name__ == "__main__":
print
(
"I'm too naive to handle complicated package."
)
print
(
"I'm too naive to handle complicated package."
)
print
(
"This package has multiple in-house patches."
)
print
(
"This package has multiple in-house patches."
)
sys
.
exit
(
1
)
sys
.
exit
(
1
)
create_spec
(
args
.
pkg
,
spec_string
,
args
.
old_version
,
args
.
new_version
)
if
(
my_version
.
compare
(
args
.
new_version
,
cur_ver
)
==
1
):
create_spec
(
args
.
pkg
,
spec_string
,
cur_ver
,
args
.
new_version
)
else
:
print
(
"Please check version of {pkg} will upgrade to, it's current version is {version}."
.
format
(
pkg
=
args
.
pkg
,
version
=
cur_ver
))
if
args
.
PR
:
if
args
.
PR
:
my_gitee
.
create_pr
(
my_gitee
.
token
[
"user"
],
args
.
pkg
)
my_gitee
.
create_pr
(
my_gitee
.
token
[
"user"
],
args
.
pkg
)
advisors/version_recommend.py
浏览文件 @
1814be46
此差异已折叠。
点击以展开。
packageship/doc/design/packageLifeCycle.md
0 → 100644
浏览文件 @
1814be46
# 特性描述
-
SR-PKG-MANAGE02-AR01: 包静态信息建档管理
-
SR-PKG-MANAGE02-AR02: 包动态信息跟踪(生命周期)
-
SR-PKG-MANAGE01-AR11: 包补丁分类管理
-
SR-PKG-MANAGE03-AR01: 特性与包关联模块
-
支持网页前端显示
-
支持软件责任人及软件维护级别的存储和更改
# 依赖组件
-
git, svn, pypi
-
openEuler-Advisor/ upstream-info
# License
Mulan V2
# 流程分析
## 外部接口清单
| 序号 | 接口名称 | 类型 | 说明 | 入参 | 出参 | 特性号 |
| - | - | - | - | - | - | - |
| 1 | /packages | GET | 支持查看所有软件包静态信息、对应特性、动态信息及issue数量统计信息 | dbName |
*packages-info*
| all |
| 2 | /packages/packageInfo | GET | 支持查看指定软件包详细静态信息 | dbName, srcName |
*packages-info-detailed*
| MANAGE02-AR01 |
| 3 | /packages/lifeCycle | PUT | 支持更新指定软件包信息字段 | dbName, srcName, [end-of-life], [maintainer], [maintainlevel] | null | MANAGE02-AR02 |
| 4 | /packages/issueTrace | GET | 支持查看指定软件包issue详细信息 | dbName, srcName |
*packages-issue*
| MANAGE01-AR11 |
| 5 | /packages/issueTrace/patched | GET | 支持下载指定软件包指定issue的补丁包 | dbName, srcName, issueId |
*packages-issue-patched*
| MANAGE01-AR11 |
### 外部接口请求、回显格式
*
需和前台对齐回显格式
-
*packages-info*
:
静态信息:name, version, release, url, rpm_license, feature, maintainer, maintainlevel;
动态信息&动态信息统计:name, version,release, published time, end time, maintainer status, latest version, latest publish time
动态信息统计:name, version,release, 需求, cve&安全问题, 缺陷
-
*packages-info-detailed*
: name, version, release, url, rpm_license, maintainer, maintainlevel, summary, description, required, subpack, subpack-provides, subpack-requires-component, subpack-requires-binary(if exist)
-
*packages-issue*
: list: issudId, issue-url, issue-content, issue-status, issue-download
# 功能设计
## 主体流程分析
计算生命周期结束日期:
![
avatar
](
./pkgimg/lifecycle_2.png
)
## 数据表设计
针对不同的版本,设计多个字段相同,表名不同的table (注:表名应于对应依赖数据库名称相同):
-
Mainline
| 序号 | 名称 | 说明 | 类型 | 键 | 允许空 | 默认值 |
| - | - | - | - | - | - | - |
| 1 | id | 条目序号 | Int | Primary | NO | - |
| 2 | name | 源码包名 | String | NO | YES | - |
| 3 | url | URL | String | NO | YES | - |
| 4 | rpm_license | license | String | NO | YES | - |
| 5 | version | 版本号 | String | NO | YES | - |
| 6 | release | release号 | String | NO | YES | - |
| 7 | version_time | 当前版本发布时间 | String | NO | YES | - |
| 8 | end_time | 结束当前版本生命周期的时间 | String | NO | YES | - |
| 9 | maintainer_status | 生命周期状态 | String | NO | YES | "Available" |
| 10 | latest_version | 最新版本号 | String | NO | YES | - |
| 11 | latest_version_time | 最新版本发布时间 | String | NO | YES | - |
| 12 | demand | 需求 | Int | NO | NO | 0 |
| 13 | cve | cve及安全漏洞 | Int | NO | NO | 0 |
| 14 | defect | 缺陷 | Int | NO | NO | 0 |
| 15 | maintainer | 维护人 | String | NO | YES | - |
| 16 | maintainlevel | 维护级别 | Int| NO | YES | - |
| 17 | feature | 对应特性 | String | NO | YES | - |
| 18 | version_control | 版本控制(git,svn) | String | NO | YES | - |
| 19 | src_repo | 上游社区repo源 | String | NO | YES | - |
| 20 | tag_prefix | 版本标签 | String | NO | YES | - |
回显简单事例:
![
avatar
](
./pkgimg/lifecycle_display.png
)
生命周期终止时间定义:
1.
若最新版本和当前版本一致,生命周期终止时间为最新发布日期的6个月后;
2.
若最新版本高于当前版本,生命周期终止时间为最新发布日期的3个月后。
![
avatar
](
./pkgimg/issue_display.png
)
\ No newline at end of file
packageship/doc/design/pkgimg/issue_display.png
0 → 100644
浏览文件 @
1814be46
125.2 KB
packageship/doc/design/pkgimg/lifecycle.png
0 → 100644
浏览文件 @
1814be46
149.8 KB
packageship/doc/design/pkgimg/lifecycle_2.png
0 → 100644
浏览文件 @
1814be46
83.0 KB
packageship/doc/design/pkgimg/lifecycle_display.png
0 → 100644
浏览文件 @
1814be46
180.2 KB
packageship/packageship/application/initsystem/data_import.py
浏览文件 @
1814be46
...
@@ -200,7 +200,11 @@ class InitDataBase():
...
@@ -200,7 +200,11 @@ class InitDataBase():
raise
ContentNoneException
(
raise
ContentNoneException
(
'The path to the sqlite file in the database initialization configuration
\
'The path to the sqlite file in the database initialization configuration
\
is incorrect '
)
is incorrect '
)
<<<<<<<
HEAD
if
not
os
.
path
.
exists
(
src_db_file
)
or
not
os
.
path
.
exists
(
bin_db_file
):
if
not
os
.
path
.
exists
(
src_db_file
)
or
not
os
.
path
.
exists
(
bin_db_file
):
=======
if
os
.
path
.
exists
(
src_db_file
)
or
os
.
path
.
exists
(
bin_db_file
):
>>>>>>>
dec3661c6c56512ebee173dc68694716d8c6b041
raise
FileNotFoundError
(
"sqlite file {src} or {bin} does not exist, please
\
raise
FileNotFoundError
(
"sqlite file {src} or {bin} does not exist, please
\
check and try again"
.
format
(
src
=
src_db_file
,
bin
=
bin_db_file
))
check and try again"
.
format
(
src
=
src_db_file
,
bin
=
bin_db_file
))
# 3. Obtain temporary source package files and binary package files
# 3. Obtain temporary source package files and binary package files
...
...
upstream-info/PyYAML.yaml
浏览文件 @
1814be46
---
version_control
:
github
version_control
:
github
src_repo
:
yaml/pyyaml
src_repo
:
yaml/pyyaml
tag_prefix
:
^v
tag_prefix
:
"
^"
separator
:
.
separator
:
"
."
git_url
:
https://github.com/yaml/pyyaml.git
git_tag
:
-
2020-03-18 5.3.1
-
2020-01-06
5.3
-
2018-08-16 4.1-retracted
-
2019-12-21 5.3b1
-
2019-11-25 5.2b1
-
2019-12-02
5.2
-
2019-03-08 5.1b7
-
2019-03-07 5.1b6
-
2019-03-07 5.1b5
-
2019-03-06 5.1b4
-
2019-02-27 5.1b3
-
2019-02-26 5.1b2
-
2019-02-24 5.1b1
-
2019-07-30 5.1.2
-
2019-06-06 5.1.1
-
2019-03-13
5.1
-
2018-06-29 4.2b2
-
2018-06-28 4.2b1
-
2018-06-26
4.1
-
2018-07-03 3.13rc1
-
2018-07-03 3.13b1
-
2018-07-05
3.13
-
2016-08-27
3.12
-
2014-03-26
3.11
-
2011-05-29
3.10
-
2009-08-30
3.09
-
2008-12-30
3.08
-
2008-12-28
3.07
-
2008-10-03
3.06
-
2007-05-12
3.05
-
2006-08-20
3.04
-
2006-06-18
3.03
-
2006-05-15
3.02
-
2006-05-07
3.01
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录