Skip to content

Check issue template - #20

Closed
codebytere wants to merge 10 commits into
behaviorbot:masterfrom
codebytere:check_issue_template
Closed

Check issue template#20
codebytere wants to merge 10 commits into
behaviorbot:masterfrom
codebytere:check_issue_template

Conversation

@codebytere

@codebyterecodebytere commented Oct 19, 2017

Copy link
Copy Markdown
Contributor

Todo:

  • add to ReadMe

/cc @hiimbex

@welcome

welcomeBot commented Oct 19, 2017

Copy link
Copy Markdown

Thanks so much for opening your first PR here!

@update-docs

Copy link
Copy Markdown

Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would update some of our documentation based on your changes.

Comment threadlib/checkTemplateMatch.js Outdated
function checkTemplateMatch(body) {
const lines = issueTemplate.split("\n*")
lines.forEach(line => {
if (!body.includes(line)) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does this work for templates with forms you have to fill out? For example:

**Foo version**: [enter your version of Foo here]**OS version**: [enter your operating system’s name and version here]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right now this only checks that you correctly include all of the lines, as if you were filling out a form, but I'm not sure that's the best approach. Some times issue templates follow a branching style, like if it's a bug fill out area A, a feature request area B, etc.

As I said before, I think a solid approach for step one would be checking that the issue body isn't exactly the issue template ( ie !body.includes(issueTemplate))

@codebyterecodebytereOct 19, 2017

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so this is what i thought about earlier, and our issues in electron typically stem from people deleting things, so i think i want to incorporate more granular checking at some point. For now though i agree, and i can iterate from there!

@hiimbexhiimbex left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is on the right track, I'm still not sure about the best algorithmic approach to solving this though 🤔

Comment threadlib/getComment.js Outdated
comment = defaultComment
}
// set comment to default if none passed it
const eventComment = (!comment) ? defaultComment : comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for future reference, I'd prefer style changes like these (basically all of lib/getComment.js) in a separate PR.

@codebyterecodebytereOct 19, 2017

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reverted, open in separate PR :)

"id": 35471
}
}
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this fixture is identical to test/events/issueSuccessEvent.json, but I think ideally eventually the test will look more like an offshoot of a specific issue template

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah oops i know sorry i have yet to change it for issue template purposes

Comment threadindex.js
}
}

if (config.matchIssueTemplate) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 to this config name, make sure to add it to the readme

Comment threadlib/checkTemplateMatch.js Outdated
function checkTemplateMatch(body) {
const lines = issueTemplate.split("\n*")
lines.forEach(line => {
if (!body.includes(line)) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right now this only checks that you correctly include all of the lines, as if you were filling out a form, but I'm not sure that's the best approach. Some times issue templates follow a branching style, like if it's a bug fill out area A, a feature request area B, etc.

As I said before, I think a solid approach for step one would be checking that the issue body isn't exactly the issue template ( ie !body.includes(issueTemplate))

Comment threadlib/checkTemplateMatch.js Outdated
@@ -0,0 +1,17 @@
const res = await context.github.repos.getContent(this.repo({
path: '.github/ISSUE_TEMPLATE.md'
}))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also I think CI is failing due to this needing to be inside something async

Comment threadREADME.md Outdated
# *OPTIONAL* Label to be added to Issues and Pull Requests with insufficient information given
requestInfoLabelToAdd: needs-more-info

# *OPTIONAL* Require the issue to match an issue template you have in your repository.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think maybe this could be better rephrased to explain what it's actually checking?

@hiimbex

Copy link
Copy Markdown
Member

One last nit comment and then this should be good to go!

@hiimbex

Copy link
Copy Markdown
Member

Actually, any chance you wanna add a test for this?

@hiimbex

Copy link
Copy Markdown
Member

hey @codebytere no rush, but any interest in finishing this up?

@codebytere

Copy link
Copy Markdown
ContributorAuthor

@hiimbex

Copy link
Copy Markdown
Member

well that's for pull request templates, not issue templates, so I think this code would still be useful

@shiftkey

Copy link
Copy Markdown
Contributor

I think this should be covered by #39 which was just merged. @codebytere let me know if there's anything more do to with that.

@codebytere
codebytere deleted the check_issue_template branch November 7, 2018 21:40
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@codebytere@hiimbex@shiftkey@j-f1