Skip to content

Add support for --org flag syncs#6

Open
ParadoxGuitarist wants to merge 1 commit into
lukaswrz:mainfrom
ParadoxGuitarist:feature/org-sync
Open

Add support for --org flag syncs#6
ParadoxGuitarist wants to merge 1 commit into
lukaswrz:mainfrom
ParadoxGuitarist:feature/org-sync

Conversation

@ParadoxGuitarist

@ParadoxGuitarist ParadoxGuitarist commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Resolves #5

I'm currently using this to sync from forgejo -> forgejo but I haven't done any other testing with the code. It should still work as normal with no changes, but the --org flag will require that the token permissions have access to read/write for the org field (similar to the current user requirement)

This PR also doesn't update any of the docs, but I figured that might need to be done with a new release version.

Signed-off-by: Brian Monroe <bmonroe@ucsb.edu>

@lukaswrz lukaswrz left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Looks good overall. I'd appreciate if you could take a look at the comments and run ruff format.

Comment thread src/forgesync/dest.py
Comment on lines 55 to 63
case Platform.GITHUB:
return GithubSyncer(
instance=self.instance,
token=token,
features=features,
logger=logger,
push_mirrorer=push_mirrorer,
push_mirror_config=push_mirror_config,
)

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

We should show an error if org is set and the user wants to sync to GitHub, so that they aren't surprised that it's being ignored until GitHub org support is implemented.

Comment thread src/forgesync/forgejo.py
self.repos = {}
if self.is_org:
self.target_owner = org
self.user = None

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

self.user is currently of type ForgejoUser, so it should be updated to ForgejoUser | None.

Comment thread src/forgesync/forgejo.py
raise RepositoryError("Received malformed target repository from Forgejo")

self.client.repository.repo_update_topics(
owner=edited_repo.owner.login,

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

This should probably also be self.target_owner.

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.

Support for Org Sync/Mirrors

2 participants