12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697(********************************************************************************)(* crs - A tool for managing code review comments embedded in source code *)(* Copyright (C) 2024-2025 Mathieu Barbin <mathieu.barbin@gmail.com> *)(* *)(* This file is part of crs. *)(* *)(* crs is free software; you can redistribute it and/or modify it under the *)(* terms of the GNU Lesser General Public License as published by the Free *)(* Software Foundation either version 3 of the License, or any later version, *)(* with the LGPL-3.0 Linking Exception. *)(* *)(* crs is distributed in the hope that it will be useful, but WITHOUT ANY *)(* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS *)(* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License and *)(* the file `NOTICE.md` at the root of this repository for more details. *)(* *)(* You should have received a copy of the GNU Lesser General Public License *)(* and the LGPL-3.0 Linking Exception along with this library. If not, see *)(* <http://www.gnu.org/licenses/> and <https://spdx.org>, respectively. *)(********************************************************************************)moduleRaw_assignee=structtypet=|Not_due_now|Invalid|RecipientofVcs.User_handle.t|ReporterofVcs.User_handle.t|Unaddressedletcompute~cr~config:_=matchCr_comment.prioritycrwith|Soon|Someday->Not_due_now|Now->(matchCr_comment.headercrwith|Error_->Invalid|Okh->(matchCr_comment.Header.statushwith|XCR->Reporter(Cr_comment.Header.reporterh)|CR->(matchCr_comment.Header.recipienthwith|Someuser->Recipientuser|None->Unaddressed)));;endmoduleReason=structtypet=|Not_due_now|Recipient|Reporter|Default_repo_owner|No_default_repo_owner|Pull_request_author[@@derivingenumerate,sexp_of]letto_string_hum=function|Not_due_now->"CR not due now"|Recipient->"CR recipient"|Reporter->"CR reporter"|Default_repo_owner->"default repo owner"|No_default_repo_owner->"no default repo owner configured"|Pull_request_author->"PR author";;endtypet={user:Vcs.User_handle.toption;reason:Reason.t}[@@derivingsexp_of]letof_raw~(raw_assignee:Raw_assignee.t)~(config:Config.t)~(review_mode:Review_mode.t)=letdefault=matchreview_modewith|Pull_request{author;base=_}->{user=Someauthor;reason=Pull_request_author}|Revision->(matchConfig.default_repo_ownerconfigwith|Someowner->{user=Someowner;reason=Default_repo_owner}|None->{user=None;reason=No_default_repo_owner})inmatchraw_assigneewith|Not_due_now->{user=None;reason=Not_due_now}|Invalid->default|Recipientrecipient->{user=Somerecipient;reason=Recipient}|Reporterreporter->{user=Somereporter;reason=Reporter}|Unaddressed->default;;letcompute~cr~(config:Config.t)~(review_mode:Review_mode.t)=letraw_assignee=Raw_assignee.compute~cr~configinof_raw~raw_assignee~config~review_mode;;