To make sure git_repos displayed on the web are right.
examples of git_repo:
a/AvxToNeon/AvxToNeon
0/caterqiu/001
aur-a/a2png/a2png
m/my-sql_with_boostkit_patch/my-sql_with_boostkit_patch
Signed-off-by: Li Yuanchao <lyc163mail(a)163.com>
---
src/lib/web_backend.rb | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/lib/web_backend.rb b/src/lib/web_backend.rb
index 9e899d9..e305ac6 100644
--- a/src/lib/web_backend.rb
+++ b/src/lib/web_backend.rb
@@ -400,6 +400,14 @@ def …
[View More]query_repos(must, from: 0, size: 1)
repos = []
result['hits']['hits'].each do |r|
r = r['_source']
+
+ # What does this regular expression want:
+ # 1. a three-segment structure "xxx/xxx/xxx"
+ # 2. there can be '-' or '_' in every segment, but can't be at first or last of the segment.
+ # 3. the first segment can have lowercase of letters or numbers in it.
+ # 4. the other two segments can have letters(lowercase or uppercase) or numbers in it.
+ next unless r['git_repo'] =~ %r{^([a-z0-9]([a-z0-9\-_]*[a-z0-9])*(/[a-zA-Z0-9][\w\-]*[a-zA-Z0-9]){2})$}
+
repos << {
git_url: get_repo_url(r['url']),
git_repo: r['git_repo']
--
2.23.0
[View Less]
the default value of email subject should not be job_failed,
and there is already a send-email-on-fail.yaml.
Signed-off-by: Li Ping <1477412247(a)qq.com>
---
jobs/send-email.yaml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/jobs/send-email.yaml b/jobs/send-email.yaml
index 8f8b48b96..2689634c2 100644
--- a/jobs/send-email.yaml
+++ b/jobs/send-email.yaml
@@ -3,4 +3,4 @@
# values of $subject are limited to job_failed/job_debug/borrow_success/borrow_failed.
…
[View More]send_email:
- subject: job_failed
+ subject:
--
2.23.0
[View Less]