Drew DeVault
8fe8e5a3a3
API: Implement defaultACL
2022-02-01 09:27:28 +01:00
Drew DeVault
1e180da72c
API: Correct event type in unassignUser
2022-02-01 09:20:33 +01:00
Drew DeVault
c04b1050eb
API: Validate external URL on submitTicket
2022-01-24 13:52:09 +01:00
Drew DeVault
1239a68d88
API: Refactor label color parsing into common func
2022-01-24 13:52:09 +01:00
Drew DeVault
343f3b5969
API: Add *ACL.SetBits functions
...
De-duplicates this code a bit.
2022-01-24 13:52:09 +01:00
Drew DeVault
3b96e7e0f5
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-01-24 13:52:09 +01:00
Drew DeVault
344f7061dd
API: Use struct{} for user mention set
2022-01-24 13:52:09 +01:00
Drew DeVault
6f09f88d6f
API: Use unique ticket reference as map key
2022-01-24 13:52:09 +01:00
Drew DeVault
98238b7963
API: Remove obsolete TODO, add needed TODOs
2022-01-21 10:04:37 +01:00
Drew DeVault
f59e70c207
Rig up ticket event legacy webhooks
2022-01-19 11:27:57 +01:00
Robin Jarry
8a6c95be34
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-01-19 11:27:57 +01:00
Drew DeVault
e4bd8f25de
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-01-19 11:27:57 +01:00
Simon Ser
628476562e
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-01-19 11:27:57 +01:00
Simon Ser
e29b22028e
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-01-19 11:27:57 +01:00
Simon Ser
718c7ed6ce
go generate
2022-01-19 11:27:57 +01:00
Simon Ser
9dd256961a
go fmt
2022-01-19 11:27:57 +01:00
Simon Ser
0b12ac027c
api/graph: add missing non-null types
...
Entries of these lists cannot be null.
2022-01-19 11:27:57 +01:00
Simon Ser
4e7549eb4f
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-01-19 11:27:57 +01:00
Simon Ser
0e0271de22
api/graph: use GraphQL descriptions for docs
2022-01-19 11:27:57 +01:00
Drew DeVault
cb46db8aa5
API: Implement ticket:create legacy webhook
2022-01-19 11:27:57 +01:00
Drew DeVault
99db7ea4a7
API: Implement legacy label:delete webhook
2022-01-19 11:27:57 +01:00
Drew DeVault
b04cf4a6a6
API: Implement legacy label:create webhook
2022-01-19 11:27:57 +01:00
Drew DeVault
f5024e327b
API: Correct typo in panic messages
2022-01-19 11:27:57 +01:00
Drew DeVault
11dff8a8aa
API: Rig up tracker:delete legacy webhook
2022-01-19 11:27:57 +01:00
Drew DeVault
a2541499a2
API: Add Tracker { defaultACL } stub
2022-01-19 11:27:56 +01:00
Drew DeVault
2ccb79a93b
API: Legacy tracker:create & :update webhooks
2022-01-19 11:27:56 +01:00
Drew DeVault
c43066c762
API: Implement labelTicket, unlabelTicket
2022-01-19 11:27:56 +01:00
Drew DeVault
9f65026ee8
API: Implement unassignUser
2022-01-19 11:27:56 +01:00
Drew DeVault
905cfc781b
API: Implement assignUser
2022-01-19 11:27:56 +01:00
Drew DeVault
2c2679a214
Improve constraints on assignee & label
2022-01-19 11:27:56 +01:00
Drew DeVault
1e953272f5
API: Add ImportInput type, not rigged up
2022-01-19 11:27:56 +01:00
Drew DeVault
92de7478cd
API: Add generate.go
2022-01-19 11:27:56 +01:00
Drew DeVault
439dd9a371
API: Send notification emails on submitComment
2022-01-19 11:27:56 +01:00
Drew DeVault
ea8056cfa7
API: rehome email notification templates
2022-01-19 11:27:56 +01:00
Drew DeVault
1cbddb714b
API: Use correct event type in submitComment
2022-01-19 11:27:56 +01:00
Drew DeVault
3198a57ab8
API: Move notification emails to EventBuilder
2022-01-19 11:27:56 +01:00
Drew DeVault
8a44d200ca
API: Refactor updateTicketStatus with EventBuilder
2022-01-19 11:27:56 +01:00
Drew DeVault
91b5b9e499
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-01-19 11:27:56 +01:00
Drew DeVault
54b8bc1874
API: Implement submitComment
2022-01-19 11:27:56 +01:00
Drew DeVault
b010132c81
Pull mention handling into separate module
...
For re-use with comments (and possibly with description updates as
well).
2022-01-19 11:27:56 +01:00
Drew DeVault
eb173dda1f
API: Send notifications for ticket status updates
2022-01-19 11:27:56 +01:00
Drew DeVault
40e9e7dc13
API: Simplify ticket subqueries with loader
2022-01-19 11:27:56 +01:00
Drew DeVault
24b2c470fb
API: (Partially) implement updateTicketStatus
2022-01-19 11:27:56 +01:00
Drew DeVault
814bce9019
API: Implement updateTicket
...
Narrowed the scope of this a bit by updating the schema to not allow
event-creating changes in this context.
2022-01-19 11:27:56 +01:00
Drew DeVault
d0171fe923
API: Add tracker ID to all ticket resolvers
...
Since the ticket ID is only unique within each tracker.
2022-01-19 11:27:56 +01:00
Drew DeVault
2c8ca3bc0f
API: Configure webhooks on meta.sr.ht fetch
2022-01-19 11:27:56 +01:00
Drew DeVault
ac89d7ca23
API: Implement participant fetching from meta
2022-01-19 11:27:56 +01:00
Drew DeVault
6153f7209b
API: Set tracker updated on ticket submit
2022-01-19 11:27:56 +01:00
Drew DeVault
aa29549986
API: Add new participant by user ID loader
2022-01-19 11:27:56 +01:00
Drew DeVault
f2f17eba57
API: Rename ParticipantsByID loader
2022-01-19 11:27:56 +01:00