Commit graph

960 commits

Author SHA1 Message Date
fr33domlover
f7c0807775 C2S: offerTicketC: Support offering a patch to a repo 2020-07-16 11:30:22 +00:00
fr33domlover
3e7e885300 S2S: Implement patch submission via repoOfferTicketF 2020-07-16 08:22:13 +00:00
fr33domlover
6d4d77255f S2S: Prepare Offer/Ticket parsing code for handling a remote patch/MR 2020-07-15 13:00:58 +00:00
fr33domlover
c78becaf5e S2S: projectCreateTicketF: Refactor to use new utils 2020-07-15 11:20:11 +00:00
fr33domlover
e46bcac559 S2S: sharerCreateTicketF: Tweak to use the new utils 2020-07-15 10:14:41 +00:00
fr33domlover
1a8ecb5995 S2S: Refactor projectOfferTicketF to use the new utils 2020-07-15 09:58:59 +00:00
fr33domlover
58e88d1e1b Upgrade sharerOfferTicketF to new utils 2020-07-15 08:00:08 +00:00
fr33domlover
75c0bc0939 Web.ActivityPub: Ticket attachment's Offer object can be either URI or a Patch
This will allow to use this representation for Offer and Create activities.
When creating a new MR, the inner Offer's 'object' is a 'Patch' object. When
serving an existing hosted MR, the inner Offer's 'object' is just a URI
pointing to the patch.
2020-07-14 11:25:37 +00:00
fr33domlover
6d80b1e4f1 Web.ActivityPub: In MR, the 'object' of the 'Offer' is a 'Patch' URI
Instead of an 'OrderedCollection' of the versions
2020-07-14 11:10:43 +00:00
fr33domlover
216aaa72ee Web.ActivityPub: Add PatchLocal type similar to TicketLocal 2020-07-14 09:56:13 +00:00
fr33domlover
fa3348513a For latest-version patches, provide a 'previousVersions' list 2020-07-14 08:50:57 +00:00
fr33domlover
a06d273107 C2S: Implement offerDepC, allowing to create ticket dependencies 2020-07-13 13:43:20 +00:00
fr33domlover
90086f1329 In audience parsing, provide version without bcc & list hosts for inbox fwding 2020-07-12 11:17:12 +00:00
fr33domlover
2a6bba89d5 C2S: Reimplement offerTicketC using the new tools 2020-07-07 07:26:51 +00:00
fr33domlover
511c3c60db C2S: In yesod authorization check, support OAuth2 as login method 2020-07-06 08:01:02 +00:00
fr33domlover
d392a37707 Rename InboxR to InboxDebugR, much clearer that way 2020-07-02 13:34:38 +00:00
fr33domlover
5d25aba239 C2S: Implement real C2S access via outbox POSTing and OAuth2 2020-07-02 13:21:59 +00:00
fr33domlover
a0325da028 S2S: Implement projectOfferDepF and repoOfferDepF 2020-06-22 11:29:30 +00:00
fr33domlover
5cf105fafb Move checkDepAndTarget from Vervis.Federation.Ticket to Vervis.Ticket
I'm moving it there because it's going to be used in C2S too, in offerDepC.
2020-06-21 12:31:11 +00:00
fr33domlover
4fc50f0870 Move hostIsLocal from Vervis.ActivityPub to Yesod.ActivityPub 2020-06-21 12:29:37 +00:00
fr33domlover
2cddadd679 sharerOfferDepF: If parent is remote and child is mine, record TicketDepOffer 2020-06-21 09:06:02 +00:00
fr33domlover
bc4248d7ca S2S: Handle remote dep in sharerAcceptF
If sharer receives Accept on an Offer/Dep where the sharer hosts the child
ticket, it records a RemoteTicketDependency and runs inbox forwarding to ticket
followers. But this relies on a TicketDependencyOffer record already existing.
I'll take care of that in the next patches.

sharerAcceptF and sharerRejectF now use the insertToInbox from
Vervis.Federation.Util instead of their own copies of it, which were identical
anyway. Perhaps gradually all the inbox insertion in all S2S handlers will
switch to using that function.
2020-06-21 08:02:05 +00:00
fr33domlover
a2468c52fd Prepare for ticket dependency federation
To be honest, this is a huge patch that changes tons of stuff and probably
should have been broken up into small changes. But I already had the codebase
not building, so... just did all of this at once :P

Basically this patch does the following:

- DB migrations for ticket dependency related tables, e.g. allowing a remote
  author and a remote child
- Allowing S2S handlers to provide an async continued processing function,
  which is executed and the result then added to the debug page
- Most UI and functionality related to ticket deps is disabled, new
  implementation being added gradually via ActivityPub
- Improvements to AP tools, e.g. allow to specify multiple hosts for approved
  forwarding when sending out an activity, and allow to specify audience of
  software-authored activities using a convenient human-friendly structure
- Implementation of S2S sharerOfferDepF which creates a dependency under a
  sharer-hosted ticket/patch and sends back an Accept
2020-06-18 10:38:04 +00:00
fr33domlover
854d35fd9b C2S: Support following a sharer-patch and repo-patch 2020-05-28 07:48:39 +00:00
fr33domlover
3fb529325d S2S: Support commenting on sharer-patch and repo-patch 2020-05-27 14:07:02 +00:00
fr33domlover
cf946e0326 S2S: Support unfollowing sharer-patch and repo-patch
- Sharer-patch was already working due to the shared DB tabled
- Repo-patch support added
- Fixed a bug in following project-tickets: It allowed to follow a
  sharer-ticket by sending the Follow to the project. Now, the project allows
  to follow only the project-tickets, and refuses to handle a sharer-ticket.
2020-05-27 11:59:53 +00:00
fr33domlover
c7b6ad643b S2S: Support following sharer-patch and repo-patch
Also fixed a bug in which trying to follow a ticket with nonexistent
ltkhid/talkhid would result with 404 as if the actor inbox is nonexistent. Now,
there's a friendly message reported.
2020-05-27 11:39:19 +00:00
fr33domlover
06a051d2e5 Support addressing, delivery and forwarding for sharer-patches and repo-patches 2020-05-27 10:38:28 +00:00
fr33domlover
d9c00cba1f Add repo-hosted patch routes and GET handlers 2020-05-26 14:51:11 +00:00
fr33domlover
e29233a59f Rename RepoPatchR to RepoCommitR, we'll use the old name for merge requests 2020-05-26 08:54:21 +00:00
fr33domlover
ad8c0ce8b4 Return sorted PatchId list from the get*Patch functions 2020-05-26 08:41:02 +00:00
fr33domlover
e68a659221 Support forwarding activities from repo actors 2020-05-25 13:36:34 +00:00
fr33domlover
17e59af1c4 AP: In getSharerPatchR, provide the list of patch versions, latest first 2020-05-25 12:39:25 +00:00
fr33domlover
c63479470e Add patch version route and GET handler, serving a specific patch file 2020-05-25 09:40:48 +00:00
fr33domlover
55c87b8a54 AP: Recognize "CryptographicKey" as a type of http sig keys
The examples in the security vocabulary's spec use "Key" but the JSON-LD
context doesn't define that term. From now on, just in case, recognizing both
"Key" and "CryptographicKey" as indication that the object is a key.

zPlus, thanks for finding this bug!
2020-05-25 09:37:15 +00:00
fr33domlover
417fcd3e94 S2S: If sharer inbox handler fails, return and log the error message 2020-05-24 13:53:31 +00:00
fr33domlover
d56a7411fc Refactor sharer-ticket and sharer-patch GET handler code to reuse similar parts 2020-05-24 13:31:58 +00:00
fr33domlover
90a1014ad1 Update package description in vervis.cabal, we're already federating! Mostly :P 2020-05-24 09:17:57 +00:00
fr33domlover
02c42029d2 Add GET routes and handlers for sharer-hosted patches 2020-05-24 09:17:49 +00:00
fr33domlover
bb6785de75 DB: Generalize TicketProjectLocal into TicketContextLocal
This is the first step preparing for patches and merge requests.

The work-item aspect of MRs will reuse the Ticket related tables, except MRs
will live under repos. So, the context of tickets will no longer be just
projects, but will also be repos.

So, TicketProjectLocal turns into TicketContextLocal, and there are 2 new
tables that refer to it: TicketProjectLocal and TicketRepoLocal. Tickets will
have the former, MRs will have the latter.
2020-05-18 10:28:43 +00:00
fr33domlover
77e576ccb2 Startup: Sort the repo-tree-from-filesystem, it's not sorted by default 2020-05-14 12:33:51 +00:00
fr33domlover
2063c7313b Startup: If repo dir check fails, print both versions of repo tree 2020-05-14 12:11:31 +00:00
fr33domlover
cac4edc8eb getProjectTicketsR: In AS2, list remote tickets too 2020-05-14 11:13:04 +00:00
fr33domlover
d29ba23bfb In getProjectTicket, return TUP alongside TAL to prove it exists 2020-05-14 09:09:57 +00:00
fr33domlover
036c60171b In getSharerTicket, support remote project 2020-05-14 08:59:34 +00:00
fr33domlover
003adcbf7b Comment out more uses of ticket team collection 2020-05-14 08:58:37 +00:00
fr33domlover
a5348245f6 Comment out some usage of ticket team collection for addressing
Removed its usage in pseudo-client when publishing a comment, and removed it
from inbox forwarding when handling a remote comment.

Very possibly, the ticket team collection will be entirely removed. For now
leaving it there as-is. Just not using it for addressing in activities.
2020-05-13 14:00:38 +00:00
fr33domlover
a548dc8c5b S2S: sharerCreateNoteF: If ctx is sharer-ticket of another user, store to inbox 2020-05-13 13:49:22 +00:00
fr33domlover
f296dc173c C2S: In followC, return friendly message if already following the target object 2020-05-13 13:29:39 +00:00
fr33domlover
43cd1a95f3 S2S: sharerCreateNoteF caches note and does inbox fwd if sharer is ticket owner 2020-05-13 13:06:28 +00:00