tobie / pr-preview

Adds preview and diff to spec pull requests.
Apache License 2.0
33 stars 16 forks source link

include instructions for reporting problems in the pr-preview comment #107

Open equalsJeffH opened 2 years ago

equalsJeffH commented 2 years ago

presently comment in the pr-preview block (i.e., the comment + the links inserted into a github PR's original post) does not include instructions for how to report issues with pr-preview.

Perhaps something like this would work:

<!--
    This comment and the below content is programmatically generated.
    You may add a comma-separated list of anchors you'd like a
    direct link to below (e.g. #idl-serializers, #idl-sequence):

    Don't remove this comment or modify anything below this line.
    If you don't want a preview generated for this pull request,
    just replace the whole of this comment's content by "no preview"
    and remove what's below.
                                                             // new
    Please report problems by submitting an issue at:        // new
    https://github.com/tobie/pr-preview/                     // new
-->

...?

tobie commented 2 years ago

That sounds like a good idea.

Here are the files that would need to be updated:

  1. https://github.com/tobie/pr-preview/blob/master/lib/views/base.js
  2. https://github.com/tobie/pr-preview/blob/master/test/models/pr.js
  3. https://github.com/tobie/pr-preview/blob/master/test/fixtures/pr2.json
  4. https://github.com/tobie/pr-preview/blob/master/test/fixtures/pr.json

A fix for this would need to stay compatible with pre-existing pull requests and tests should test both scenarios. I think that in practice this is actually easier than it sounds, as the logic relies on the INTRO part of the comment to remove an existing comment.