You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by eo...@apache.org on 2021/10/27 06:56:07 UTC

[pulsar-test-infra] branch master updated: [Doc]Fix the double label problem caused by too fast operation (#24)

This is an automated email from the ASF dual-hosted git repository.

eolivelli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar-test-infra.git


The following commit(s) were added to refs/heads/master by this push:
     new 2158029  [Doc]Fix the double label problem caused by too fast operation (#24)
2158029 is described below

commit 215802902196dbdd0035f30c698f39089bf22fc7
Author: fengtao1998 <37...@users.noreply.github.com>
AuthorDate: Wed Oct 27 14:56:03 2021 +0800

    [Doc]Fix the double label problem caused by too fast operation (#24)
---
 doc-label-check/dist/index.js | 28 ++++++++++++++++++++--------
 1 file changed, 20 insertions(+), 8 deletions(-)

diff --git a/doc-label-check/dist/index.js b/doc-label-check/dist/index.js
index 85b8ccf..4463867 100644
--- a/doc-label-check/dist/index.js
+++ b/doc-label-check/dist/index.js
@@ -2588,10 +2588,11 @@ function processIssue(octokit, repo, owner, issue_number, htmlUrl, description,
 
         const labelsToAdd = labelsToProcess.filter(shouldAdd).map(labels_1.getName);
         var issuelabels=utils_1.removeDuplicates(labelsToAdd.concat(labelsin));
-	console.log(issuelabels);
-	console.log(labelsToRemove);
-	if(labelsToRemove.length!=0){
-		issuelabels=issuelabels.filter((x)=>labelsToRemove.some((item=>x!=item)))}
+	    var corrent=0
+	    console.log(issuelabels);
+	    console.log(labelsToRemove);
+	    if(labelsToRemove.length!=0){
+		    issuelabels=issuelabels.filter((x)=>labelsToRemove.some((item=>x!=item)))}
         console.log("-----------------------");
         console.log(issuelabels);
         console.log("-----------------------");
@@ -2599,13 +2600,16 @@ function processIssue(octokit, repo, owner, issue_number, htmlUrl, description,
         var isdocmis=0
         for(let index=0;index<Labels.length;index++){
           if(issuelabels.includes(Labels[index])){
-            console.log(Labels[index],"issue exists");
-            if(Labels[index]=='doc-info-missing'){
-              isdocmis=1
-            }
+              console.log(Labels[index],"issue exists");
+                if(Labels[index]=='doc-info-missing'){
+                    isdocmis=1
+                }
           }else{
             num=num+1
           }
+	        if(labelsToAdd.includes(Labels[index])){
+	        corrent=1;
+        }
         }
         const errmessage="@"+user1+":Thanks for your contribution. For this PR, do we need to update docs?\n(The [PR template contains info about doc](https://github.com/apache/pulsar/blob/master/.github/PULL_REQUEST_TEMPLATE.md#documentation), which helps others know more about the changes. Can you provide doc-related info in this and future PR descriptions? Thanks)"
         if(num==4 && isdocmis==0){
@@ -2645,6 +2649,14 @@ function processIssue(octokit, repo, owner, issue_number, htmlUrl, description,
                 labels: labelsToAdd,
             });
         }
+        if(corrent==1){
+            yield octokit.issues.removeLabel({
+                owner,
+                repo,
+                issue_number,
+                name:"doc-info-missing"
+              })
+        }
     });
 }
 function main() {