compliance: Expose some more methods (#53831)
They will again come in handy for the GitHub worker. Release Notes: - N/A
This commit is contained in:
1 parent
15dce9de1c
commit
909dfd0a5c
2 files changed
+15
-1
No files matched your search
@@ -110,7 +110,10 @@ impl<'a> Reporter<'a> {
|
||||
}
|
||||
|
||||
/// Method that checks every commit for compliance
|
||||
async fn check_commit(&self, commit: &CommitDetails) -> Result<ReviewSuccess, ReviewFailure> {
|
||||
pub async fn check_commit(
|
||||
&self,
|
||||
commit: &CommitDetails,
|
||||
) -> Result<ReviewSuccess, ReviewFailure> {
|
||||
let Some(pr_number) = commit.pr_number() else {
|
||||
return Err(ReviewFailure::NoPullRequestFound);
|
||||
};
|
||||
|
||||
@@ -127,6 +127,17 @@ pub struct CommitDetails {
|
||||
body: String,
|
||||
}
|
||||
|
||||
impl CommitDetails {
|
||||
pub fn new(sha: CommitSha, author: Committer, title: String, body: String) -> Self {
|
||||
Self {
|
||||
sha,
|
||||
author,
|
||||
title,
|
||||
body,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub struct Committer {
|
||||
name: String,
|
||||
|
||||
Reference in new issue
Block a user