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.
asks_viewer
Whether one row, as the REST API returns an issue, a comment, or a review, is a person asking for the viewer by name. The viewer’s own words do not count, nor a bot’s, nor anything spar composed, whoever’s spar it was: none of them is somebody asking, and two of them answering each other is a loop.
defuse_mentions
The same text with every mention that would notify somebody put in a code span, where GitHub notifies nobody.
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.
mentioned_in
Whether a person asked for the viewer by name after since, in any of rows: review comments, reviews, or comments as the REST API returns them.
mentions
Whether text asks for the viewer by name: @viewer, or @org/team for a team in_team says the viewer is in. A team nobody could check counts, as it does for a review request. An @ inside a word is an email address or code, and a login that runs on past the viewer’s is somebody else’s.
parse_review_threads
Pull the threads out of whatever gh api graphql --paginate printed.
row_at
When a REST row was written: created_at, or a review’s submitted_at.
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.