Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

optimize: add options to nacos-config.py and fix some option bugs #3949

Merged
merged 18 commits into from
Aug 27, 2021

Conversation

saddit
Copy link

@saddit saddit commented Aug 14, 2021

Ⅰ. Describe what this PR did

  • 添加可选的用户名密码等参数 使用(-h,-p,-t,-u,-w,-g)选择性输入参数
  • 解决pair[1]出现空字符导致不跳过此轮循环的bug
  • 解决分割选项可能导致内容丢失的问题

Ⅱ. Does this pull request fix one issue?

暂未发现相关issue

Ⅲ. Why don't you add test cases (unit test/integration test)?

已通过测试,测试范围仅包含上传config.txt到nacos中

正则表达式测试:

import re

def get_pair(line: str) -> tuple:
    res = re.match(r"([\.\w]+)=(.*)",line)
    return res.groups() if res is not None else ['','']

print(get_pair("a.vc.k=https://jjbj?asdf=123"))
print(get_pair("a.vc.k="))
print(get_pair("a.vc.k=redis"))
print(get_pair("a.vc.k=aa.sdf=12.3"))

结果

('a.vc.k', 'https://jjbj?asdf=123&')
('a.vc.k', '')
('a.vc.k', 'redis')
('a.vc.k', 'aa.sdf=12.3')

Ⅳ. Describe how to verify it

用该脚本提交一次config.txt即可验证

Ⅴ. Special notes for reviews

上一次提交 PULL REQUEST

script/config-center/nacos/nacos-config.py Outdated Show resolved Hide resolved
script/config-center/nacos/nacos-config.py Outdated Show resolved Hide resolved
@lvekee
Copy link
Contributor

lvekee commented Aug 19, 2021

请登记pr信息

Copy link
Contributor

@lvekee lvekee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@funky-eyes funky-eyes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM for @lvekee

@codecov-commenter
Copy link

codecov-commenter commented Aug 19, 2021

Codecov Report

Merging #3949 (e09a0d1) into develop (ae2a4c8) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             develop    #3949   +/-   ##
==========================================
  Coverage      40.20%   40.20%           
  Complexity      3079     3079           
==========================================
  Files            689      689           
  Lines          23323    23323           
  Branches        2886     2886           
==========================================
  Hits            9376     9376           
  Misses         13077    13077           
  Partials         870      870           

changes/1.5.0.md Outdated Show resolved Hide resolved
script/config-center/config.txt Outdated Show resolved Hide resolved
changes/en-us/1.5.0.md Outdated Show resolved Hide resolved
@slievrly
Copy link
Member

@838239178 Pls remove the irrelevant changes.

@saddit
Copy link
Author

saddit commented Aug 20, 2021

@838239178 Pls remove the irrelevant changes.

it‘s ok now

@caohdgege
Copy link
Contributor

请修改一下pr标题,类似以下的:
optimize: fix the problem that nacos-config.py will not skip blank options

@caohdgege
Copy link
Contributor

(有变更的话,在原分支上修改然后push之后就会自动被带过来的,不需要重新开一个pr)

@saddit saddit changed the title optimize:[nacos-config.py]添加可选的用户名密码参数、解决bug [optimize]:add options to nacos-config.py and fix some option bugs Aug 23, 2021
@caohdgege caohdgege changed the title [optimize]:add options to nacos-config.py and fix some option bugs optimize :add options to nacos-config.py and fix some option bugs Aug 23, 2021
Copy link
Contributor

@caohdgege caohdgege left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@lvekee lvekee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@slievrly slievrly changed the title optimize :add options to nacos-config.py and fix some option bugs optimize: add options to nacos-config.py and fix some option bugs Aug 27, 2021
Copy link
Member

@slievrly slievrly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@slievrly slievrly merged commit 9be87f2 into apache:develop Aug 27, 2021
@slievrly slievrly added this to the 1.5.0 milestone Aug 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants