Add support for --org flag syncs#6
Open
ParadoxGuitarist wants to merge 1 commit into
Open
Conversation
Signed-off-by: Brian Monroe <bmonroe@ucsb.edu>
lukaswrz
requested changes
Jul 10, 2026
lukaswrz
left a comment
Owner
There was a problem hiding this comment.
Looks good overall. I'd appreciate if you could take a look at the comments and run ruff format.
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, | ||
| ) |
Owner
There was a problem hiding this comment.
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.
| self.repos = {} | ||
| if self.is_org: | ||
| self.target_owner = org | ||
| self.user = None |
Owner
There was a problem hiding this comment.
self.user is currently of type ForgejoUser, so it should be updated to ForgejoUser | None.
| raise RepositoryError("Received malformed target repository from Forgejo") | ||
|
|
||
| self.client.repository.repo_update_topics( | ||
| owner=edited_repo.owner.login, |
Owner
There was a problem hiding this comment.
This should probably also be self.target_owner.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
--orgflag will require that the token permissions have access to read/write for the org field (similar to the currentuserrequirement)This PR also doesn't update any of the docs, but I figured that might need to be done with a new release version.