transformer_refactoring #44

Merged
linos merged 42 commits from transformer_refactoring into main 2024-10-02 19:15:29 +02:00
Owner
No description provided.
ruru4143 added 7 commits 2024-09-29 13:12:21 +02:00
added comments about removing some old stuff
Some checks failed
PHP Code Checker / PHP Code Checker (pull_request) Failing after 36s
PHPUnit / PHPUnit – PHP 8.1 (pull_request) Successful in 1m0s
PHPUnit / PHPUnit – PHP 8.2 (pull_request) Successful in 1m1s
PHPUnit / PHPUnit – PHP 8.3 (pull_request) Successful in 1m3s
a66dc74577
ruru4143 added 1 commit 2024-09-29 13:25:46 +02:00
making php_codesniffer happy
Some checks failed
PHP Code Checker / PHP Code Checker (pull_request) Failing after 34s
PHPUnit / PHPUnit – PHP 8.1 (pull_request) Successful in 59s
PHPUnit / PHPUnit – PHP 8.2 (pull_request) Successful in 56s
PHPUnit / PHPUnit – PHP 8.3 (pull_request) Successful in 1m3s
b39f9997ae
ruru4143 added 1 commit 2024-09-29 13:46:07 +02:00
removed unused stuff
Some checks failed
PHP Code Checker / PHP Code Checker (pull_request) Failing after 35s
PHPUnit / PHPUnit – PHP 8.1 (pull_request) Successful in 58s
PHPUnit / PHPUnit – PHP 8.2 (pull_request) Successful in 59s
PHPUnit / PHPUnit – PHP 8.3 (pull_request) Successful in 1m0s
608e18f8c1
ruru4143 added 2 commits 2024-09-29 13:53:55 +02:00
removed more unused code
Some checks failed
PHP Code Checker / PHP Code Checker (pull_request) Failing after 35s
PHPUnit / PHPUnit – PHP 8.1 (pull_request) Successful in 57s
PHPUnit / PHPUnit – PHP 8.2 (pull_request) Successful in 1m1s
PHPUnit / PHPUnit – PHP 8.3 (pull_request) Successful in 59s
9be7cb2ce2
ruru4143 added 2 commits 2024-09-29 13:57:06 +02:00
removed trivial to_object functions
Some checks failed
PHP Code Checker / PHP Code Checker (pull_request) Failing after 32s
PHPUnit / PHPUnit – PHP 8.1 (pull_request) Successful in 57s
PHPUnit / PHPUnit – PHP 8.2 (pull_request) Successful in 59s
PHPUnit / PHPUnit – PHP 8.3 (pull_request) Successful in 1m2s
7d979a1c5e
ruru4143 added 1 commit 2024-09-29 14:48:52 +02:00
Revert "improved readability of get_summary by using ternary operator"
Some checks failed
PHP Code Checker / PHP Code Checker (pull_request) Failing after 32s
PHPUnit / PHPUnit – PHP 8.1 (pull_request) Successful in 1m1s
PHPUnit / PHPUnit – PHP 8.2 (pull_request) Successful in 58s
PHPUnit / PHPUnit – PHP 8.3 (pull_request) Successful in 58s
228dba06ae
This reverts commit 7c9424526d.
ruru4143 added 2 commits 2024-09-29 15:31:10 +02:00
phpsniffer happy
Some checks failed
PHP Code Checker / PHP Code Checker (pull_request) Failing after 33s
PHPUnit / PHPUnit – PHP 8.1 (pull_request) Successful in 1m0s
PHPUnit / PHPUnit – PHP 8.2 (pull_request) Successful in 1m3s
PHPUnit / PHPUnit – PHP 8.3 (pull_request) Successful in 1m1s
993fc2b24f
ruru4143 added 1 commit 2024-09-29 15:32:58 +02:00
added comment on bloguser
Some checks failed
PHP Code Checker / PHP Code Checker (pull_request) Failing after 37s
PHPUnit / PHPUnit – PHP 8.1 (pull_request) Successful in 1m4s
PHPUnit / PHPUnit – PHP 8.2 (pull_request) Successful in 1m1s
PHPUnit / PHPUnit – PHP 8.3 (pull_request) Successful in 58s
5fa3876c1a
ruru4143 added 1 commit 2024-09-29 15:46:01 +02:00
removed link at get_content() for all event
Some checks failed
PHP Code Checker / PHP Code Checker (pull_request) Failing after 36s
PHPUnit / PHPUnit – PHP 8.1 (pull_request) Failing after 1m0s
PHPUnit / PHPUnit – PHP 8.2 (pull_request) Failing after 55s
PHPUnit / PHPUnit – PHP 8.3 (pull_request) Failing after 57s
4f61a1c97e
Author
Owner

oh i broke post_content of gatherpress. post_content for the other transformers isn't implemented yet

oh i broke post_content of gatherpress. post_content for the other transformers isn't implemented yet
ruru4143 added 2 commits 2024-09-29 15:55:46 +02:00
added generic get_content from wp_object to class-event
Some checks failed
PHP Code Checker / PHP Code Checker (pull_request) Failing after 35s
PHPUnit / PHPUnit – PHP 8.1 (pull_request) Failing after 57s
PHPUnit / PHPUnit – PHP 8.2 (pull_request) Failing after 55s
PHPUnit / PHPUnit – PHP 8.3 (pull_request) Failing after 55s
d3f16706f8
ruru4143 added 1 commit 2024-09-29 16:01:31 +02:00
forgot to rename method call
Some checks failed
PHP Code Checker / PHP Code Checker (pull_request) Failing after 35s
PHPUnit / PHPUnit – PHP 8.1 (pull_request) Failing after 56s
PHPUnit / PHPUnit – PHP 8.2 (pull_request) Failing after 56s
PHPUnit / PHPUnit – PHP 8.3 (pull_request) Failing after 53s
ef86fb2263
ruru4143 added 1 commit 2024-09-29 17:45:57 +02:00
fixed TEC content test
Some checks failed
PHP Code Checker / PHP Code Checker (pull_request) Failing after 33s
PHPUnit / PHPUnit – PHP 8.1 (pull_request) Failing after 1m0s
PHPUnit / PHPUnit – PHP 8.2 (pull_request) Failing after 59s
PHPUnit / PHPUnit – PHP 8.3 (pull_request) Failing after 1m0s
57889bca3f
ruru4143 added 1 commit 2024-09-29 17:48:24 +02:00
fixed events manager content test
Some checks failed
PHP Code Checker / PHP Code Checker (pull_request) Failing after 36s
PHPUnit / PHPUnit – PHP 8.1 (pull_request) Successful in 1m2s
PHPUnit / PHPUnit – PHP 8.2 (pull_request) Successful in 58s
PHPUnit / PHPUnit – PHP 8.3 (pull_request) Successful in 1m0s
64bf5b2a58
ruru4143 added 1 commit 2024-09-30 18:56:03 +02:00
changed content/summary logic and removed the racecondition
Some checks failed
PHP Code Checker / PHP Code Checker (pull_request) Failing after 40s
PHPUnit / PHPUnit – PHP 8.1 (pull_request) Successful in 1m5s
PHPUnit / PHPUnit – PHP 8.2 (pull_request) Successful in 1m7s
PHPUnit / PHPUnit – PHP 8.3 (pull_request) Successful in 1m6s
66e06655c2
ruru4143 added 1 commit 2024-09-30 19:07:08 +02:00
style guide fixes
Some checks failed
PHP Code Checker / PHP Code Checker (pull_request) Failing after 40s
PHPUnit / PHPUnit – PHP 8.1 (pull_request) Successful in 1m3s
PHPUnit / PHPUnit – PHP 8.2 (pull_request) Successful in 1m5s
PHPUnit / PHPUnit – PHP 8.3 (pull_request) Successful in 1m6s
f5df3102ad
ruru4143 added 1 commit 2024-09-30 19:25:38 +02:00
added comment
Some checks failed
PHP Code Checker / PHP Code Checker (pull_request) Failing after 37s
PHPUnit / PHPUnit – PHP 8.1 (pull_request) Successful in 1m7s
PHPUnit / PHPUnit – PHP 8.2 (pull_request) Successful in 1m2s
PHPUnit / PHPUnit – PHP 8.3 (pull_request) Successful in 1m2s
1a5e19f3c1
Author
Owner

things i changed:

class-events-manager.php

  • moved setting em_event into constructor
  • removed unused functions
  • removed custom get_summary and custom to_object

class-gatherpress.php

  • removed unused functions
  • removed custom get_summary and custom to_object

class-the-events-calendar.php

  • removed unused function

class-event.php

  • changed extract_excerpt to get_excerpt and fixed a typo
  • made format_time more generic
  • added safty check in remove_ap_permalink_from_template to only remove it if the post_type is a event
things i changed: ### class-events-manager.php - moved setting em_event into constructor - removed unused functions - removed custom get_summary and custom to_object ### class-gatherpress.php - removed unused functions - removed custom get_summary and custom to_object ### class-the-events-calendar.php - removed unused function ### class-event.php - changed extract_excerpt to get_excerpt and fixed a typo - made format_time more generic - added safty check in remove_ap_permalink_from_template to only remove it if the post_type is a event
ruru4143 added this to the Transformers for the most common event plugins milestone 2024-09-30 19:54:45 +02:00
linos requested changes 2024-09-30 22:04:20 +02:00
linos left a comment
Owner

Thanks for cleaning things up. Really look forward to have this even clearer and more stable :)

Thanks for cleaning things up. Really look forward to have this even clearer and more stable :)
@ -128,3 +128,2 @@
*/
protected function extract_excerpt(): ?string {
if ( $this->wp_object->excerpt ) {
protected function get_excerpt(): ?string {
Owner

The reason I chose "extract" is because, to better show, that it is not a typical getter function like the others that start with get_, as excerpt is not attribute in the Event object.

The reason I chose "extract" is because, to better show, that it is not a typical getter function like the others that start with get_, as excerpt is not attribute in the Event object.
Owner

@ruru4143 Do you agree? :) Or is extract a too weird wording?

@ruru4143 Do you agree? :) Or is extract a too weird wording?
Author
Owner

at this small level: i don't care, but maybe we should talk about our naming schema in general (get, format, extract)

at this small level: i don't care, but maybe we should talk about our naming schema in general (get, format, extract)
linos marked this conversation as resolved
@ -275,0 +288,4 @@
// we could override the template here, to get out custom template from an option.
if ( 'event' === $wp_object->post_type ) {
Owner

This if should not be necessary, but it does not hurt either. We can keep it, just to be sure.

This if should not be necessary, but it does not hurt either. We can keep it, just to be sure.
ruru4143 marked this conversation as resolved
@ -305,3 +327,3 @@
array(
'https://www.w3.org/ns/activitystreams#Public',
$this->get_actor_object()->get_followers(),
$this->get_actor_object()->get_followers(), // this fails on my machine.
Owner

Which Version of the ActivityPub plugin do you use? These function where added in a fix a few months ago.

Which Version of the ActivityPub plugin do you use? These function where added in a fix a few months ago.
Author
Owner

master branch, 4 commits after tag 3.0.0

master branch, 4 commits after tag 3.0.0
Owner

master branch is not the most recent, checkout trunk.

master branch is not the most recent, checkout `trunk`.
Author
Owner

ah i see, i'm not used to update from a upstream, always just pulled from our repro 😅

ah i see, i'm not used to update from a upstream, always just pulled from our repro 😅
ruru4143 marked this conversation as resolved
@ -114,9 +89,6 @@ final class Events_Manager extends Event_Transformer {
if ( $em_location->location_state ) {
$address['addressRegion'] = $em_location->location_state;
}
if ( $em_location->location_postcode ) {
Owner

Why did you remove that?

Why did you remove that?
Author
Owner

because you already set this in Line 86

because you already set this in Line [86](https://code.event-federation.eu/Event-Federation/wordpress-activitypub-event-extensions/src/commit/1a5e19f3c1f8573dc1b80fbbb6ebb9dbeadc7073/includes/activitypub/transformer/class-events-manager.php#L86)
linos marked this conversation as resolved
linos added this to the 2. Alpha Phase project 2024-10-01 13:08:39 +02:00
ruru4143 added 1 commit 2024-10-01 18:59:02 +02:00
renamed get_excerpt back to extract_excerpt
Some checks failed
PHP Code Checker / PHP Code Checker (pull_request) Failing after 39s
PHPUnit / PHPUnit – PHP 8.1 (pull_request) Successful in 1m19s
PHPUnit / PHPUnit – PHP 8.2 (pull_request) Successful in 1m6s
PHPUnit / PHPUnit – PHP 8.3 (pull_request) Successful in 1m1s
ad09fa947c
ruru4143 changed title from WIP: transformer_refactoring to transformer_refactoring 2024-10-01 18:59:15 +02:00
ruru4143 added 1 commit 2024-10-01 19:03:47 +02:00
removed todo
Some checks failed
PHP Code Checker / PHP Code Checker (pull_request) Failing after 37s
PHPUnit / PHPUnit – PHP 8.1 (pull_request) Successful in 1m2s
PHPUnit / PHPUnit – PHP 8.2 (pull_request) Successful in 1m3s
PHPUnit / PHPUnit – PHP 8.3 (pull_request) Successful in 59s
b3b07d4b6a
linos added 2 commits 2024-10-02 13:13:24 +02:00
Do not set actor and do not override getAttributedTo.
Some checks failed
PHP Code Checker / PHP Code Checker (pull_request) Failing after 43s
PHPUnit / PHPUnit – PHP 8.1 (pull_request) Successful in 1m7s
PHPUnit / PHPUnit – PHP 8.2 (pull_request) Successful in 1m14s
PHPUnit / PHPUnit – PHP 8.3 (pull_request) Successful in 1m12s
1813a518f3
This was introduced to make interoperability with Mobilizon but it should be fixed on their side.
linos approved these changes 2024-10-02 13:15:44 +02:00
linos left a comment
Owner

Some last thoughts before merging this:

Some last thoughts before merging this:
Owner

Would you really change the behaviour here? Even if we do a user setting, I would just apply a custom template inherited with the possibilities from the ActivityPub plugin.

Furthermore this is currently not rendering blocks or shortcodes etc.

Would you really change the behaviour here? Even if we do a user setting, I would just apply a custom template inherited with the possibilities from the ActivityPub plugin. Furthermore this is currently not rendering blocks or shortcodes etc.
linos marked this conversation as resolved
@ -201,4 +128,1 @@
return $activitypub_object;
}
}
Owner

This behaviour was once copied from Mobilizon. The way they handle groups. The actor is the person who created the event and attributedTo is the Group. Mobilizon also had or still has mechanism to not list received events when the attributedTo is of type Person.

For now I removed it in commit #1813a518f308e1570b21bf1894cf7518ed3d5bc1

This behaviour was once copied from Mobilizon. The way they handle groups. The actor is the person who created the event and attributedTo is the Group. Mobilizon also had or still has mechanism to not list received events when the attributedTo is of type Person. For now I removed it in commit #1813a518f308e1570b21bf1894cf7518ed3d5bc1
linos marked this conversation as resolved
linos added 2 commits 2024-10-02 16:31:35 +02:00
improve formatting of categories
Some checks failed
PHP Code Checker / PHP Code Checker (pull_request) Successful in 42s
PHPUnit / PHPUnit – PHP 8.1 (pull_request) Failing after 1m11s
PHPUnit / PHPUnit – PHP 8.2 (pull_request) Failing after 1m14s
PHPUnit / PHPUnit – PHP 8.3 (pull_request) Failing after 1m11s
f76fa57665
linos added 1 commit 2024-10-02 17:11:17 +02:00
fix format_categories for empty term list
Some checks failed
PHP Code Checker / PHP Code Checker (pull_request) Successful in 50s
PHPUnit / PHPUnit – PHP 8.1 (pull_request) Failing after 1m8s
PHPUnit / PHPUnit – PHP 8.2 (pull_request) Failing after 1m7s
PHPUnit / PHPUnit – PHP 8.3 (pull_request) Failing after 1m9s
3f7f996e10
linos added 1 commit 2024-10-02 18:01:54 +02:00
add_post_type_support when updating activitypub_support_post_types
Some checks failed
PHP Code Checker / PHP Code Checker (pull_request) Successful in 45s
PHPUnit / PHPUnit – PHP 8.1 (pull_request) Failing after 1m2s
PHPUnit / PHPUnit – PHP 8.2 (pull_request) Failing after 1m8s
PHPUnit / PHPUnit – PHP 8.3 (pull_request) Failing after 1m12s
724a884738
linos added 2 commits 2024-10-02 18:11:11 +02:00
set hardcoded template for content
Some checks failed
PHP Code Checker / PHP Code Checker (pull_request) Failing after 42s
PHPUnit / PHPUnit – PHP 8.1 (pull_request) Failing after 1m5s
PHPUnit / PHPUnit – PHP 8.2 (pull_request) Failing after 1m6s
PHPUnit / PHPUnit – PHP 8.3 (pull_request) Failing after 1m5s
3975386a52
Owner

@ruru4143 The commit 724a884738 took me about 90 minutes to fix. A horrible race-condition that only is relevant in the test-setup!

@ruru4143 The commit https://code.event-federation.eu/Event-Federation/wordpress-activitypub-event-extensions/commit/724a8847380089ba8f4e893fc9b5c65bc04a8b92 took me about 90 minutes to fix. A horrible race-condition that only is relevant in the test-setup!
linos added 1 commit 2024-10-02 18:13:46 +02:00
replace strip_tags with wp_strip_all_tags in tests
Some checks failed
PHP Code Checker / PHP Code Checker (pull_request) Successful in 46s
PHPUnit / PHPUnit – PHP 8.1 (pull_request) Failing after 1m12s
PHPUnit / PHPUnit – PHP 8.2 (pull_request) Failing after 1m16s
PHPUnit / PHPUnit – PHP 8.3 (pull_request) Failing after 1m11s
676bb20751
linos added 1 commit 2024-10-02 18:47:02 +02:00
gatherpress: prevent gatherpress blocks from being rendered in activitystreams
Some checks failed
PHP Code Checker / PHP Code Checker (pull_request) Successful in 40s
PHPUnit / PHPUnit – PHP 8.1 (pull_request) Failing after 1m5s
PHPUnit / PHPUnit – PHP 8.2 (pull_request) Failing after 1m4s
PHPUnit / PHPUnit – PHP 8.3 (pull_request) Failing after 1m7s
2301900baa
linos added 1 commit 2024-10-02 18:54:31 +02:00
strip tags within gatherpress tests
Some checks failed
PHP Code Checker / PHP Code Checker (pull_request) Successful in 41s
PHPUnit / PHPUnit – PHP 8.1 (pull_request) Failing after 1m5s
PHPUnit / PHPUnit – PHP 8.2 (pull_request) Failing after 1m6s
PHPUnit / PHPUnit – PHP 8.3 (pull_request) Failing after 1m0s
982c9c3e44
linos added 1 commit 2024-10-02 19:03:09 +02:00
fix gatherpress tests: event must always be published
Some checks failed
PHP Code Checker / PHP Code Checker (pull_request) Successful in 42s
PHPUnit / PHPUnit – PHP 8.1 (pull_request) Failing after 1m4s
PHPUnit / PHPUnit – PHP 8.2 (pull_request) Failing after 1m16s
PHPUnit / PHPUnit – PHP 8.3 (pull_request) Has been cancelled
1aedb964a9
linos added 1 commit 2024-10-02 19:06:28 +02:00
tests for events manager: fix status
Some checks failed
PHP Code Checker / PHP Code Checker (pull_request) Successful in 44s
PHPUnit / PHPUnit – PHP 8.1 (pull_request) Failing after 1m8s
PHPUnit / PHPUnit – PHP 8.2 (pull_request) Failing after 1m6s
PHPUnit / PHPUnit – PHP 8.3 (pull_request) Failing after 1m6s
9d2f17583d
linos added 1 commit 2024-10-02 19:08:59 +02:00
fix events manager tests: strip tags for content
All checks were successful
PHP Code Checker / PHP Code Checker (pull_request) Successful in 41s
PHPUnit / PHPUnit – PHP 8.1 (pull_request) Successful in 1m5s
PHPUnit / PHPUnit – PHP 8.2 (pull_request) Successful in 1m9s
PHPUnit / PHPUnit – PHP 8.3 (pull_request) Successful in 1m2s
a6938edf46
linos merged commit 972fcbb2db into main 2024-10-02 19:15:29 +02:00
Sign in to join this conversation.
No reviewers
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Event-Federation/wordpress-event-bridge-for-activitypub#44
No description provided.