Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/ofborg
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 1783e3a0e483
Choose a base ref
...
head repository: NixOS/ofborg
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 17f9a17f6a59
Choose a head ref
  • 2 commits
  • 3 files changed
  • 1 contributor

Commits on Aug 9, 2018

  1. Don't trigger events on deleted comments

    According to
    https://developer.github.com/v3/activity/events/types/#issuecommentevent
    we should just filter out delete actions.
    
    Closes #156
    grahamc committed Aug 9, 2018
    Copy the full SHA
    43dc12d View commit details
  2. Merge pull request #214 from NixOS/bug-156-deleted-comments

    Don't trigger events on deleted comments
    grahamc authored Aug 9, 2018
    Copy the full SHA
    17f9a17 View commit details
Showing with 14 additions and 1 deletion.
  1. +9 −0 ofborg/src/ghevent/issuecomment.rs
  2. +1 −1 ofborg/src/ghevent/mod.rs
  3. +4 −0 ofborg/src/tasks/githubcommentfilter.rs
9 changes: 9 additions & 0 deletions ofborg/src/ghevent/issuecomment.rs
Original file line number Diff line number Diff line change
@@ -2,7 +2,16 @@ use ofborg::ghevent::{Comment, Repository, Issue};

#[derive(Serialize, Deserialize, Debug)]
pub struct IssueComment {
pub action: IssueCommentAction,
pub comment: Comment,
pub repository: Repository,
pub issue: Issue,
}

#[derive(Serialize, Deserialize, Debug, PartialEq)]
#[serde(rename_all="snake_case")]
pub enum IssueCommentAction {
Created,
Edited,
Deleted,
}
2 changes: 1 addition & 1 deletion ofborg/src/ghevent/mod.rs
Original file line number Diff line number Diff line change
@@ -2,6 +2,6 @@ mod common;
mod issuecomment;
mod pullrequestevent;

pub use self::issuecomment::IssueComment;
pub use self::issuecomment::{IssueComment,IssueCommentAction};
pub use self::pullrequestevent::{PullRequest, PullRequestEvent, PullRequestAction, PullRequestState};
pub use self::common::{Issue, Repository, User, Comment};
4 changes: 4 additions & 0 deletions ofborg/src/tasks/githubcommentfilter.rs
Original file line number Diff line number Diff line change
@@ -50,6 +50,10 @@ impl worker::SimpleWorker for GitHubCommentWorker {
}

fn consumer(&mut self, job: &ghevent::IssueComment) -> worker::Actions {
if job.action == ghevent::IssueCommentAction::Deleted {
return vec![worker::Action::Ack];
}

let instructions = commentparser::parse(&job.comment.body);
if instructions == None {
return vec![worker::Action::Ack];