Skip to main content

Module comments

Module comments 

Source
Expand description

Reading what other people said on a pull request or an issue, and answering it.

This is the only GraphQL in spar, and it is one read and one mutation. Everything else here is REST, which keeps the surface that can fail on an old gh or a locked down Enterprise token down to two calls.

GraphQL is not a preference. REST has always served a pull request’s inline comments and has never served whether the thread they sit in is resolved, and resolved is the whole point: it is the one signal that is authoritative, shared between machines, and free.

Re-exports§

pub use crate::model::Author;

Structs§

Gathered
What was found, and what was passed over.
IssueText
An issue as a prompt carries it, and what was left out of it.
Pending
One thing somebody said that spar has not answered.
RawComment
RawThread
Said
Something somebody other than the viewer said on a pull request after a given time: a message in a review thread, a review body, or a comment.
ThreadComments

Enums§

CommentKind
Where a comment lives, which is what decides how spar can answer it.

Functions§

answered_after
Whether anything the viewer wrote lands after at.
gather
Everything on this pull request or issue that spar has not answered.
issue_for_prompt
The body as filed, then what was said on the issue since.
later_than
Strictly after, in GitHub’s fixed width UTC form. Anything malformed is not after: the fail safe direction for a trigger is silence, as it is for answered_after.
parse_review_threads
Pull the threads out of whatever gh api graphql --paginate printed.
said_in_threads
What the threads hold that others said after since. Resolved threads are included: an author who replied “fixed in abc1234” and resolved the thread has said exactly the thing a second look exists to check.
said_since
Everything others said on a pull request after since, oldest first.
same_login
GitHub logins are case insensitive, and gh api user and the GraphQL author.login have not always agreed on casing. A mismatch here means spar reads its own replies as requests, which does not terminate.
thread_wants_an_answer
Whether a thread still wants an answer.
threads_from_rest
Rebuild threads from the REST inline comments, for a host where the GraphQL query will not run.