Sign in

Search issue titles and bodies, change requests and comments. Private repositories you cannot read are not included.

vole
Site
Clone

Read only, no credentials:

https://rodent.software/vole.git

Write over SSH with a registered key:

git clone ssh://git@rodent.software/vole.git

Self-hosted forge that lives in your Git repo.

Let a release change until a channel names it

214e7ea67ccb37d356a52097f8ce838bdf4c1731 · Keenan Nemetz · 17d ago · parent 502119f4

Let a release change until a channel names it

A release is mutable again. Notes can be edited and files added, replaced,
or removed after publication, because a mistyped note or a rebuilt binary
is not a reason to cut a new version. Editing the notes re-tags the same
commit, which the old rule refused from the first attached file.

The one thing that stays frozen is a release a channel names. A channel
records the tag name and the tag object, so a re-tag would dangle it and a
changed pointer would serve different bytes under a URL a package manager
already cached. Pre-receive reads the channel table from the instance
database and refuses every change to a channeled release — tag moves and
deletes, and added, replaced, or removed pointers alike — naming the
channel and how to move it. The browser applies the same rule: the edit
form, the attach form, and the list link are all drawn from it.

Attaching also works from the browser now, at parity with the CLI. The
Artifacts card takes files, or a directory, and an optional directory to
publish under; the handler streams each part to a temp file while hashing
it, checks the object-store quota before storing anything, writes bytes
first and pointers second, and calls the same metadata writer the CLI
does. A directory upload keeps its paths, which is why the body is read as
a multipart stream rather than through ParseForm.

server/web/templates/releases.html +28−5

@@ -46,7 +46,7 @@
46 46 {{if .Tags}}
47 47 <div class="panel">
48 48 <table>
49 <tr><th>Tag</th><th>Notes</th>{{if .Channels}}<th>Channels</th>{{end}}<th>Tagger</th><th>Age</th><th>Source</th>{{if .CanManage}}<th></th>{{end}}</tr>
49 <tr><th>Tag</th><th>Notes</th>{{if .Channels}}<th>Channels</th>{{end}}<th>Tagger</th><th>Age</th><th>Source</th>{{if .AnyEditable}}<th></th>{{end}}</tr>
50 50 {{range .Tags}}
51 51 <tr>
52 52 <td><a href="/{{$.Name}}/releases/{{esc .Name}}">{{.Name}}</a>{{if not .Annotated}} <span class="label">lightweight</span>{{end}}</td>
@@ -55,7 +55,7 @@
55 55 <td class="muted">{{if .Tagger}}{{.Tagger}}{{else}}—{{end}}</td>
56 56 <td class="muted">{{since .When}}</td>
57 57 <td><a href="/{{$.Name}}/releases/{{esc .Name}}/archive.tar">tar</a> · <a href="/{{$.Name}}/releases/{{esc .Name}}/archive.tar.gz">tar.gz</a></td>
58 {{if $.CanManage}}<td>{{if .Annotated}}<a href="/{{$.Name}}/releases/edit?tag={{urlquery .Name}}">edit notes</a>{{end}}</td>{{end}}
58 {{if $.AnyEditable}}<td>{{if index $.Editable .Name}}<a href="/{{$.Name}}/releases/edit?tag={{urlquery .Name}}">edit notes</a>{{end}}</td>{{end}}
59 59 </tr>
60 60 {{end}}
61 61 </table>
@@ -108,7 +108,7 @@ records a tagger and a message, which is what makes a tag a release.</p>
108 108 {{range .Artifacts}}
109 109 <tr>
110 110 <td><a href="/{{$.Name}}/releases/{{esc $.Tag.Name}}/artifacts/{{.Name}}">{{.Name}}</a></td>
111 <td class="muted">{{.Size}}</td>
111 <td class="muted">{{bytes .Size}}</td>
112 112 <td class="muted"><code>{{short .OID}}</code></td>
113 113 <td><a href="/{{$.Name}}/releases/{{esc $.Tag.Name}}/artifacts/{{.Name}}">download</a></td>
114 114 </tr>
@@ -117,8 +117,31 @@ records a tagger and a message, which is what makes a tag a release.</p>
117 117 <p class="muted">Bytes live once in the instance's content-addressed store, so the same
118 118 file on two releases costs one copy.</p>
119 119 {{else}}
120 <p class="muted">No artifacts attached. Push the tag first, then:</p>
121 <pre>vole release attach {{.Tag.Name}} dist/*</pre>
120 <p class="muted">No artifacts attached yet. Attach them here, or push the tag first and run
121 <code>vole release attach {{.Tag.Name}} dist/*</code>.</p>
122 {{end}}
123 {{if .CanAttach}}
124 <form method="post" action="/{{.Name}}/releases/{{esc .Tag.Name}}/attach" enctype="multipart/form-data" class="form-block">
125 <input type="hidden" name="csrf" value="{{.CSRF}}">
126 <label>Files
127 <input type="file" name="files" multiple required>
128 </label>
129 <label>or a directory
130 <input type="file" name="files" multiple webkitdirectory>
131 </label>
132 <label>Publish under (optional directory)
133 <input type="text" name="path" placeholder="apt" autocomplete="off">
134 </label>
135 <div class="form-actions">
136 <button type="submit">{{icon "tag"}}Attach files</button>
137 </div>
138 <p class="muted">A file is attached under its name, or under the directory you name
139 above. A browser upload is limited to {{bytes .UploadCap}}; attach a larger set with
140 <code>vole release attach</code>.</p>
141 </form>
142 {{else if .ChannelLocked}}
143 <p class="muted">A channel targets this release, so its notes and files are fixed.
144 Point the channel at another release to edit this one.</p>
122 145 {{end}}
123 146 </div>
124 147