Git Product home page Git Product logo

Comments (18)

hiimbex avatar hiimbex commented on September 28, 2024 4

So I didn't actually get around to this until now, but given the month of October approaching, I'm gonna open this up to any hacktoberfest hackers! :octocat: πŸ€– :octocat:

The edits to code basically need to check that:

  1. if a .github/ISSUE_TEMPLATE.md exists, get it's contents, the code for that might look something like:
const res = await context.github.repos.getContent(this.repo({path: '.github/ISSUE_TEMPLATE.md'}))
const issueTemplate = Buffer.from(res.data.content, 'base64').toString()
  1. and it matches exactly the body of the issue opened
  2. (There's a number of ways to do this, but I'll suggest a simple way) create a variable issueTemplateCopied and setting it to true if the body of the issue matches that of the .github/ISSUE_TEMPLATE.md.
  3. Amend the following code:
    if (!body || badTitle) {

    to be if (!body || badTitle || issueTemplateCopied) {

That should be it! Feel free to comment here if you have any questions.

from request-info.

hiimbex avatar hiimbex commented on September 28, 2024 2

@codebytere awesome! If you wanna try your hand at implementing some sort of checking to see if the issue template was actually filled out, feel free!

from request-info.

shiftkey avatar shiftkey commented on September 28, 2024 2

I still think this is outstanding and requires considering a repository might define multiple templates in .github/ISSUE_TEMPLATE. I started on this in #39 and would love feedback to ensure I'm on the right track.

from request-info.

hiimbex avatar hiimbex commented on September 28, 2024 1

Hi @j-f1, thanks for the feedback!

Issue templates was definitely something I considered when creating the bot. There is a bot built by @kytrinyx that closes issues that do not fill out the issue template. This app although specifically designed for one repo, could easily be made configurable and close issues that don't fill out any issue template fields. So this could definitely be done.

An even more awesome feature would be to check if there are any fields in the template that need to be filled out, then ask the user to fill them out.

This could be a little more difficult to accomplish. The main problem I wouldn't be sure about would be determining what fields are missing? Most issue templates are just text, using your example, but a bit shortened:

Description

[Description of the issue]

OS version: [version here]

Steps to Reproduce

1. [First step]
2. [Second step]
3. [and so on]
Expected behavior: [What you expected to happen]

How would the bot determine what fields are missing? If there is no text in between Description and OS version? In between each number? What if your use case only takes 2 steps to reproduce? In some issue templates, certain fields are optional, and I haven't seen a standardized way of displaying that.

I think that @lee-dohm was actually interested in making a github app to solve this problem using some comparison of the original issue template to the body of the issue. Do you think request-info would be a good place for that to live?

Basically, I think this might be difficult to make work for many different issue templates, but I'd be +1 for adding the comment as well if the issue template wasn't edited at all.

from request-info.

hiimbex avatar hiimbex commented on September 28, 2024 1

That could work, I was thinking before assuming we base this only off of information from the issue template. But where would the above live? In a .github/config.yml file? It's somewhat inconvenient because then what if you change your issue template and forget to update the config file?

from request-info.

j-f1 avatar j-f1 commented on September 28, 2024 1

πŸ‘, let’s abandon the template-checking idea and just check for strict equality.

from request-info.

hiimbex avatar hiimbex commented on September 28, 2024 1

πŸ‘ I'll implement this shortly :)

from request-info.

welcome avatar welcome commented on September 28, 2024

Thanks for opening this issue, a maintainer will get back to you shortly!

from request-info.

j-f1 avatar j-f1 commented on September 28, 2024

Maybe something like this:

boilerplate:
  delimiters:
    - "["
    - "]"
  fields:
    - description of the issue
    - version here
    - first step
    - second step
    - and so on
    - what you expected to happen

It would search for [description of the issue], [version here], etc.

from request-info.

codebytere avatar codebytere commented on September 28, 2024

@hiimbex yo yo the electron team might be able to make some good use of this 😁 i'll take a swing at it soonish

from request-info.

j-f1 avatar j-f1 commented on September 28, 2024

@codebytere Have you had a chance to do this yet? If you’re busy, I can try to implement the feature this weekend.

from request-info.

hiimbex avatar hiimbex commented on September 28, 2024

I don't think anyone is desperate to implement this for hacktoberfest reasons, so whoever gets around to it first is fine with me! @j-f1 I'd say go for it! (Also if it's not implemented soonish, I can just do it too, I've just been busy lately)

from request-info.

codebytere avatar codebytere commented on September 28, 2024

Yeah i can probably get to it this weekend since our need for it has increased recently

from request-info.

stevenzeck avatar stevenzeck commented on September 28, 2024

I've created a bot similar to this, but checks for incomplete tasklists and keywords from the config file that should be in each issue. Not exactly looking at the issue template, but could go there eventually. https://github.com/szeck87/issue-complete

from request-info.

rsarky avatar rsarky commented on September 28, 2024

Heyy, I would love to fix this one for you. πŸ˜„

from request-info.

stevenzeck avatar stevenzeck commented on September 28, 2024

Believe this was done with #32

from request-info.

rsarky avatar rsarky commented on September 28, 2024

Thanks @szeck87

from request-info.

hiimbex avatar hiimbex commented on September 28, 2024

actually I think #32 applied to pull request templates, not issue templates. But there is already an open or for this issue.

from request-info.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.