Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15461454
D14428.id34856.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D14428.id34856.diff
View Options
diff --git a/src/applications/diffusion/conduit/DiffusionUpdateCoverageConduitAPIMethod.php b/src/applications/diffusion/conduit/DiffusionUpdateCoverageConduitAPIMethod.php
--- a/src/applications/diffusion/conduit/DiffusionUpdateCoverageConduitAPIMethod.php
+++ b/src/applications/diffusion/conduit/DiffusionUpdateCoverageConduitAPIMethod.php
@@ -25,6 +25,7 @@
'branch' => 'required string',
'commit' => 'required string',
'coverage' => 'required map<string, string>',
+ 'mode' => 'optional string',
);
}
@@ -77,11 +78,26 @@
$table_name = 'repository_coverage';
$conn->openTransaction();
- queryfx(
- $conn,
- 'DELETE FROM %T WHERE branchID = %d',
- $table_name,
- $branch->getID());
+ $mode = $request->getValue('mode');
+ switch ($mode) {
+ case '':
+ case 'set':
+ // sets the coverage for the whole branch, deleting any previous
+ // coverage information
+ queryfx(
+ $conn,
+ 'DELETE FROM %T WHERE branchID = %d',
+ $table_name,
+ $branch->getID());
+ break;
+ case 'overwrite':
+ // sets or overwrites coverage for the provided files on the
+ // specified commit
+ break;
+ default:
+ $conn->killTransaction();
+ throw new Exception(pht('Invalid mode "%s".', $mode));
+ }
foreach (PhabricatorLiskDAO::chunkSQL($sql) as $chunk) {
queryfx(
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Apr 2 2025, 8:26 AM (5 w, 1 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7720425
Default Alt Text
D14428.id34856.diff (1 KB)
Attached To
Mode
D14428: add "update" mode to Diffusion coverage Conduit
Attached
Detach File
Event Timeline
Log In to Comment