You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by pe...@apache.org on 2021/11/04 08:53:22 UTC

[pulsar-test-infra] branch master updated: [Docbot]Fix problems in docbot scripts (#26)

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

penghui 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 76c227d  [Docbot]Fix problems in docbot scripts (#26)
76c227d is described below

commit 76c227dea32f3b9be99558d4f2c22f1e70252839
Author: fengtao1998 <37...@users.noreply.github.com>
AuthorDate: Thu Nov 4 16:53:18 2021 +0800

    [Docbot]Fix problems in docbot scripts (#26)
---
 doc-label-check/dist/index.js | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/doc-label-check/dist/index.js b/doc-label-check/dist/index.js
index e786e4d..1425d47 100644
--- a/doc-label-check/dist/index.js
+++ b/doc-label-check/dist/index.js
@@ -2559,7 +2559,6 @@ function processIssue(octokit, repo, owner, issue_number, htmlUrl, description,
             repo,
         });
         logger.debug("-------------------------------")
-        logger.debug(labelsForRepoData)
         const labelsForRepo = labelsForRepoData.map(labels_1.getName);
         const labelsToProcess = labels.filter(({ name }) => labelsForRepo.includes(name)&& !labelsToIgnore.includes(name));
         // Labels that are already applied on an issue
@@ -2569,6 +2568,7 @@ function processIssue(octokit, repo, owner, issue_number, htmlUrl, description,
             issue_number,
         });
         const labelsOnIssue = labelsOnIssueResp.data.map(labels_1.getName);
+        logger.debug(labelsOnIssue)
         logger.debug('Labels to process:');
         logger.debug(utils_1.formatStrArray(labelsToProcess.map(labels_1.formatLabel)));
         // Remove labels
@@ -2589,11 +2589,11 @@ function processIssue(octokit, repo, owner, issue_number, htmlUrl, description,
         // Add labels
         const shouldAdd = ({ name, checked }) => checked && !labelsOnIssue.includes(name);
 
+
         const labelsToAdd = labelsToProcess.filter(shouldAdd).map(labels_1.getName);
-        var issuelabels=utils_1.removeDuplicates(labelsToAdd.concat(labelsin));
+        logger.debug(labelsToAdd)
+        var issuelabels=utils_1.removeDuplicates((labelsToAdd.concat(labelsin)).concat(labelsOnIssue));
 	    var corrent=0
-	    console.log(issuelabels);
-	    console.log(labelsToRemove);
 	    if(labelsToRemove.length!=0){
 		    issuelabels=issuelabels.filter((x)=>labelsToRemove.some((item=>x!=item)))}
         console.log("-----------------------");
@@ -2659,15 +2659,17 @@ function processIssue(octokit, repo, owner, issue_number, htmlUrl, description,
                 issue_number,
                 name:"doc-info-missing"
               })
+
+            yield octokit.issues.createComment({
+              owner,
+              repo,
+              issue_number,
+              body:succmessage
+              })    
             }catch{
               logger.debug('no doc info missing')
             }
-              yield octokit.issues.createComment({
-                owner,
-                repo,
-                issue_number,
-                body:succmessage
-              })
+
         }
     });
 }