Signed-off-by: Luan Shengde shdluan@163.com --- doc/mail-robot.md | 97 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 doc/mail-robot.md
diff --git a/doc/mail-robot.md b/doc/mail-robot.md new file mode 100644 index 0000000..2eb0dd1 --- /dev/null +++ b/doc/mail-robot.md @@ -0,0 +1,97 @@ +# SPDX-License-Identifier: MulanPSL-2.0+ + +# email monitor robot + +## purpose + +apply account/uuid for user + uuid: used for user to submit jobs + account: used for user to check the test data + +## allowed email format: + +subject: apply account +mail content + commit url: + my oss commit: commit_url + example: + my oss commit: https://github.com/torvalds/aalinux/commit/7be74942f184fdfba34ddd19a0d995deb... +attahcment + ssh pub_key + file name: + - id_rsa.pub + +## steps overview + +1. mail-robot + monitor_new_email + - the monitor will listen to the mailbox for new email files + handle_new_email: + read email file content + apply_account + invoke AssignAccount for new account + +2. assign-account + init my_info + - my_email + - my_name + send_account + - parse_commit_url_pub_key + invoke ParseApplyAccountEmail + parse_commit_url + extract_commit_url + check whether there is a standard commit url + base_url_in_upstream_repos + check whether the repo's url in upstream-repos + commit_url_availability + check whether the commit url valid + - gitee_commit + clone the repo and check the commit + - non_gitee_commit(url) + check the commit with curl + + parse_pub_key + check whether there is a ssh pub_key in the email file + attachment: + first attachment + file_name: + id_ras.pub + + rescue error + error type: + - no commit url + - commit url not in upstream-repos + - commit url not available + - no pub_key + build_error_email with raised error message + send fail email + + - apply_my_account + my_uuid + generate uuid + apply_account + invoke ApplyJumperAccount to apply new account with my_info and pub_key + my_info: + - my_email + - my_name + - my_uuid + apply_jumper_account + required data: pub_key + complete my_info + my_info add: + - my_login_name + - my_commit_url + store my_info + invoke es to store the apply infos + + - send_mail + build_uuid_email + send mail + +3. continue the monitor + continue to monitor the mailbox for new email file + cycle run step 1 and 2 if matched email files + +4. service log + use the following command to get the logs + docker logs -f --tail=100 fluentd | grep mail-robot
On Thu, Nov 12, 2020 at 07:26:36PM +0800, Luan Shengde wrote:
Signed-off-by: Luan Shengde shdluan@163.com
doc/mail-robot.md | 97 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 doc/mail-robot.md
diff --git a/doc/mail-robot.md b/doc/mail-robot.md new file mode 100644 index 0000000..2eb0dd1 --- /dev/null +++ b/doc/mail-robot.md @@ -0,0 +1,97 @@ +# SPDX-License-Identifier: MulanPSL-2.0+
+# email monitor robot
+## purpose
+apply account/uuid for user
- uuid: used for user to submit jobs
- account: used for user to check the test data
+## allowed email format:
+subject: apply account +mail content
- commit url:
- my oss commit: commit_url
- example:
- my oss commit: https://github.com/torvalds/aalinux/commit/7be74942f184fdfba34ddd19a0d995deb...
+attahcment
- ssh pub_key
- file name:
- id_rsa.pub
+## steps overview
+1. mail-robot
这是个独立的service.
monitor_new_email
- the monitor will listen to the mailbox for new email files
handle_new_email:
read email file content
apply_account
invoke AssignAccount for new account
+2. assign-account
这是个独立的service, 通过 RESTful API 从 mail-robot or CLI tool 接收JSON参数。
它不应该需要 ParseApplyAccountEmail.
Thanks, Fengguang
- init my_info
- my_email
- my_name
- send_account
- parse_commit_url_pub_key
invoke ParseApplyAccountEmail
parse_commit_url
extract_commit_url
check whether there is a standard commit url
base_url_in_upstream_repos
check whether the repo's url in upstream-repos
commit_url_availability
check whether the commit url valid
- gitee_commit
clone the repo and check the commit
- non_gitee_commit(url)
check the commit with curl
parse_pub_key
check whether there is a ssh pub_key in the email file
attachment:
first attachment
file_name:
id_ras.pub
rescue error
error type:
- no commit url
- commit url not in upstream-repos
- commit url not available
- no pub_key
build_error_email with raised error message
send fail email
- apply_my_account
my_uuid
generate uuid
apply_account
invoke ApplyJumperAccount to apply new account with my_info and pub_key
my_info:
- my_email
- my_name
- my_uuid
apply_jumper_account
required data: pub_key
complete my_info
my_info add:
- my_login_name
- my_commit_url
store my_info
invoke es to store the apply infos
- send_mail
build_uuid_email
send mail
+3. continue the monitor
continue to monitor the mailbox for new email file
cycle run step 1 and 2 if matched email files
+4. service log
use the following command to get the logs
docker logs -f --tail=100 fluentd | grep mail-robot
-- 2.23.0
On Fri, Nov 13, 2020 at 10:42:17AM +0800, Wu Fengguang wrote:
On Thu, Nov 12, 2020 at 07:26:36PM +0800, Luan Shengde wrote:
Signed-off-by: Luan Shengde shdluan@163.com
doc/mail-robot.md | 97 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 doc/mail-robot.md
diff --git a/doc/mail-robot.md b/doc/mail-robot.md new file mode 100644 index 0000000..2eb0dd1 --- /dev/null +++ b/doc/mail-robot.md @@ -0,0 +1,97 @@ +# SPDX-License-Identifier: MulanPSL-2.0+
+# email monitor robot
+## purpose
+apply account/uuid for user
- uuid: used for user to submit jobs
- account: used for user to check the test data
+## allowed email format:
+subject: apply account +mail content
- commit url:
- my oss commit: commit_url
- example:
- my oss commit: https://github.com/torvalds/aalinux/commit/7be74942f184fdfba34ddd19a0d995deb...
+attahcment
- ssh pub_key
- file name:
- id_rsa.pub
+## steps overview
+1. mail-robot
这是个独立的service.
monitor_new_email
- the monitor will listen to the mailbox for new email files
handle_new_email:
read email file content
apply_account
invoke AssignAccount for new account
+2. assign-account
这是个独立的service, 通过 RESTful API 从 mail-robot or CLI tool 接收JSON参数。
它不应该需要 ParseApplyAccountEmail.
可能你在这里想表达的意思是mail-robot直接调用的这些类代码,不是container/assign-account服务。 那么请把所有这里的assign字样去掉。别到处用,混淆概念。 其实我一直是受害者。这几个月就被绕的晕乎晕乎的。
assign这个动词只能用于container/assign-account服务。 该服务的调用者代码里,一律用apply。
Thanks, Fengguang
- init my_info
- my_email
- my_name
- send_account
- parse_commit_url_pub_key
invoke ParseApplyAccountEmail
parse_commit_url
extract_commit_url
check whether there is a standard commit url
base_url_in_upstream_repos
check whether the repo's url in upstream-repos
commit_url_availability
check whether the commit url valid
- gitee_commit
clone the repo and check the commit
- non_gitee_commit(url)
check the commit with curl
parse_pub_key
check whether there is a ssh pub_key in the email file
attachment:
first attachment
file_name:
id_ras.pub
rescue error
error type:
- no commit url
- commit url not in upstream-repos
- commit url not available
- no pub_key
build_error_email with raised error message
send fail email
- apply_my_account
my_uuid
generate uuid
apply_account
invoke ApplyJumperAccount to apply new account with my_info and pub_key
my_info:
- my_email
- my_name
- my_uuid
apply_jumper_account
required data: pub_key
complete my_info
my_info add:
- my_login_name
- my_commit_url
store my_info
invoke es to store the apply infos
- send_mail
build_uuid_email
send mail
+3. continue the monitor
continue to monitor the mailbox for new email file
cycle run step 1 and 2 if matched email files
+4. service log
use the following command to get the logs
docker logs -f --tail=100 fluentd | grep mail-robot
-- 2.23.0
invoke AssignAccount for new account
+2. assign-account
这是个独立的service, 通过 RESTful API 从 mail-robot or CLI tool 接收JSON参数。
它不应该需要 ParseApplyAccountEmail.
可能你在这里想表达的意思是mail-robot直接调用的这些类代码,不是container/assign-account服务。 那么请把所有这里的assign字样去掉。别到处用,混淆概念。 其实我一直是受害者。这几个月就被绕的晕乎晕乎的。
assign这个动词只能用于container/assign-account服务。 该服务的调用者代码里,一律用apply。
ok, I will optimize it
Thanks, Luan Shengde
Thanks, Fengguang
- init my_info
- my_email
- my_name
- send_account
- parse_commit_url_pub_key
invoke ParseApplyAccountEmail
parse_commit_url
extract_commit_url
check whether there is a standard commit url
base_url_in_upstream_repos
check whether the repo's url in upstream-repos
commit_url_availability
check whether the commit url valid
- gitee_commit
clone the repo and check the commit
- non_gitee_commit(url)
check the commit with curl
parse_pub_key
check whether there is a ssh pub_key in the email file
attachment:
first attachment
file_name:
id_ras.pub
rescue error
error type:
- no commit url
- commit url not in upstream-repos
- commit url not available
- no pub_key
build_error_email with raised error message
send fail email
- apply_my_account
my_uuid
generate uuid
apply_account
invoke ApplyJumperAccount to apply new account with my_info and pub_key
my_info:
- my_email
- my_name
- my_uuid
apply_jumper_account
required data: pub_key
complete my_info
my_info add:
- my_login_name
- my_commit_url
store my_info
invoke es to store the apply infos
- send_mail
build_uuid_email
send mail
+3. continue the monitor
continue to monitor the mailbox for new email file
cycle run step 1 and 2 if matched email files
+4. service log
use the following command to get the logs
docker logs -f --tail=100 fluentd | grep mail-robot
-- 2.23.0
handle_new_email:
read email file content
apply_account
invoke AssignAccount for new account
+2. assign-account
这是个独立的service, 通过 RESTful API 从 mail-robot or CLI tool 接收JSON参数。
它不应该需要 ParseApplyAccountEmail.
可能你在这里想表达的意思是mail-robot直接调用的这些类代码,不是container/assign-account服务。 那么请把所有这里的assign字样去掉。别到处用,混淆概念。 其实我一直是受害者。这几个月就被绕的晕乎晕乎的。
assign这个动词只能用于container/assign-account服务。 该服务的调用者代码里,一律用apply。
OK, I will optimize it with new name
Thanks, Luan Shengde
Thanks, Fengguang
- init my_info
- my_email
- my_name
- send_account
- parse_commit_url_pub_key