This repository was archived by the owner on Nov 6, 2023. It is now read-only.
Repository navigation
Implement issue labeller bot #11615
Merged
Merged
Implement issue labeller bot #11615
Changes from all commits
Commits
Show all changes
96 commits
Select commit
Hold shift + click to select a range
ae3a5ec
Initialize issue labeller bot
strugee cee5ed2
Import Probot plugin template
strugee 9b5dff3
Switch back to Perjury
strugee 300caa2
Add a basic development.md
strugee 29f4809
Start writing an issue-parsing function
strugee 5ce47b2
Add more parsing testcases
strugee 9ffe0ce
Add issue template
strugee 151f47b
Make sure the parser can handle Markdown comments
strugee 1b9d2de
Make the parser more strict about issue type
strugee 492501c
Sketch out a basic issue responder
strugee e28d62e
Fix index.js not finding webhook data
strugee dfd6b76
Test that the parser can handle null bodies
strugee a478a5e
Use the Probot logger
strugee 4e4dfe5
Make parse-test use strict mode
strugee 8800f33
Factor out the new issue handler
strugee b4416dd
Start testing the new issue handler
strugee 9adee73
Start writing a context mock
strugee e5a26f7
Test new issue handler invocation with context
strugee 3616173
Move Lodash require to the proper place
strugee 91075bc
Handle descriptions being blank
strugee f8c696a
Add some comments
strugee 9617d32
Fix an assert.ifError not actually passing err
strugee 233f6d7
Make .issue() in the context mock a Sinon spy
strugee b89e15e
Add a couple TODO comments
strugee 6a57756
Stub out context.github.issues.createComment()
strugee 78ab514
Don't make the context issue factory a stub
strugee 1ffd545
Add a TODO
strugee 8faa4cb
Allow mocking the body of issue contexts
strugee 84bdd86
Test different kinds of incoming issues
strugee 29d1ec2
Actually post the comment with problems
strugee e3062ec
Test problematic issue body handling
strugee e1c6cab
Add package-lock.json
strugee 704ed82
Factor out validation into a different module
strugee adf4639
Test validation of correct issues
strugee 8d24657
Remove outdated TODO
strugee e5673d7
Support issue edits
strugee f2f2e63
Affirmatively say the user fixed issues via edits
strugee 888c718
Only use one const statement in index.js
strugee d3d581c
Switch from XO to ESLint
strugee fdd3a91
Fix ESLint errors
strugee cdc8017
Load Alexa rankings at boot
strugee 77fc7e0
Nuke outdated TODOs
strugee 3f6ebd4
Add a TODO
strugee e7ef964
Fix Alexa domains not being loaded properly
strugee 7197a49
Label new issues
strugee 00f52de
Add a mock for Alexa results
strugee 992500e
Pass an Alexa mock in the new issue handler test
strugee 01a133b
Factor out labeling into its own module
strugee 85e6b69
Remove stray debugger statement
strugee 7e11d4e
Fix Array#indexOf in the Alexa mock
strugee 246456d
Mock out addLabels() in the context
strugee 28a0dc9
Increase Alexa mock size
strugee 0f85d8d
Fix some bugs in the Alexa mock
strugee ba550a4
Test top 1k domain labeling too
strugee ae23f3d
Run the labeler for edits too
strugee 223f2b6
Add a TODO
strugee 7557209
Squash ESLint errors
strugee 17b6ad1
Factor out handler setup into a common module
strugee 015339c
DRY up issue create/edit handler tests
strugee 9e3194a
Remove outdated TODO
strugee a4c874c
Don't make the edit handler an AsyncFunction
strugee 8bb322c
Test that handlers label issues
strugee d7df641
Eliminate edit handler race condition
strugee 0dd85ee
Squash more linter errors
strugee bebeac6
Test that freeform comments work
strugee 8670a29
Switch to AGPL
strugee c75c283
Add AGPL comment headers
strugee 7d207e2
Add copyright notices
strugee 0c70ce2
Bump to probot@0.8.0
strugee 39c25ac
Clarify a TODO
strugee 62f7f04
Test that we handle colons in freeform comments
strugee 412a084
Make sure we can handle Markdown links
strugee 33b86f7
Move some handler tests to the parse module test
strugee 0f51c43
Add WIP code to normalize URLs to domains
strugee bff589b
Allow issue type of "other"
strugee e43bab2
Enforce semicolons
strugee ef46ac2
Fix indentation
strugee c789c33
Fix undefined domains typecasting to a string
strugee 4da30b9
Fix full URL parsing
strugee 0ecb459
Remove issue-format-bot .travis.yml
strugee 7b2dd77
Remove full AGPL headers
strugee e45db86
Make issue-format-bot indentation 2 spaces
strugee 13baa7e
Refresh Alexa data daily
strugee 3a07d85
Add logging to Alexa refreshes
strugee 160697a
Look for issues with zero or >1 types provided
strugee 4c5e5eb
DRY up test/lib/handlerutil
strugee 6b0c362
Remove .js extension in a require()
strugee 6514a6d
Note how to handle >1 domain in ISSUE_TEMPLATE.md
strugee ce1f525
Clean up .eslintrc
strugee 7bc8bb7
Add explanatory comment
strugee 9b31fff
Pass through arguments to context.issue() mock
strugee c073195
Assert on API calls, not context creation
strugee 8ce6a67
Refactor labeler-test
strugee 8efbc20
Remove old top-* labels
strugee 1d98812
Expand README.md
strugee 1c4e918
Don't error when we remove labels
strugee File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| <!-- Please fill out ALL information here, and don't mess with the formatting. --> | ||
| <!-- HTTPS Everywhere uses a bot to manage issues and if you change things, it won't be able to understand. --> | ||
|
|
||
| <!-- Delete all but one of the next five lines to indicate the type of issue you're filing. --> | ||
| Type: ruleset issue | ||
| Type: new ruleset | ||
| Type: code issue | ||
| Type: feature request | ||
| Type: other | ||
|
|
||
| <!-- If you're reporting a ruleset issue, fill out this section. --> | ||
| <!-- If you want to report subdomains, fill in the top-level domain here and make a note of the subdomain below. --> | ||
| <!-- If you want to report two separate domains, please open two separate issues. --> | ||
| Domain: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| # The ID of your GitHub integration | ||
| INTEGRATION_ID= | ||
| WEBHOOK_SECRET=development |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,165 @@ | ||
| { | ||
| "parserOptions": { | ||
| "ecmaVersion": 2017 | ||
| }, | ||
| "env": { | ||
| "es6": true, | ||
| "node": true | ||
| }, | ||
| "extends": [ | ||
| "eslint:recommended" | ||
| ], | ||
| "rules": { | ||
| "array-callback-return": "error", | ||
| "array-element-newline": "off", | ||
| "arrow-parens": [ | ||
| "error", | ||
| "as-needed" | ||
| ], | ||
| "arrow-spacing": [ | ||
| "error", | ||
| { | ||
| "after": true, | ||
| "before": true | ||
| } | ||
| ], | ||
| "block-spacing": "error", | ||
| "brace-style": [ | ||
| "error", | ||
| "1tbs" | ||
| ], | ||
| "callback-return": "error", | ||
| "camelcase": "error", | ||
| "capitalized-comments": "off", | ||
| "comma-dangle": "error", | ||
| "comma-spacing": [ | ||
| "error", | ||
| { | ||
| "after": true, | ||
| "before": false | ||
| } | ||
| ], | ||
| "comma-style": [ | ||
| "error", | ||
| "last" | ||
| ], | ||
| "complexity": "error", | ||
| "consistent-return": "off", | ||
| "curly": "off", | ||
| "default-case": "off", | ||
| "dot-notation": "error", | ||
| "eol-last": "error", | ||
| "eqeqeq": "error", | ||
| "func-call-spacing": "error", | ||
| "func-names": "off", | ||
| "func-style": [ | ||
| "error", | ||
| "declaration" | ||
| ], | ||
| "handle-callback-err": "error", | ||
| "indent": [2, 2], | ||
| "key-spacing": "error", | ||
| "keyword-spacing": [ | ||
| "error", | ||
| { | ||
| "after": true, | ||
| "before": true | ||
| } | ||
| ], | ||
| "linebreak-style": [ | ||
| "error", | ||
| "unix" | ||
| ], | ||
| "lines-around-comment": "error", | ||
| "no-await-in-loop": "error", | ||
| "no-bitwise": "error", | ||
| "no-buffer-constructor": "error", | ||
| "no-caller": "error", | ||
| "no-confusing-arrow": "error", | ||
| "no-continue": "error", | ||
| "no-eq-null": "error", | ||
| "no-eval": "error", | ||
| "no-extend-native": "error", | ||
| "no-extra-bind": "error", | ||
| "no-floating-decimal": "error", | ||
| "no-implied-eval": "error", | ||
| "no-invalid-this": "error", | ||
| "no-label-var": "error", | ||
| "no-labels": "error", | ||
| "no-lonely-if": "error", | ||
| "no-loop-func": "error", | ||
| "no-mixed-operators": "error", | ||
| "no-mixed-requires": "off", | ||
| "no-mixed-spaces-and-tabs": "error", | ||
| "no-multi-spaces": "error", | ||
| "no-negated-in-lhs": "error", | ||
| "no-nested-ternary": "error", | ||
| "no-new": "error", | ||
| "no-new-func": "error", | ||
| "no-new-object": "error", | ||
| "no-new-require": "error", | ||
| "no-new-wrappers": "error", | ||
| "no-path-concat": "error", | ||
| "no-return-await": "error", | ||
| "no-self-compare": "error", | ||
| "no-sequences": "error", | ||
| "no-spaced-func": "error", | ||
| "no-sync": "error", | ||
| "no-throw-literal": "error", | ||
| "no-trailing-spaces": "error", | ||
| "no-undef-init": "error", | ||
| "no-unused-expressions": "error", | ||
| "no-use-before-define": "error", | ||
| "no-useless-call": "error", | ||
| "no-useless-concat": "error", | ||
| "no-var": "error", | ||
| "no-warning-comments": "off", | ||
| "no-whitespace-before-property": "error", | ||
| "nonblock-statement-body-position": "error", | ||
| "object-curly-spacing": [ | ||
| "error", | ||
| "never" | ||
| ], | ||
| "object-property-newline": "error", | ||
| "one-var": "off", | ||
| "one-var-declaration-per-line": "error", | ||
| "prefer-arrow-callback": "error", | ||
| "prefer-const": "error", | ||
| "prefer-promise-reject-errors": "error", | ||
| "quotes": [ | ||
| "error", | ||
| "single" | ||
| ], | ||
| "require-await": "error", | ||
| "rest-spread-spacing": "error", | ||
| "semi": [ | ||
| "error", | ||
| "always" | ||
| ], | ||
| "semi-spacing": "error", | ||
| "semi-style": [ | ||
| "error", | ||
| "last" | ||
| ], | ||
| "space-before-blocks": "error", | ||
| "space-in-parens": [ | ||
| "error", | ||
| "never" | ||
| ], | ||
| "space-infix-ops": "error", | ||
| "spaced-comment": [ | ||
| "error", | ||
| "always" | ||
| ], | ||
| "strict": "error", | ||
| "unicode-bom": [ | ||
| "error", | ||
| "never" | ||
| ], | ||
| "vars-on-top": "error", | ||
| "yoda": [ | ||
| "error", | ||
| "never" | ||
| ] | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| # Logs | ||
| logs | ||
| *.log | ||
| npm-debug.log* | ||
| yarn-debug.log* | ||
| yarn-error.log* | ||
|
|
||
| # Runtime data | ||
| pids | ||
| *.pid | ||
| *.seed | ||
| *.pid.lock | ||
|
|
||
| # Directory for instrumented libs generated by jscoverage/JSCover | ||
| lib-cov | ||
|
|
||
| # Coverage directory used by tools like istanbul | ||
| coverage | ||
|
|
||
| # nyc test coverage | ||
| .nyc_output | ||
|
|
||
| # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) | ||
| .grunt | ||
|
|
||
| # Bower dependency directory (https://bower.io/) | ||
| bower_components | ||
|
|
||
| # node-waf configuration | ||
| .lock-wscript | ||
|
|
||
| # Compiled binary addons (http://nodejs.org/api/addons.html) | ||
| build/Release | ||
|
|
||
| # Dependency directories | ||
| node_modules/ | ||
| jspm_packages/ | ||
|
|
||
| # Typescript v1 declaration files | ||
| typings/ | ||
|
|
||
| # Optional npm cache directory | ||
| .npm | ||
|
|
||
| # Optional eslint cache | ||
| .eslintcache | ||
|
|
||
| # Optional REPL history | ||
| .node_repl_history | ||
|
|
||
| # Output of 'npm pack' | ||
| *.tgz | ||
|
|
||
| # Yarn Integrity file | ||
| .yarn-integrity | ||
|
|
||
| # dotenv environment variables file | ||
| .env | ||
|
|
||
| *.pem |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems overly strict and not very readable. Let's trim this down a bit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Hainish fair enough. This is just the result of ESLint's config autogeneration (based on existing source code), so I'm not 100% sure what's actually in there, just that it matches what I've already been writing. I can try to trim it down though.