cooperspencer / gickup

https://cooperspencer.github.io/gickup-documentation/
Apache License 2.0
972 stars 35 forks source link

Query: Disable 'mirror' option for gitea/forgejo destination endpoints #224

Closed mcrmonkey closed 5 months ago

mcrmonkey commented 6 months ago

Not sure if I'm being a bit dim and missing it in the documentation but is it possible to have Gickup sync a source repo directly to an gitea/forgejo endpoint rather than use the mirroring features of the destination?

Why the ask; A gitea/forgejo endpoint ('codeberg' specifically) has mirroring turned off so any calls to the API requesting a mirror be setup receive an 'its turned off' message and so cannot proceed.

cooperspencer commented 6 months ago

That is not yet implemented, but I'd like to add that feature.

mcrmonkey commented 6 months ago

Ahh wonderful ! :heart: :tada:

cooperspencer commented 5 months ago

Hello again,

FYI I started to work on that feature. I was already able to "mirror" gickup to codeberg. https://codeberg.org/buddyspencer/gickup

You can track the progress here: https://github.com/cooperspencer/gickup/pull/225/files

I am just not sure about the name for the parameter, selfmirror sounds a bit weird.

mcrmonkey commented 5 months ago

Greetings, Excellent work!

Maybe name the parameter something like mirror and give it a sub parameter of enabled. The MirrorInterval parameter could be moved to live under that perhaps ...

example:


gitea:
  ...
  mirror:
    enabled: true
    MirrorInterval: '8h0m0s'

:thinking: How would that play out for people who don't have that in their current config but do use gitea though ?

cooperspencer commented 5 months ago

That wouldn't be a big deal. I'd just keep mirrorinterval where it is right now as well and give a deprecation notice.

cooperspencer commented 5 months ago

something like this

2024-04-12T11:58:01+02:00 INF mirroring gickup to http://127.0.0.1:3000/ stage=gitea url=http://127.0.0.1:3000/
2024-04-12T11:58:01+02:00 WRN mirrorinterval is deprecated and will be removed in the next release. please move it under the mirror parameter. stage=gitea url=http://127.0.0.1:3000/

is that clear enough?

mcrmonkey commented 5 months ago

:+1: I think that would be clear for me

cooperspencer commented 5 months ago

I pushed a new release withe the fix

mcrmonkey commented 5 months ago

ooh, excellent work! Thank you !

I shall give it a test run shortly

mcrmonkey commented 5 months ago

:thinking: I don't appear to be having much success with this

Either omiting or including this config for a destination:

gitea:
...
  mirror:
    enabled: false

in the config still seems to trigger the mirror option causing the repo creation to be denied by codeberg

I can work around it in code but theres some further stuff that gets triggered an update is attempted

cooperspencer commented 5 months ago

false would be the default value, which means Forgejo/Gitea handle the process of mirroring the repo. If you set it to true gickup will handle the mirror, basically cloning the repo and pushing it to codeberg.

https://cooperspencer.github.io/gickup-documentation/configuration/destination_docu/gitea

cooperspencer commented 5 months ago

I created a blog post about mirroring to Codeberg. Maybe it helps you out here. https://cooperspencer.github.io/gickup-documentation/blog/codeberg-mirror

mcrmonkey commented 5 months ago

Ahhh! That makes more sense! I was coming at this with the view that disabling the mirroring would mean you wouldn't use the destinations mirroring features !