Debian Codegraph @

docs/proposals/locking_notes.md

raw symbols SCIP
1 # Capture Locking Notes during Locks creation and retrieve same during List Locks.
2
3 ## Concept
4
5 The git-lfs REST API for Locks creation should be able to accept additonal attribute (message/notes) which would be easy to have some information related to lock creation. This same information can be retrieved back with the git-lfs List Locks REST API.
6
7 - Allow to have additional attribute to store the lock message/notes during lock creation
8 - Include lock message/notes in the git-lfs List Locks REST API response
9
10 ## API extensions
11
12 The current Git LFS File Locking API [https://github.com/git-lfs/git-lfs/blob/v3.2.0/docs/api/locking.md] doesn't have a field to capture some information related to Locks creation which would be useful to understand why and from where the lock was acquired.
13
14 With this enhancement, we can have some predefined comment as part of lock creation and get back same with the List Locks REST API so that it will be useful to differentiate and get more information on the File lock.
15
16 # Create Locks Enhancement API proposal
17
18 ### Request
19
20 ```
21 > POST https://lfs-server.com/locks
22 > Accept: application/vnd.git-lfs+json
23 > Content-Type: application/vnd.git-lfs+json
24 > Authorization: Basic ...
25 > {
26 > "path": "foo/bar.zip",
27 > "ref": {
28 > "name": "refs/heads/my-feature"
29 > },
30 > "notes": "Lock applied from Workspace A"
31 > }
32 ```
33
34 ### Response
35
36 * **Successful response**
37 ```
38 < HTTP/1.1 201 Created
39 < Content-Type: application/vnd.git-lfs+json
40 < {
41 < "lock": {
42 < "id": "some-uuid",
43 < "path": "foo/bar.zip",
44 < "locked_at": "2022-05-17T15:49:06+00:00",
45 < "owner": {
46 < "name": "Jane Doe"
47 < },
48 < "notes": "Lock applied from Workspace A"
49 < }
50 < }
51 ```
52
53 # List Locks Enhancement API proposal
54
55 ### Request (with notes -- notes=true)
56
57 ```
58 > GET https://lfs-server.com/locks?path=&id&cursor=limit&**notes=true**&refspec=
59 > Accept: application/vnd.git-lfs+json
60 > Authorization: Basic ... (if needed)
61 ```
62
63 ### Response
64
65 * **Successful response**
66 ```
67 < HTTP/1.1 200 Ok
68 < Content-Type: application/vnd.git-lfs+json
69 < {
70 < "locks": [
71 < {
72 < "id": "some-uuid",
73 < "path": "foo/bar.zip",
74 < "locked_at": "2022-05-17T15:49:06+00:00",
75 < "owner": {
76 < "name": "Jane Doe"
77 < },
78 < "notes": "Lock applied from Workspace A"
79 < }
80 < ],
81 < "next_cursor": "optional next ID"
82 < }
83 ```
84
85 ### Request (with out notes)
86
87 ```
88 > GET https://lfs-server.com/locks?path=&id&cursor=limit&refspec=
89 > Accept: application/vnd.git-lfs+json
90 > Authorization: Basic ... (if needed)
91 ```
92
93 ### Response
94
95 * **Successful response**
96 ```
97 < HTTP/1.1 200 Ok
98 < Content-Type: application/vnd.git-lfs+json
99 < {
100 < "locks": [
101 < {
102 < "id": "some-uuid",
103 < "path": "foo/bar.zip",
104 < "locked_at": "2022-05-17T15:49:06+00:00",
105 < "owner": {
106 < "name": "Jane Doe"
107 < }
108 < }
109 < ],
110 < "next_cursor": "optional next ID"
111 < }
112 ```
113
114 # List Locks for Verification Enhancement API proposal
115
116 ### Request (with notes)
117
118 ```
119 > POST https://lfs-server.com/locks/verify
120 > Accept: application/vnd.git-lfs+json
121 > Content-Type: application/vnd.git-lfs+json
122 > Authorization: Basic ...
123 > {
124 > "cursor": "optional cursor",
125 > "limit": 100, // also optional
126 > "ref": {
127 > "name": "refs/heads/my-feature"
128 > },
129 > "notes" : true, // also optional
130 > }
131 ```
132
133 ### Response
134
135 * **Successful response**
136 ```
137 < HTTP/1.1 200 Ok
138 < Content-Type: application/vnd.git-lfs+json
139 < {
140 < "ours": [
141 < {
142 < "id": "some-uuid",
143 < "path": "/path/to/file",
144 < "locked_at": "2016-05-17T15:49:06+00:00",
145 < "owner": {
146 < "name": "Jane Doe"
147 < },
148 < "notes": "Lock applied from Workspace A"
149 < }
150 < ],
151 < "theirs": [],
152 < "next_cursor": "optional next ID"
153 < }
154 ```
155
156 ### Request (with out notes)
157
158 ```
159 > POST https://lfs-server.com/locks/verify
160 > Accept: application/vnd.git-lfs+json
161 > Content-Type: application/vnd.git-lfs+json
162 > Authorization: Basic ...
163 > {
164 > "cursor": "optional cursor",
165 > "limit": 100, // also optional
166 > "ref": {
167 > "name": "refs/heads/my-feature"
168 > }
169 > }
170 ```
171
172 ### Response
173
174 * **Successful response**
175 ```
176 < HTTP/1.1 200 Ok
177 < Content-Type: application/vnd.git-lfs+json
178 < {
179 < "ours": [
180 < {
181 < "id": "some-uuid",
182 < "path": "/path/to/file",
183 < "locked_at": "2016-05-17T15:49:06+00:00",
184 < "owner": {
185 < "name": "Jane Doe"
186 < }
187 < }
188 < ],
189 < "theirs": [],
190 < "next_cursor": "optional next ID"
191 < }
192 ```
193