Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Register custom ActivityPub transformer for the GatherPress Event post-type #615

Draft
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

Menrath
Copy link

@Menrath Menrath commented Mar 18, 2024

This is still a draft. I will continue working in this in the next weeks according to your checklist. I will ask for feedback when I explicitly need it, but it is welcome anytime.

Description of the Change

This draft pull request drafts proper ActivityPub support for the GatherPress events.

Closes #569

How to test the Change

TODO

Changelog Entry

Added - ActivityPub Transformer for events

Credits

@Menrath

Checklist:

  • I agree to follow this project's Code of Conduct.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests pass.

@carstingaxion
Copy link
Collaborator

Wow! Supercool, you already started @Menrath.
I'm sorry, I had no time to come back to the started discussion, yet.

@Menrath
Copy link
Author

Menrath commented Mar 24, 2024

Some questions:

  1. The ActivityPub content should most likely not contain the venue or the attendees block. It should only contain the events description, as the rest is passed as it's own property.

  2. Should ActivityPub be automatically enabled in the upstream ActivityPub plugin for GatherPress events. Or should we show a hint message that encourages the Admins to to so?

Still unclear:
I haven't really studied the way updating the attendees is currently implemented in e.g. Mobilizon within the federation. Maybe an (minimal) update of the event has always to be sent.

@Menrath Menrath marked this pull request as ready for review April 5, 2024 14:33
@carstingaxion
Copy link
Collaborator

He @Menrath , it is really, really cool, you followed -somehow- my invitation and provided questions and solutions as well.
I feel a little sorry, to not get closer in touch with you and your workings over here. This is going to be amazing!

  1. The ActivityPub content should most likely not contain the venue or the attendees block. It should only contain the events description, as the rest is passed as it's own property.

Shouldn't be much of a big deal to strip out some of the GatherPress blocks from the passed data.
Except the case where a user added some custom headlines prior to the blocks to be removed, or wrapped them in some deep nesting. This could be trickier, to get clean.

  1. Should ActivityPub be automatically enabled in the upstream ActivityPub plugin for GatherPress events. Or should we show a hint message that encourages the Admins to to so?

I'm a huge fan of "decisions, not options", that's why I propose enabling this by default and providing a filter, not an option, to unset this default.
Based on this filter a hint should be shown within the GatherPress settings.

And on the ActivityPub plugin side of things, aren't the transformers listed there either?

I haven't really studied the way updating the attendees is currently implemented in e.g. Mobilizon within the federation. Maybe an (minimal) update of the event has always to be sent.

What are docs, specs or repos you're studying? I'd like to jump in a little deeper and could maybe help doing this studies?

Best regards
Carsten

@carstingaxion
Copy link
Collaborator

Hello @Menrath ,

I was thinking about setting up a WordPress Playground with all the necessary pieces to being able to test the full stack using https://browser.pub/

What do you think, could this work?
Do you maybe have something similar already running online?

@carstingaxion
Copy link
Collaborator

carstingaxion commented Aug 28, 2024

I want to make a correction on the answer, I gave before.

Now, after contributing a while to GatherPress and getting to know the inner workings better, I suggested in #688, the plugin should wrap all functionality in post_type_supports and I’d like to suggest the same here too.

3. Should ActivityPub be automatically enabled in the upstream ActivityPub plugin for GatherPress events. Or should we show a hint message that encourages the Admins to to so?

I'm a huge fan of "decisions, not options", that's why I propose enabling this by default and providing a filter, not an option, to unset this default. Based on this filter a hint should be shown within the GatherPress settings.

… using a post_type_support on the (recently renamed) gatherpress_event post type.

@Menrath
Copy link
Author

Menrath commented Aug 28, 2024

I also stumbled upon https://browser.pub recently. Not sure yet if we will be able to use it for automated tests anytime soon. I don't test anything online at the moment. I have my local docker-setup with self-signed certs that do the trick. This issues I saved for later...

I made some findings: automatically enabling ActivityPub for a certain (new) post type should be handled with care. It changes the nature content spreads, and at least I met some who would find that not O.K. And GatherPress already has some great admin notification classes (I got inspired by those for my own projects). I would be a pleasure to implement a notification about that.

This PR currently only targets the publishing side of ActivityPub. This is also fine for now, but maybe for future work: How is the join-logic implemented in GatherPress. Is it dynamic enough, like there is a "join-by-account", "join-by-mail (anonymous), where each of those implements a same interface or abstract. Because then adding a further option "join-by-ActivityPub" would be also possible.

@mauteri mauteri changed the base branch from main to develop October 10, 2024 13:01
@patriciabt
Copy link
Collaborator

patriciabt commented Oct 18, 2024

Thank you so much André @Menrath and sorry I had missed your reply here.
Yes I think if people could join like that as well, it would be great (maybe @mauteri can confirm).

I talked about ActivityPub with Matthias @pfefferle when we met last week at WordCamp Karlsruhe and we talked about the progress of that.

As you mention, "enabling ActivityPub for a certain (new) post type should be handled with care". I agree and we activated the event post type in the ActivityPub settings on our gatherpress.org site (@[email protected]) and yes the events appear on the Fediverse, but as if they were posts, not events (obviously). It would be great if they were discovered with the event format and federated on Mobilizon-type (and how it's related to the Event Federation plugin)

I certainely lack knowledge and I trust you all for the development side of things :D

@Menrath Menrath marked this pull request as draft October 20, 2024 08:34
@Menrath
Copy link
Author

Menrath commented Oct 20, 2024

@patriciabt Hey! No problem! Thanks for coming back to this topic!

I'll reverted this PR back to draft, because I already made quite some improvements within the ActivityPub Event Bridge WordPress plugin regarding its GatherPress support. I want to include those in this PR later but did not find the time yet. Nevertheless the code from this project could easily be re-used here. If you would like to you could also try it out and give some feedback, I'd by happy to hear about it.

Improvements:
There are some improvents, which are not included in this Pull Request, for instance:

  • A better summary containing the most important data of the event.
  • Removal of all GatherPress shortcodes for the ActivityStreams content fields that are not part of the events actual description but Meta-Data blocks .

Automatic enabling of ActivityPub support for event post type:
Within our plugin we decided to automatically enable ActivityPub support for the event post type as that is what our plugin is about, but when implementing it here in GatherPress directly I would still recommend only using dismissable admin notices.

Handle joins:
I think that joining an event should be dealt with in a later pull request, it could be really straight forward or rather complex depending on how GatherPress implemented in the core, and in case is willing to adopt to a more modular and flexible structure. Until then I recommend the use of (which is also what I implemented) just setting the joinMode to external and providing an externalParticipationURL which is just the events permalink.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Integration with the Event Federation Plugin for WordPress
3 participants