From Thorben Günther to ~sircmpwn/sr.ht-discuss
On Wed, Aug 30, 2023 at 11:48:24AM +0200, Robin Jarry wrote: > But I get errors: > > Native webhooks are not supported with web authentication > > I don't know what that means. You have to run this query through curl/hut(1), e.g. like this: hut graphql lists
From Thorben Günther to ~emersion/hut-dev
--- builds.go | 5 +++++ srht/buildssrht/gql.go | 2 +- srht/buildssrht/operations.graphql | 3 +++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/builds.go b/builds.go index 687e211..8894c2e 100644 --- a/builds.go @@ -659,6 +659,11 @@ func printSecret(w io.Writer, secret *buildssrht.Secret) { var s string created := termfmt.Dim.String(humanize.Time(secret.Created.Time)) s += fmt.Sprintf("%s\t%s\n", termfmt.DarkYellow.Sprint(secret.Uuid), created) [message trimmed]
From Thorben Günther to ~sircmpwn/sr.ht-dev
On Mon, Aug 28, 2023 at 05:54:40PM +0200, Drew DeVault wrote: > > Besides - I think - some queries will fail with this patch, since > > `from_user_id` will be NULL for all old secrets after the migration. > > Not sure I understand. I just played around with the new feature, the GraphQL "secrets" query does indeed fail.
From Thorben Günther to ~sircmpwn/sr.ht-dev
The html template uses "username" and not "user". --- api/graph/schema.resolvers.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/graph/schema.resolvers.go b/api/graph/schema.resolvers.go index 029c81c..feb467d 100644 --- a/api/graph/schema.resolvers.go +++ b/api/graph/schema.resolvers.go @@ -608,7 +608,7 @@ func (r *mutationResolver) ShareSecret(ctx context.Context, uuid string, user st valid := valid.New(ctx) target, err := loaders.ForContext(ctx).UsersByName.Load(user) if err != nil || target == nil { valid.Error("No such user").WithField("user")[message trimmed]
From Thorben Günther to ~sircmpwn/sr.ht-dev
On Mon, Aug 28, 2023 at 05:54:40PM +0200, Drew DeVault wrote: > > Besides - I think - some queries will fail with this patch, since > > `from_user_id` will be NULL for all old secrets after the migration. > > Not sure I understand. This is a bit theoretical from my part, but when you query for secrets, the `FromUserID` field expects an Int, but PostgreSQL only has a NULL in that column and IIRC go's sql package will fail to convert this [1]. [1]: https://cs.opensource.google/go/go/+/refs/tags/go1.21.0:src/database/sql/convert.go;l=432
From Thorben Günther to ~sircmpwn/sr.ht-dev
On Mon, Aug 28, 2023 at 11:01:24AM +0200, Drew DeVault wrote: > +// ShareSecret is the resolver for the shareSecret field. > +func (r *mutationResolver) ShareSecret(ctx context.Context, uuid string, user string) (model.Secret, error) { > + var sec model.Secret > + > + valid := valid.New(ctx) > + target, err := loaders.ForContext(ctx).UsersByName.Load(user) > + if err != nil || target == nil { > + valid.Error("No such user").WithField("user") > + } > + if !valid.Ok() { > + return nil, nil > + }
From Thorben Günther to ~emersion/hut-dev
Thanks for that patch! I have edited it a bit to update the man page and I have removed the comment, which indicated that file variables are missing.
From Thorben Günther to ~emersion/hut-dev
On Fri, Aug 18, 2023 at 09:18:38AM +0000, Simon Ser wrote: > --- a/srht/buildssrht/gql.go > +++ b/srht/buildssrht/gql.go > @@ -1,4 +1,4 @@ > -// Code generated by gqlclientgen - DO NOT EDIT > +// Code generated by gqlclientgen - DO NOT EDIT. > Just a drive-by comment: You probably upgraded the go dependencies without committing.
From Thorben Günther to ~emersion/hut-dev
--- export/todo.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/export/todo.go b/export/todo.go index dadd214..4512faf 100644 --- a/export/todo.go +++ b/export/todo.go @@ -71,6 +71,11 @@ func (ex *TodoExporter) Export(ctx context.Context, dir string) error { func (ex *TodoExporter) exportTracker(ctx context.Context, tracker todosrht.Tracker, base string) error { infoPath := path.Join(base, infoFilename) if _, err := os.Stat(infoPath); err == nil { log.Printf("\tSkipping %s (already exists)", tracker.Name)[message trimmed]
From Thorben Günther to ~emersion/hut-dev
We do the same for most other objects as well. --- export/todo.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/export/todo.go b/export/todo.go index f51c838..dadd214 100644 --- a/export/todo.go +++ b/export/todo.go @@ -33,6 +33,8 @@ func NewTodoExporter(client *gqlclient.Client, http *http.Client) *TodoExporter type TrackerInfo struct { Info Description *string `json:"description"`[message trimmed]