Commit Graph

719 Commits

Author SHA1 Message Date
Thorben Günther 1f552accae parseColor: Fix panic in hex.Decode
An input like '#AAAAAAAA' causes hex.Decode to panic. While this
solution does not allow color codes with length 3, those return an error
in hex.Decode either way.
2022-03-14 12:25:24 +01:00
Adnan Maolood 8539d6c21b api: go fmt 2022-03-14 12:13:40 +01:00
Adnan Maolood 02b9b60e94 api/graph: Remove usage of database.Apply 2022-03-14 12:13:05 +01:00
Drew DeVault 5e95e4ebb6 API: Filter ticket update on submitComment
That was a pretty bad oversight
2022-03-11 08:48:07 +01:00
Eyal Sawady 9222cb4823 .builds/alpine.yml: upgrade to 3.15 2022-02-28 11:14:11 +01:00
Drew DeVault 31ec3f7982 tracker.html: add noindex for unlisted trackers 2022-02-04 13:00:20 +01:00
Drew DeVault 1a843cbd91 .builds/alpine: drop -t from SSH 2022-02-01 09:34:00 +01:00
Drew DeVault 889c76571e API: Implement defaultACL 2022-02-01 09:28:46 +01:00
Drew DeVault 8af448ab7d API: Correct event type in unassignUser 2022-02-01 09:28:46 +01:00
Drew DeVault eafb72115f API: Validate external URL on submitTicket 2022-02-01 09:28:46 +01:00
Drew DeVault 99a9d92879 API: Refactor label color parsing into common func 2022-02-01 09:28:46 +01:00
Drew DeVault ebfabb2450 API: Add *ACL.SetBits functions
De-duplicates this code a bit.
2022-02-01 09:28:46 +01:00
Drew DeVault b9e95b1a21 API: Fix nit with variable declarations
I like to use the var keyword when declaring many variables at once, but
I can drop the types here for sure.
2022-02-01 09:28:46 +01:00
Drew DeVault a1ed38fc17 API: Use struct{} for user mention set 2022-02-01 09:28:46 +01:00
Drew DeVault 258514b8ef API: Use unique ticket reference as map key 2022-02-01 09:28:46 +01:00
Drew DeVault d19da4a6c8 API: Remove obsolete TODO, add needed TODOs 2022-02-01 09:28:45 +01:00
Drew DeVault 885e86fb16 Rig up ticket event legacy webhooks 2022-02-01 09:28:45 +01:00
Robin Jarry a40ca24ea3 API: Allow getting tickets from their scoped id
Add an api method to retrieve the ticket associated with a scoped ID for
a given tracker.

Signed-off-by: Robin Jarry <robin@jarry.cc>
2022-02-01 09:28:45 +01:00
Drew DeVault 505495ae39 Legacy API: disallow new webhook creation
These are a mess and no one uses them, so let's keep it that way and
skip re-implementing all of this properly.
2022-02-01 09:28:45 +01:00
Simon Ser a1158c25ff api/graph: rename Subscription to ActivitySubscription
The GraphQL "Subscription" type is special and used for defining
subscription operations. Pick a different name so that GraphQL
parsers don't get confused.

References: https://todo.sr.ht/~sircmpwn/sr.ht/302
2022-02-01 09:28:45 +01:00
Simon Ser 28496b85cd api/graph/model: fix incorrect format directive
Fixes the following error found by `go test`:

    graph/model/participant.go:14:10: Sprintf format %s has arg e.Name of wrong type *string
2022-02-01 09:28:45 +01:00
Simon Ser ae5188e50d go generate 2022-02-01 09:28:45 +01:00
Simon Ser 75fcaf5dba go fmt 2022-02-01 09:28:45 +01:00
Simon Ser ef5f90d428 api/graph: add missing non-null types
Entries of these lists cannot be null.
2022-02-01 09:28:45 +01:00
Simon Ser c718de746e api: import github.com/99designs/gqlgen
Create a new generate.go file which imports github.com/99designs/gqlgen.
This fixes this kind of error because go mod now knows about the
dependency:

    /home/simon/go/pkg/mod/github.com/99designs/gqlgen@v0.13.0/cmd/gen.go:9:2: missing go.sum entry for module providing package github.com/urfave/cli/v2 (imported by github.com/99designs/gqlgen/cmd); to add:
    	go get github.com/99designs/gqlgen/cmd@v0.13.0
    /home/simon/go/pkg/mod/github.com/99designs/gqlgen@v0.13.0/internal/imports/prune.go:15:2: missing go.sum entry for module providing package golang.org/x/tools/go/ast/astutil (imported by github.com/99designs/gqlgen/internal/imports); to add:
    	go get github.com/99designs/gqlgen/internal/imports@v0.13.0
    /home/simon/go/pkg/mod/github.com/99designs/gqlgen@v0.13.0/internal/code/packages.go:8:2: missing go.sum entry for module providing package golang.org/x/tools/go/packages (imported by github.com/99designs/gqlgen/internal/code); to add:
    	go get github.com/99designs/gqlgen/internal/code@v0.13.0
    /home/simon/go/pkg/mod/github.com/99designs/gqlgen@v0.13.0/internal/imports/prune.go:16:2: missing go.sum entry for module providing package golang.org/x/tools/imports (imported by github.com/99designs/gqlgen/internal/imports); to add:
    	go get github.com/99designs/gqlgen/internal/imports@v0.13.0
    graph/resolver.go:7: running "go": exit status 1
    missing go.sum entry for module providing package github.com/vektah/dataloaden; to add:
    	go mod download github.com/vektah/dataloaden
    loaders/middleware.go:3: running "./gen": exit status 1
2022-02-01 09:28:45 +01:00
Simon Ser 4090f16880 api/graph: use GraphQL descriptions for docs 2022-02-01 09:28:45 +01:00
Drew DeVault 1b359ed7f9 API: Implement ticket:create legacy webhook 2022-02-01 09:28:45 +01:00
Drew DeVault 3ee8d3ada4 API: Implement legacy label:delete webhook 2022-02-01 09:28:45 +01:00
Drew DeVault bc8aab193e API: Implement legacy label:create webhook 2022-02-01 09:28:45 +01:00
Drew DeVault 4f5e9d7c70 API: Correct typo in panic messages 2022-02-01 09:28:45 +01:00
Drew DeVault f591aeb463 API: Rig up tracker:delete legacy webhook 2022-02-01 09:28:45 +01:00
Drew DeVault 9258e45f3f API: Add Tracker { defaultACL } stub 2022-02-01 09:28:45 +01:00
Drew DeVault 4d4ebc49e3 API: Legacy tracker:create & :update webhooks 2022-02-01 09:28:45 +01:00
Drew DeVault e514555a78 API: Implement labelTicket, unlabelTicket 2022-02-01 09:28:45 +01:00
Drew DeVault 0bd750c0d4 API: Implement unassignUser 2022-02-01 09:28:45 +01:00
Drew DeVault 47007c1a4c API: Implement assignUser 2022-02-01 09:28:45 +01:00
Drew DeVault de3a95560c Improve constraints on assignee & label 2022-02-01 09:28:45 +01:00
Drew DeVault 769c772c12 API: Add ImportInput type, not rigged up 2022-02-01 09:28:45 +01:00
Drew DeVault 42e7d8cb62 API: Add generate.go 2022-02-01 09:28:45 +01:00
Drew DeVault a3256bedb6 API: Send notification emails on submitComment 2022-02-01 09:28:45 +01:00
Drew DeVault d1f271c170 API: rehome email notification templates 2022-02-01 09:28:45 +01:00
Drew DeVault 8b37337fb4 API: Use correct event type in submitComment 2022-02-01 09:28:45 +01:00
Drew DeVault bb7941bfb4 API: Move notification emails to EventBuilder 2022-02-01 09:28:45 +01:00
Drew DeVault 2ee328ff64 API: Refactor updateTicketStatus with EventBuilder 2022-02-01 09:28:45 +01:00
Drew DeVault 74ca649b99 API: Generalize event notifications
Still to do: generalize this further for use with updateTicket et al,
and incorporate email notifications into this work as well.
2022-02-01 09:28:45 +01:00
Drew DeVault 0f5aec60a8 API: Implement submitComment 2022-02-01 09:28:45 +01:00
Drew DeVault 371828a5c8 Pull mention handling into separate module
For re-use with comments (and possibly with description updates as
well).
2022-02-01 09:28:45 +01:00
Drew DeVault 389028ff57 API: Send notifications for ticket status updates 2022-02-01 09:28:45 +01:00
Drew DeVault 676ffd1a4e API: Simplify ticket subqueries with loader 2022-02-01 09:28:45 +01:00
Drew DeVault 7e2981c23b API: (Partially) implement updateTicketStatus 2022-02-01 09:28:45 +01:00