Ticket created by ~gpanders on ~xenrox/hut
When the config file contains an invalid access token (e.g. a garbage value like
"invalid_token"
), runninghut builds list
results in a SIGSEGV.System: macOS 12.3.1
Go version: go version go1.18.1 darwin/arm64
Config file:
instance "sr.ht" { access-token "something_fake" }
Reproduce:
hut builds listStack trace:
panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x2 addr=0x0 pc=0x100bb9d04] goroutine 1 [running]: main.newBuildsListCommand.func1(0x14000186000?, {0x1400014a740?, 0x2?, 0x2?}) /Users/greg/src/hut/builds.go:318 +0x94 github.com/spf13/cobra.(*Command).execute(0x14000186000, {0x1400014a700, 0x2, 0x2}) /Users/greg/.go/pkg/mod/github.com/spf13/cobra@v1.4.0/command.go:860 +0x4ac github.com/spf13/cobra.(*Command).ExecuteC(0x14000154f00) /Users/greg/.go/pkg/mod/github.com/spf13/cobra@v1.4.0/command.go:974 +0x354 github.com/spf13/cobra.(*Command).Execute(...) /Users/greg/.go/pkg/mod/github.com/spf13/cobra@v1.4.0/command.go:902 github.com/spf13/cobra.(*Command).ExecuteContext(...) /Users/greg/.go/pkg/mod/github.com/spf13/cobra@v1.4.0/command.go:895 main.main() /Users/greg/src/hut/main.go:49 +0x29c
I ran it in Delve and pinpointed it to this line in
builds.go
:for _, job := range jobs.Results { printJob(&job) }Printing
jobs
in Delve shows:(dlv) p jobs *git.sr.ht/~emersion/hut/srht/buildssrht.JobCursor { Results: []git.sr.ht/~emersion/hut/srht/buildssrht.Job len: 0, cap: 0, [], Cursor: *(unreadable invalid length: -486054628144709631),}
It looks to me like the cursor is invalid, but I could be misunderstanding what it's supposed to look like.
Notably, this does not happen with other commands such as
hut todo list
orhut lists list
.
Comment by ~gpanders on ~sircmpwn/lists.sr.ht
Should be resolved by https://git.sr.ht/~sircmpwn/lists.sr.ht/commit/420d8d3cd8d75e69bbd8cb4be7ac43aa46818a17
Comment by ~gpanders on ~sircmpwn/man.sr.ht
Looks like this was resolved by this commit.
REPORTED
RESOLVED IMPLEMENTEDTicket created by ~gpanders on ~sircmpwn/man.sr.ht
Currently the title of the wiki page is displayed alongside the username and repo. This crowds the title and makes the title of the page harder to read (example here).
Consider separating the username and repo from the title of the page, instead displaying it in a different location. This makes it clear the wiki page belongs to a user and is not part of the official sourcehut documentation, while still allowing the title of the page to stand alone.
Further discussion on the mailing list here.
Ticket created by ~gpanders on ~sircmpwn/git.sr.ht
If I upload an asset to a tag (under
refs
) and then that tag is deleted (either explicitly or if the tag gets moved and pushed with--force
), the assets seem to persist and cannot be reuploaded (when I try it says "A file by this name was already uploaded").Steps to reproduce:
In any git repo, create a new tag (e.g.
test
)git tag -a test -m "Test tag" git push --tags
In the git.sr.ht web interface, navigate to the
refs
tab and select the 'test' tagUpload/attach a file to the ref using the upload form
Move the tag to a different ref and force push it to the remote
git tag -a test -m "Test tag" -f HEAD^ git push --tags --force
Repeat steps 2-3 (ensure the same file is uploaded from step 3). Step 3 fails with "A file by this name was already uploaded".
As far as I can tell, there is no way to access the attachments from the original ref (before it was moved), so they cannot be deleted.