Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cleanup.proto « proto - gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 77cf6c6a3ef4c648c68d70fd89ca6fc83f9a03ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
syntax = "proto3";

package gitaly;

import "lint.proto";
import "shared.proto";

option go_package = "gitlab.com/gitlab-org/gitaly/v16/proto/go/gitalypb";

// CleanupService provides RPCs to clean up a repository's contents.
service CleanupService {

  // ApplyBfgObjectMapStream ...
  rpc ApplyBfgObjectMapStream(stream ApplyBfgObjectMapStreamRequest) returns (stream ApplyBfgObjectMapStreamResponse) {
    option (op_type) = {
      op: MUTATOR
    };
  }

  // RewriteHistory redacts targeted strings and deletes requested blobs in a
  // repository and updates all references to point to the rewritten commit
  // history. This is useful for removing inadvertently pushed secrets from your
  // repository and purging large blobs. This is a dangerous operation.
  //
  // The following known error conditions may happen:
  //
  // - `InvalidArgument` in the following situations:
  //    - The provided repository can't be validated.
  //    - The repository field is set on any request other than the initial one.
  //    - Any request, including the initial one, does not contain either blobs to
  //      remove or redaction patterns to redact.
  //    - A blob object ID is invalid.
  //    - A redaction pattern contains a newline character.
  rpc RewriteHistory(stream RewriteHistoryRequest) returns (RewriteHistoryResponse) {
    option (op_type) = {
      op : MUTATOR
    };
  }

}

// ApplyBfgObjectMapStreamRequest ...
message ApplyBfgObjectMapStreamRequest {
  // repository ...
  // Only available on the first message
  Repository repository = 1 [(target_repository)=true];

  // object_map is a raw object-map file as generated by BFG: https://rtyley.github.io/bfg-repo-cleaner
  // Each line in the file has two object SHAs, space-separated - the original
  // SHA of the object, and the SHA after BFG has rewritten the object.
  bytes object_map = 2;
}

// ApplyBfgObjectMapStreamResponse ...
message ApplyBfgObjectMapStreamResponse {
  // Entry refers to each parsed entry in the request's object map so the client
  // can take action.
  message Entry {
    // type ...
    ObjectType type = 1;
    // old_oid ...
    string old_oid = 2;
    // new_oid ...
    string new_oid = 3;
  }

  // entries ...
  repeated Entry entries = 1;
}

// RewriteHistoryRequest is a request for the RewriteHistory RPC.
// Each request must contain blobs, redactions, or both.
message RewriteHistoryRequest {
  // repository is the repository that shall be rewritten.
  // Must be sent on the first request only.
  Repository repository = 1 [(target_repository)=true];
  // blobs is the list of blob object ids that will be removed from history.
  repeated string blobs = 2;
  // redactions is the list of literals or patterns that will be replaced
  // with "***REMOVED***". Items cannot contain newline characters.
  // See https://htmlpreview.github.io/?https://github.com/newren/git-filter-repo/blob/docs/html/git-filter-repo.html
  // for a full explanation of what patterns are supported.
  repeated bytes redactions = 3;
}

// RewriteHistoryResponse a response for the RewriteHistory RPC.
message RewriteHistoryResponse {
}