Skip to content

Consolidate Mastodon into shared prod workflow#70

Open
prajwalbang wants to merge 15 commits intomasterfrom
codex/mastodon-main-workflow
Open

Consolidate Mastodon into shared prod workflow#70
prajwalbang wants to merge 15 commits intomasterfrom
codex/mastodon-main-workflow

Conversation

@prajwalbang
Copy link
Copy Markdown
Collaborator

@prajwalbang prajwalbang commented Apr 8, 2026

What changed

  • added MASTODON_TOKEN to the shared production workflow in prod.yml
  • pinned decorator to 4.4.2 so the shared dependency install works with both instagrapi and Mastodon.py
  • removed the standalone mastodon-post.yml workflow

Why

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.1 conflicted with moviepy pulled in by instagrapi, 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 whenever MASTODON_TOKEN is present.

Validation

  • reviewed the shared poster loading path in main.py
  • verified prod.yml now provides MASTODON_TOKEN
  • verified the standalone Mastodon workflow file was removed
  • local compileall validation was blocked by Windows permission issues writing existing __pycache__ files

@prajwalbang prajwalbang changed the title Use main Mastodon account and fix workflow install Consolidate Mastodon into shared prod workflow Apr 8, 2026

__all__ = ["PosterBluesky", "PosterDebug", "PosterInstagram"]

def __getattr__(name):
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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" \
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably delete this curl command comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i have updated my test account and refreshed token, and updated the secrets for test account so no worry about leaking secrets

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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))
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Error message should probably have "Mastadon" as a prefix here so we know it's coming from mastadon

Comment thread main.py
from social_posters.bluesky import PosterBluesky

return PosterBluesky()

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we remove this refactoring?

Comment thread main.py

from social_posters.instagram import PosterInstagram
from social_posters.bluesky import PosterBluesky
requested_platforms = _requested_platforms()
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

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.

4 participants