borgwarehouse icon indicating copy to clipboard operation
borgwarehouse copied to clipboard

Feature/repo refresh option

Open mirisbowring opened this issue 1 year ago • 8 comments

Hi,

coming from https://github.com/Ravinou/borgwarehouse/issues/247#issuecomment-2195580701

I implemented an environmental variable that enables / disables (by default) an AUTO_REFRESH option. If this option is enabled, each ssh forced commands get appended a script to call the warehouse api to fetch the latest details about the repo.

This approach is better than any cronjob since it get's executed only if a borg activity has happened (not just on a timely basis).

I hope this get pulled since i expect this to be a useful feature for others also.

mirisbowring avatar Jul 03 '24 15:07 mirisbowring

@Ravinou what do you think about this? :)

mirisbowring avatar Jul 17 '24 12:07 mirisbowring

Thank you for this contribution, which I am studying. Could you start by squashing your commits please and add the conventional scopes ? It'll make it easier for me to read 😊. By the way, you can rebase your branch on main, I added husky to help with that recently 👍

Next, I'll have to take the time to study and test this, as you're touching on core functions, notably the repository creation shells and their regexes.

I still have my doubts about reintegrating the triggering of a task like this into borgwarehouse. Originally, v1 had a built-in cron. But it was removed because it was causing problems and nobody recommends doing that. This job should be given to another service. I'll study your PR, I promise, but I don't know if I'll approve it yet. Thanks in any case.

Ravinou avatar Jul 20 '24 19:07 Ravinou

I will rebase :)

Wouldn't it be easier to squash the commits here on the PR and i format the PR Text according to the conventional scopes? Then the newly created (squashed) commit by GitHub will be as you wish?

Or do you want to fast forward merge to preserve original signatures?

mirisbowring avatar Jul 21 '24 08:07 mirisbowring

You can do only one commit "feat:", I will study it by merging it in a specific branch. Thanks.

Ravinou avatar Jul 21 '24 09:07 Ravinou

Hi, I rebased and squashed the changes. This change is still a bit different from v1 because it is not using any cron. it is just an additional ssh-forced-command that will be executed as soon as the borg command finishes (independend of success or failure since it does not iterfere in this case).

mirisbowring avatar Jul 21 '24 10:07 mirisbowring

Thanks, it's much clearer. I'm currently working on token API integration. As soon as it's finished, I'll start working on your proposal in the next few weeks. Thank you for your patience.

Ravinou avatar Jul 22 '24 11:07 Ravinou

Hi @Ravinou I saw your latest relase. Before i invest time into solving the conflicts - are there chances that this PR get's merged?

mirisbowring avatar Sep 04 '24 10:09 mirisbowring

Hi, for the moment don't do the rebase, I'll have a look when I get the time back ;)

Ravinou avatar Sep 07 '24 19:09 Ravinou