Move TwitterOAuth to composer Part 1: Twitter #505
No reviewers
Labels
No labels
2018.09
2019.01
2019.03
2019.06
2019.09
2019.12
2020.03
2020.06
2020.09
2020.12
2021.03
2021.07
2021.09
2022.02
2022.06
2022.09
2022.12
2023.04
2023.05
2023.09
2024.03
2024.06
2024.09
2024.12
dependencies
Hackathon 2021
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: friendica/friendica-addons#505
Loading…
Reference in a new issue
No description provided.
Delete branch "task/4116-move-twitteroauth-to-composer"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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
andtwitter
.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.
Have you tested that the picture upload is really working?
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?
@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.
Doing a post with a single picture should work great. I'm doing this with posts from the API that contain pictures.
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.
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.@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! 😋
I hope it still will be posted as picture - since this one did: https://twitter.com/heluecht/status/957334146111737856
Twitter itself transforms image links at the end of the body into attached pictures, so I'm not sure we actually did the uploading.
We did, trust me.
Ok, the image link triggers the image upload, let's test if it works now.
Upload works as expected, let's test the status update
Success, I'll move the TwitterOAuth lib in the twitter addon now.
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.