summaryrefslogtreecommitdiff
path: root/repo.proto
blob: 71f301053caf1a3f6371d3c1d0023cc603744d67 (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
syntax = "proto3";

package gitpb;

// stores information about git repos
// If the project is in golang, also gets the go language dependacies

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

// global settings for autogenpb `autogenpb:mutex`

message Repo {						// `autogenpb:marshal`
	string 	fullPath			= 1;	// `autogenpb:unique` 	// the actual path to the .git directory: '/home/devel/golang.org/x/tools'
	google.protobuf.Timestamp lastPull	= 2;		// last time a git pull was done
	string 	masterBranchName		= 3; 		// git 'main' or 'master' branch name
	string 	develBranchName			= 4; 		// whatever the git 'devel' branch name is
	string 	userBranchName			= 5; 		// whatever your username branch is
	GitTags tags				= 6;		// known tags
	string	goPath				= 7;	// `autogenpb:unique` 	// the logical path as used by golang: 'go.wit.com/apps/helloworld'
	bool	goLibrary 			= 8;		// is this a golang library?
	bool	goBinary  			= 9;		// is this a golang binary?
	bool	goPrimitive		 	= 10;		// if this is a golang primitive (only has go.mod)
	bool	goPlugin			= 11;		// is this a golang plugin?
	GoDeps	goDeps 				= 12;		// what is in the go.sum file
	google.protobuf.Timestamp lastGoDep	= 13;		// last time go.sum was processed
	bool	dirty				= 14;		// if git says things have been changed
	GoDeps	published			= 15;		// the last published go.mod/go.sum
	string	targetVersion			= 16; 		// useful during the package release process
	bool	readOnly			= 17; 		// tracks access to 'git push'
	string	URL				= 18; 		// the URL. amazingly I didn't add this earlier. duh.
	bool	goProtobuf			= 19;		// autogen go files from .proto
	string	desc				= 20; 		// what is this repo?
	bytes	goMod				= 21; 		// the last go.mod file
	bytes	goSum				= 22; 		// the last go.sum file
	google.protobuf.Timestamp mtimeGitDir	= 23;		// mtime for ./git
	google.protobuf.Timestamp mtimeGitHead	= 24;		// mtime for ./git/HEAD // these two mtimes allow really fast checks to see if git has changed
        GitTimes   times			= 25; 		// store all the mtime values here. these are temporary
        GoInfo  goInfo  			= 26; 		// put all the go specifcs here
	string	stateChange			= 27; 		// reason for state change
}

message Repos {				// `autogenpb:marshal`
	string   uuid	        = 1;    // `autogenpb:uuid:8daaeba1-fb1f-4762-ae6e-95a55d352673`
	string   version        = 2;    // maybe can be used for protobuf schema change violations
	repeated Repo repos 	= 3;
}

// should it be done this way?
message GitTimes {
	google.protobuf.Timestamp lastPull	= 1;		// last time a git pull was done
	google.protobuf.Timestamp lastUpdate	= 2;		// when was ReloadGit() last done
	google.protobuf.Timestamp lastDirty	= 3;		// last time CheckDirty() was run
	google.protobuf.Timestamp mtimeDir	= 4;		// mtime for ./git // maybe useful to track
	google.protobuf.Timestamp mtimeHead	= 5;		// mtime for ./git/HEAD // these two mtimes allow really fast checks to see if git has changed
	google.protobuf.Timestamp mtimeIndex    = 6;		// mtime for ./git/HEAD // probably always in sync with HEAD
	google.protobuf.Timestamp mtimeFetch    = 7;		// mtime for ./git/FETCH_HEAD // last time 'git fetch' or 'git pull' was run on current branch?
}

// this is probably better. think about moving to this instead
message GoInfo {
	string	goPath				= 1;		// the logical path as used by golang: 'go.wit.com/apps/helloworld'
	string	desc				= 2; 		// what is this repo?
	bool	goLibrary 			= 3;		// is this a golang library?
	bool	goBinary  			= 4;		// is this a golang binary?
	bool	goPrimitive		 	= 5;		// if this is a golang primitive (only has go.mod)
	bool	goPlugin			= 6;		// is this a golang plugin?
	bool	goProtobuf			= 7;		// autogen go files from .proto
	GoDeps	goDeps 				= 8;		// what is in the go.sum file
	GoDeps	published			= 9;		// the last published go.mod/go.sum
	bytes	goMod				= 10; 		// the last go.mod file
	bytes	goSum				= 11; 		// the last go.sum file
}