summaryrefslogtreecommitdiff
path: root/patchset.proto
blob: edcd77d8ff7f7cdd048c1c2d4a96b2d505afe415 (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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
// Copyright 2025 WIT.COM Inc Licensed GPL 3.0

syntax = "proto3";

package forgepb;

import "google/protobuf/timestamp.proto"; // Import the well-known type for Timestamp

//    Forge doesn't need this kind of specificity
//    but this is what the patch files contain and how git sees them
// message Blob {
//         string hunkLine         = 1;
//         bytes  data             = 2;
// }
//
// message File {
//         string filename         = 1;
//         string hashLine         = 2;
// 	   repeated Blob  Blobs    = 3;
// }
//
// message Patch {
// 	repeated File  Files    = 1;
//      string repoNamespace    = 2;
// 	string   gH             = 3;
// 	string   gaI            = 4;
// 	string   gcI            = 5;
// }

// git log -1 --format="%H %aI %cI %an %ae %cn %ce"

message Patch {
        string                      namespace           = 1;  // the base repo git namespace
        bytes                       data                = 2;  // the raw data of the whole patch
        string                      gH                  = 3;  // after some deliberation, I think I'll just try variable names
        string                      gT                  = 4;
        string                      gP                  = 5;
        string                      gs                  = 6;
        string                      gaI                 = 7;  // that exactly match what git uses.
        string                      gan                 = 8;
        string                      gae                 = 9;
        string                      gcI                 = 10;
        string                      gcn                 = 11;
        string                      gce                 = 12;
        string                      gN                  = 13;
        string                      gGG                 = 14;
        string                      gGS                 = 15;
        string                      gGK                 = 16;
        string                      newHash             = 17; // new hash
        string                      state               = 18; // the 'state' of the patch
        string                      filename            = 19; // `autogenpb:unique` `autogenpb:sort`
        string                      startHash           = 20; // the start commit hash
        string                      commitHash          = 21; // the git commit hash of this patch `autogenpb:sort` `autogenpb:unique`
        string                      comment             = 22; // the git commit message (in patch form)
        repeated string             Files               = 23; // the filenames this patch changes
        google.protobuf.Timestamp   ctime               = 24; // create time of the patch
        bool                        applied             = 25; // have you applied this patch?
        bool                        upstream            = 26; // has this patch been applied upstream?
}

// this is a "PATCH: [1/x]" series
message Patches {                                             // `autogenpb:marshal` `autogenpb:gui:Patch`
        message HttpRequest {                              // HttpRequest represents the essential fields of an incoming HTTP request.
                string                method         = 1;  // The request method, e.g., "GET", "POST".
                string                url            = 2;  // The full URL of the request, including scheme, host, path, and query string.
                string                route          = 3;  // just the route: "/add/" or "/find/"
                string                proto          = 4;  // The protocol version, e.g., "HTTP/1.1", "HTTP/2.0".
                map<string, string>   headers        = 5;  // The map of request headers. Header names are case-insensitive,
                string                remoteAddr     = 6;  // The remote IP address of the client, after resolving proxies.
                string                host           = 7;  // The host on which the URL is sought (www.wit.com)
                string                hostname       = 8;  // The hostname of the client if passed from the client (mylaptop.fun.me)
                bytes                 body           = 9;  // The request body as raw bytes.
                string                namespace      = 10; // When the body is a pb (always!). This is the pb namespace ("go.wit.com/lib/protobuf/virtpb")
        }
        string                      uuid                = 1;  // `autogenpb:uuid:2679065e-c81d-4a00-aca4-03c158a834fb`
        string                      version             = 2;  // `autogenpb:version:v2.0.0`
        repeated Patch              Patches             = 3;
        HttpRequest                 httpRequest         = 4;  // who connected // rename httpRequest? This might make sense in our case
        string                      Error               = 5;  // when passing these around, if there is an error, store it here
}
message Patchset {                                            // `autogenpb:marshal`
        Patches                     patches             = 1;  //
        string                      name                = 2;  // `autogenpb:sort`
        string                      comment             = 3;  //
        string                      gitAuthorName       = 4;  // `autogenpb:sort`
        string                      gitAuthorEmail      = 5;  //
        google.protobuf.Timestamp   ctime               = 6;  // create time of the patchset
        string                      tmpDir              = 7;  // temp dir
        string                      startBranchName     = 8;  //
        string                      endBranchName       = 9;  //
        string                      startBranchHash     = 10; //
        string                      endBranchHash       = 11; //
        string                      state               = 12; // the state of the patch
        string                      uuid                = 13; // `autogenpb:sort` `autogenpb:unique`
        string                      hostname            = 14; //
}

message Patchsets {                                           // `autogenpb:marshal` `autogenpb:gui` `autogenpb:nomutex`
        string                      uuid                = 1;  // `autogenpb:uuid:be926ad9-f07f-484c-adf2-d96eeabf3079`
        string                      version             = 2;  // `autogenpb:version:v0.0.45`
        repeated Patchset           Patchsets           = 3;
}