Move TwitterOAuth to composer Part 1: Twitter #505

Merged
MrPetovan merged 5 commits from task/4116-move-twitteroauth-to-composer into develop 2018-01-28 19:19:04 +01:00
MrPetovan commented 2018-01-28 05:57:38 +01:00 (Migrated from github.com)

Part of https://github.com/friendica/friendica/issues/4116

I'm trying to get rid of library/twitteroauth.php, however it's a dependency for 3 addons, statusnet, tumblr and twitter.

A newer version of the library exists but I didn't want to put it in the Friendica main composer dependencies since it's only used in addons.

So yes, yes I did.

I created a composer.json for addons.

Yes, this means more Composer install shenanigans, but I figured that everybody running develop had their update script on lock by now, right?

This gets rid of CodeBird in the Twitter addon, another dependency used by a couple of addons.

Part of https://github.com/friendica/friendica/issues/4116 I'm trying to get rid of `library/twitteroauth.php`, however it's a dependency for 3 addons, `statusnet`, `tumblr` and `twitter`. A newer version of the library exists but I didn't want to put it in the Friendica main composer dependencies since it's only used in addons. So yes, yes I did. I created a `composer.json` for addons. Yes, this means more Composer install shenanigans, but I figured that everybody running develop had their update script on lock by now, right? This gets rid of CodeBird in the Twitter addon, another dependency used by a couple of addons.
annando commented 2018-01-28 07:18:19 +01:00 (Migrated from github.com)

Have you tested that the picture upload is really working?

Have you tested that the picture upload is really working?
tobiasd commented 2018-01-28 07:19:01 +01:00 (Migrated from github.com)

So far every addon creator who wanted to use composer has done so on a per addon basis. Will this per addon composer be compatible with the composer for the entire core addons?

So far every addon creator who wanted to use composer has done so on a per addon basis. Will this per addon composer be compatible with the composer for the entire core addons?
MrPetovan commented 2018-01-28 10:14:58 +01:00 (Migrated from github.com)

@annando: I was going to ask you the same question. The picture upload happens only when a Friendica post contains an [attachment]type=image tag, and I wasn’t able to produce one either with the image browser nor with the attachment button in the new post jot.

Is there an automatic post I wouldn’t know about that generates public posts with image attachments?

@tobias: Actually the current Composer structure is only used by the Twitter addon, so it’s a good argument for moving it inside of the twitter folder. Initially I thought that multiple addons shared a dependency on TwitterOAuth and Codebird, so I didn’t want to have the dependency physically duplicated since we ship all addons together anyway.

However Twitter only used CodeBird because TwitterOAUth was obsolete, and StatusNet extends from this specific obsolete version of TwitterOAuth that isn’t even available through Packagist, and Tumblr even has it’s own modified TumblrOAuth file. And since I’m not using either of those addons, I’m not going to make them compatible with a more recent version of the library they use.

So this is the result, a half-assed attempt at mutualizing addon dependencies that I hope will be more fruitful in the future, but maybe I should stick to per-addon Composer dependencies checked out with the addon files since I couldn’t find how to recursively trigger Composer install in a file tree.

@annando: I was going to ask you the same question. The picture upload happens only when a Friendica post contains an `[attachment]type=image` tag, and I wasn’t able to produce one either with the image browser nor with the attachment button in the new post jot. Is there an automatic post I wouldn’t know about that generates public posts with image attachments? @tobias: Actually the current Composer structure is only used by the Twitter addon, so it’s a good argument for moving it inside of the `twitter` folder. Initially I thought that multiple addons shared a dependency on TwitterOAuth and Codebird, so I didn’t want to have the dependency physically duplicated since we ship all addons together anyway. However Twitter only used CodeBird because TwitterOAUth was obsolete, and StatusNet extends from this specific obsolete version of TwitterOAuth that isn’t even available through Packagist, and Tumblr even has it’s own modified `TumblrOAuth` file. And since I’m not using either of those addons, I’m not going to make them compatible with a more recent version of the library they use. So this is the result, a half-assed attempt at mutualizing addon dependencies that I hope will be more fruitful in the future, but maybe I should stick to per-addon Composer dependencies checked out with the addon files since I couldn’t find how to recursively trigger Composer install in a file tree.
annando commented 2018-01-28 12:29:14 +01:00 (Migrated from github.com)

Doing a post with a single picture should work great. I'm doing this with posts from the API that contain pictures.

Doing a post with a single picture should work great. I'm doing this with posts from the API that contain pictures.
annando commented 2018-01-28 12:45:32 +01:00 (Migrated from github.com)

See my post https://pirati.ca/display/ec054ce7425a6cd25527cb6236724404 for a post that had been sent to Twitter. So you could try to create some test post that is looking the same.

See my post https://pirati.ca/display/ec054ce7425a6cd25527cb6236724404 for a post that had been sent to Twitter. So you could try to create some test post that is looking the same.
MrPetovan commented 2018-01-28 16:39:57 +01:00 (Migrated from github.com)

Your post doesn't have any [attachement] either in its body, I'm not sure it would be picked up for image upload by the twitter addon, I have to make some closed tests.

Your post doesn't have any `[attachement]` either in its body, I'm not sure it would be picked up for image upload by the twitter addon, I have to make some closed tests.
MrPetovan commented 2018-01-28 16:41:03 +01:00 (Migrated from github.com)

@tobiasd @annando I'm surprised none of you tried to dissuade me to add a addon-wide composer setting, I guess I'll have to dissuade myself! 😋

@tobiasd @annando I'm surprised none of you tried to dissuade me to add a addon-wide composer setting, I guess I'll have to dissuade myself! 😋
annando commented 2018-01-28 17:21:34 +01:00 (Migrated from github.com)

I hope it still will be posted as picture - since this one did: https://twitter.com/heluecht/status/957334146111737856

I hope it still will be posted as picture - since this one did: https://twitter.com/heluecht/status/957334146111737856
MrPetovan commented 2018-01-28 17:23:07 +01:00 (Migrated from github.com)

Twitter itself transforms image links at the end of the body into attached pictures, so I'm not sure we actually did the uploading.

Twitter itself transforms image links at the end of the body into attached pictures, so I'm not sure we actually did the uploading.
annando commented 2018-01-28 17:32:33 +01:00 (Migrated from github.com)

We did, trust me.

We did, trust me.
MrPetovan commented 2018-01-28 17:36:16 +01:00 (Migrated from github.com)

Ok, the image link triggers the image upload, let's test if it works now.

Ok, the image link triggers the image upload, let's test if it works now.
MrPetovan commented 2018-01-28 17:37:31 +01:00 (Migrated from github.com)

Upload works as expected, let's test the status update

Upload works as expected, let's test the status update
MrPetovan commented 2018-01-28 17:40:29 +01:00 (Migrated from github.com)

Success, I'll move the TwitterOAuth lib in the twitter addon now.

Success, I'll move the TwitterOAuth lib in the twitter addon now.
MrPetovan commented 2018-01-28 18:59:24 +01:00 (Migrated from github.com)

After fiddling with a couple systems meant to manage optional plugins dependencies, I finally settled for the explicit dependencies commit.

This isn't a red alert anymore, everyone at ease.

After fiddling with a couple systems meant to manage optional plugins dependencies, I finally settled for the explicit dependencies commit. This isn't a red alert anymore, everyone at ease.
Sign in to join this conversation.
No description provided.