This is an automated email from the ASF dual-hosted git repository.
wangzx pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/echarts-bot.git
The following commit(s) were added to refs/heads/master by this push:
new f42f9a7 fix: avoid opening an issue with no template through
`Reference in new issue`.
f42f9a7 is described below
commit f42f9a773c2bb0c81fa9e46a696a10a2df24d0bb
Author: plainheart <[email protected]>
AuthorDate: Wed Dec 1 14:18:02 2021 +0800
fix: avoid opening an issue with no template through `Reference in new
issue`.
---
src/issue.js | 11 +++++++++++
src/text.js | 10 ++++------
2 files changed, 15 insertions(+), 6 deletions(-)
diff --git a/src/issue.js b/src/issue.js
index 9233207..d370376 100644
--- a/src/issue.js
+++ b/src/issue.js
@@ -15,6 +15,7 @@ class Issue {
this.translatedBody = null;
this.addLabels = [];
this.removeLabel = null;
+ this.response = null;
}
async init () {
@@ -22,6 +23,11 @@ class Issue {
const isCore = isCommitter(this.issue.author_association,
this.issue.user.login);
if (!isCore) {
+ // avoid opening an issue with no template through `Reference in
new issue`
+ if (!this.isUsingTemplate()) {
+ this.addLabels.push(label.INVALID);
+ return;
+ }
this.addLabels.push(label.PENDING);
this.addLabels.push(label.WAITING_FOR_COMMUNITY);
}
@@ -47,6 +53,11 @@ class Issue {
this.translatedBody = res.lang !== 'en' && [res.translated,
res.lang];
}
}
+
+ isUsingTemplate() {
+ return this.body.indexOf('Steps To Reproduce') > -1
+ || this.body.indexOf('What problem does this feature solve') > - 1;
+ }
}
module.exports = Issue;
diff --git a/src/text.js b/src/text.js
index 50b8e51..eb9e729 100644
--- a/src/text.js
+++ b/src/text.js
@@ -1,15 +1,13 @@
const NOT_USING_TEMPLATE =
- `This issue is not created using [issue
template](https://ecomfe.github.io/echarts-issue-helper/) so I'm going to close
it. 🙊
+ `This issue is not created using [issue
template](https://github.com/apache/echarts/issues/new/choose) so I'm going to
close it. 🙊
Sorry for this, but it helps save our maintainers' time so that more
developers get helped.
Feel free to create another issue using the issue template.
If you think you have already made your point clear without the template, or
your problem cannot be covered by it, you may re-open this issue again.
-这个 issue 未使用 [issue
模板](https://ecomfe.github.io/echarts-issue-helper/?lang=zh-cn) 创建,所以我将关闭此 issue。
+这个 issue 未使用 [issue 模板](https://github.com/apache/echarts/issues/new/choose)
创建,所以我将关闭此 issue。
为此带来的麻烦我深表歉意,但是请理解这是为了节约社区维护者的时间,以更高效地服务社区的开发者群体。
-如果您愿意,请使用 issue 模板重新创建 issue。
-
-如果您认为虽然没有使用模板,但您已经提供了复现问题的充分描述,或者您的问题无法使用模板表达,也可以重新 open 这个 issue。`;
+如果您愿意,请使用 issue 模板重新创建 issue。`;
const ISSUE_CREATED =
`Hi! We've received your issue and please be patient to get responded. 🎉
@@ -82,7 +80,7 @@ For (1), we have decided to use the GitHub issue lists
exclusively for work that
For (2), we have found that issues that do not provide proper information
upfront usually results in terribly inefficient back-and-forth communication
just to extract the basic information needed for actual triaging. This is
exactly why we have created this app: to ensure that every issue is created
with the necessary information, and to save time on both sides.`;
-const ISSUE_COMMENT_TRANSLATE_TIP = 'AT_ISSUE_AUTHOR It seems you are not
using English, I\'ve helped translate the content automatically. To make your
issue understood by more people, we\'d like to suggest using English next time.
🤗';
+const ISSUE_COMMENT_TRANSLATE_TIP = 'AT_ISSUE_AUTHOR It seems you are not
using English, I\'ve helped translate the content automatically. To make your
issue understood by more people and get helped, we\'d like to suggest using
English next time. 🤗';
module.exports = {
NOT_USING_TEMPLATE,
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]