Consolidate Mastodon into shared prod workflow#70
Consolidate Mastodon into shared prod workflow#70prajwalbang wants to merge 15 commits intomasterfrom
Conversation
…to mastodon merge
|
|
||
| __all__ = ["PosterBluesky", "PosterDebug", "PosterInstagram"] | ||
|
|
||
| def __getattr__(name): |
There was a problem hiding this comment.
Why do we need the getattr here? This is a bit weird haha
| @@ -0,0 +1,51 @@ | |||
| #curl -X POST "https://mastodon.social/api/v1/statuses" \ | |||
There was a problem hiding this comment.
We should probably delete this curl command comment
There was a problem hiding this comment.
i have updated my test account and refreshed token, and updated the secrets for test account so no worry about leaking secrets
There was a problem hiding this comment.
yeah sounds good, and shhhh delete the test token below too
| post_url=status.get("url"), | ||
| ) | ||
| except Exception as exc: | ||
| return PostResult(success=False, error_message=str(exc)) |
There was a problem hiding this comment.
Error message should probably have "Mastadon" as a prefix here so we know it's coming from mastadon
| from social_posters.bluesky import PosterBluesky | ||
|
|
||
| return PosterBluesky() | ||
|
|
There was a problem hiding this comment.
should we remove this refactoring?
|
|
||
| from social_posters.instagram import PosterInstagram | ||
| from social_posters.bluesky import PosterBluesky | ||
| requested_platforms = _requested_platforms() |
There was a problem hiding this comment.
this looks like a cool refactor, but I do find it a little jump-through-more-things, vs having it here.
if this was introduced for the purposes of having the instagram dep that conflicts with other things isolated, I challenge us to thinking of the value of the not-totally-viable-last-I-heard-instapgram-pip-package we're using, and restoring the more in-line import patter on the outgoing part of the diff
What changed
MASTODON_TOKENto the shared production workflow inprod.ymldecoratorto4.4.2so the shared dependency install works with bothinstagrapiandMastodon.pymastodon-post.ymlworkflowWhy
Mastodon was already implemented through
main.py, but it was being triggered through a separate workflow instead of the same shared production path used by Bluesky and the other posters. Consolidating the workflow keeps posting logic in one place and avoids maintaining a separate Mastodon-only action.The shared workflow also needed a dependency fix:
decorator==5.2.1conflicted withmoviepypulled in byinstagrapi, so GitHub Actions could fail during install.Impact
Production posting now uses one shared workflow path through
main.py, and Mastodon participates in that flow wheneverMASTODON_TOKENis present.Validation
main.pyprod.ymlnow providesMASTODON_TOKENcompileallvalidation was blocked by Windows permission issues writing existing__pycache__files