Signed-off-by: Luan Shengde shdluan@163.com --- doc/mail-robot.md | 89 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 89 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..ec96ca3 --- /dev/null +++ b/doc/mail-robot.md @@ -0,0 +1,89 @@ +# 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 + my oss commit: commit_url +attahcment + ssh pub_key + - id_rsa.pub + +## steps overview + +1. monitor + monitor_new_email + - the monitor will listen to the mailbox for new email files + handle_new_email: + 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 + + rescue error + error type: + - no commit url + - commit url not in upstream-repos + - commit url not available + - no pub_key + build_error_email + send mail + + - apply_my_account + my_uuid + generate uuid + apply_account + invoke ApplyJumperAccount to apply new account + apply_jumper_account + premise: pubkey exists + complete my_info + - my_uuid + - my_login_name + - my_commit_url + store my_info + invoke es to store the apply infos + - my_email + - my_name + - my_uuid + - my_commit_url + - my_login_name + + - 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