mithro / autolabeler

Add labels to Pull Requests based on matched file patterns
ISC License
103 stars 27 forks source link

Don't create labels that already exist #32

Closed pepicrft closed 6 years ago

pepicrft commented 6 years ago

I've updated the probot to not create labels when they already exist. Creating labels that already exist results in unnecessary labelling events on the PR/Issue.

ci-reporter[bot] commented 6 years ago

The build is failing

✨ Good work on this PR so far! ✨ Unfortunately, the Travis CI build is failing as of ce5d2094c54ff539038ef4622bb1dddaed0a21fc. Here's the output:

npm test
> probot-labeler@1.0.0 test /home/travis/build/probot/autolabeler
> jest && standard

 FAIL  test/index.test.js
  autolabeler
    pull_request.opened event
      ✕ adds label (36ms)

  ● autolabeler › pull_request.opened event › adds label

    TypeError: context.github.issues.getIssueLabels is not a function

      13 | 
      14 |     const files = await context.github.pullRequests.getFiles(context.issue())
    > 15 |     const currentLabels = new Set((await context.github.issues.getIssueLabels(context.issue())).data.map((label) => {label.name}));
      16 |     const changedFiles = files.data.map(file => file.filename)
      17 |     const labels = new Set()
      18 | 

      at autolabel (index.js:15:64)

12:18:28.244Z ERROR probot: context.github.issues.getIssueLabels is not a function
  TypeError: context.github.issues.getIssueLabels is not a function
      at autolabel (/home/travis/build/probot/autolabeler/index.js:15:64)
      at process._tickCallback (internal/process/next_tick.js:109:7)
  --
  event: {
    "event": "pull_request.opened",
    "repository": "robotland/test",
    "installation": 13055
  }
Test Suites: 1 failed, 1 total
Tests:       1 failed, 1 total
Snapshots:   0 total
Time:        2.341s
Ran all test suites.

I'm sure you can fix it! If you need help, don't hesitate to ask a maintainer of the project!


This comment was automagically generated by ci-reporter. If you see a problem, open an issue here.
pepicrft commented 6 years ago

Could I get a couple of 👀 here?

BPScott commented 6 years ago

Hi @bkeepers, is there any chance of getting this reviewed/merged?

stale[bot] commented 6 years ago

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?