123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596(********************************************************************************)(* 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}->{user=Someauthor;reason=Pull_request_author}|Commit->(matchconfig.default_repo_ownerwith|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;;