Skip to content

Commit 29d9e78

Browse files
refactor: rename event for clarity
1 parent 188c27d commit 29d9e78

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/bors/event.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ pub enum BorsRepositoryEvent {
77
/// A comment was posted on a pull request.
88
Comment(PullRequestComment),
99
/// When a new commit is pushed to the pull request branch.
10-
PullRequestPushed(PullRequestPushed),
10+
PullRequestCommitPushed(PullRequestPushed),
1111
/// When the pull request is edited by its author
1212
PullRequestEdited(PullRequestEdited),
1313
/// A workflow run on Github Actions or a check run from external CI system has been started.
@@ -23,7 +23,7 @@ impl BorsRepositoryEvent {
2323
pub fn repository(&self) -> &GithubRepoName {
2424
match self {
2525
BorsRepositoryEvent::Comment(comment) => &comment.repository,
26-
BorsRepositoryEvent::PullRequestPushed(payload) => &payload.repository,
26+
BorsRepositoryEvent::PullRequestCommitPushed(payload) => &payload.repository,
2727
BorsRepositoryEvent::PullRequestEdited(payload) => &payload.repository,
2828
BorsRepositoryEvent::WorkflowStarted(workflow) => &workflow.repository,
2929
BorsRepositoryEvent::WorkflowCompleted(workflow) => &workflow.repository,

src/bors/handlers/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ pub async fn handle_bors_repository_event(
122122
.instrument(span.clone())
123123
.await?;
124124
}
125-
BorsRepositoryEvent::PullRequestPushed(payload) => {
125+
BorsRepositoryEvent::PullRequestCommitPushed(payload) => {
126126
let span =
127127
tracing::info_span!("Pull request pushed", repo = payload.repository.to_string());
128128

src/github/webhook.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ fn parse_pull_request_events(body: &[u8]) -> anyhow::Result<Option<BorsEvent>> {
223223
)))
224224
}
225225
PullRequestEventAction::Synchronize => Ok(Some(BorsEvent::Repository(
226-
BorsRepositoryEvent::PullRequestPushed(PullRequestPushed {
226+
BorsRepositoryEvent::PullRequestCommitPushed(PullRequestPushed {
227227
pull_request: payload.pull_request.into(),
228228
repository: repository_name,
229229
}),

0 commit comments

Comments
 (0)