If git.coopcloud.tech is down, try to keep going with local files #292

Closed
opened 2022-01-27 11:26:59 +00:00 by decentral1se · 12 comments
Owner

Describe the current behavior

abra bails out if the internet is not there even though we have local files.

Steps to reproduce

Take down git.coopcloud.tech like a total cowgirl and run abra app anything...

Describe the expected behavior

abra will complain if it doesn't have local copies and bail out. Otherwise, it'll use the local copies and warn about doing so.

Any idea how this might be fixed?

See above. Thought about a --offline flag but I'd rather not introduce new stuff right now before beta.

Additional information

N/A

## Describe the current behavior `abra` bails out if the internet is not there even though we have local files. ## Steps to reproduce Take down git.coopcloud.tech like a total cowgirl and run `abra app` anything... ## Describe the expected behavior `abra` will complain if it doesn't have local copies and bail out. Otherwise, it'll use the local copies and warn about doing so. ## Any idea how this might be fixed? See above. Thought about a `--offline` flag but I'd rather not introduce new stuff right now before beta. ## Additional information N/A
decentral1se added the
enhancement
abra
labels 2022-01-27 11:26:59 +00:00
decentral1se added this to the Beta release (software) project 2022-01-27 11:27:10 +00:00
decentral1se removed this from the Beta release (software) project 2022-02-09 17:51:42 +00:00
Author
Owner

Ran into this again, also the linting fails with a missing repository which is not quite true! It just doesn't exist online. We probably shouldn't explode on that linting error in this case?

Ran into this again, also the linting fails with a missing repository which is not quite true! It just doesn't exist online. We probably shouldn't explode on that linting error in this case?
Member

same experience here :D luckily only a short downtime ...
would love a --offline flag!

further thoughts: Maybe it would be cool to configure the catalogue url to make abra more robust in case git.coopcloud.tech is down for a longer period, people could git push the catalogue to git.newcoop.tech and continue from there on

same experience here :D luckily only a short downtime ... would love a --offline flag! further thoughts: Maybe it would be cool to configure the catalogue url to make abra more robust in case git.coopcloud.tech is down for a longer period, people could git push the catalogue to git.newcoop.tech and continue from there on
Author
Owner

would love a --offline flag!

Yeh, I think it might be time to look into this again shortly...

further thoughts: Maybe it would be cool to configure the catalogue url to make abra more robust in case git.coopcloud.tech is down for a longer period, people could git push the catalogue to git.newcoop.tech and continue from there on

I think this ties into some other thinking nicely: potentially have a configuration option for the catalogue repository in coop-cloud/organising#303. A related ticket was coop-cloud/organising#139 but that might be too far for now.

> would love a --offline flag! Yeh, I think it might be time to look into this again shortly... > further thoughts: Maybe it would be cool to configure the catalogue url to make abra more robust in case git.coopcloud.tech is down for a longer period, people could git push the catalogue to git.newcoop.tech and continue from there on I think this ties into some other thinking nicely: potentially have a configuration option for the catalogue repository in https://git.coopcloud.tech/coop-cloud/organising/issues/303. A related ticket was https://git.coopcloud.tech/coop-cloud/organising/issues/139 but that might be too far for now.
Author
Owner
❯ abra app logs git_coopcloud_tech
FATA[0000] unexpected client error: unexpected requesting "https://git.coopcloud.tech/coop-cloud/gitea.git/info/refs?service=git-upload-pack" status code: 502 

Need for some sort of offline resilience i n t e n s i f i e s

``` ❯ abra app logs git_coopcloud_tech FATA[0000] unexpected client error: unexpected requesting "https://git.coopcloud.tech/coop-cloud/gitea.git/info/refs?service=git-upload-pack" status code: 502 ``` Need for some sort of offline resilience i n t e n s i f i e s
decentral1se added this to the (deleted) project 2022-08-05 11:49:16 +00:00
moritz self-assigned this 2022-12-06 14:55:33 +00:00
moritz removed their assignment 2022-12-06 15:32:31 +00:00
Member
❯ abra app logs git_coopcloud_tech
FATA[0000] unexpected client error: unexpected requesting "https://git.coopcloud.tech/coop-cloud/gitea.git/info/refs?service=git-upload-pack" status code: 502 

Need for some sort of offline resilience i n t e n s i f i e s

I couldn't reproduce abra app logs to fail if git.coopcloud.tech is not reachable. Where does cli/app/logs.go fetch any ressources?

> ``` > ❯ abra app logs git_coopcloud_tech > FATA[0000] unexpected client error: unexpected requesting "https://git.coopcloud.tech/coop-cloud/gitea.git/info/refs?service=git-upload-pack" status code: 502 > ``` > > Need for some sort of offline resilience i n t e n s i f i e s I couldn't reproduce `abra app logs` to fail if `git.coopcloud.tech` is not reachable. Where does `cli/app/logs.go` fetch any ressources?
Owner

that's a great question, thanks for investigating @moritz. @decentral1se you got any ideas how we could have seen the output in coop-cloud/organising#292 (comment)?

that's a great question, thanks for investigating @moritz. @decentral1se you got any ideas how we could have seen the output in https://git.coopcloud.tech/coop-cloud/organising/issues/292#issuecomment-13670?
Member

I could find it. The app logs commands calls ValidateApp
This function does much more than it should do (ValidateApp ensures the app name arg is valid.). It calls EnsureExists which clones the recipe if it doesn't exist. This violates the principle of single responsibility and makes things complicated because the recipe is not necessary for acessing the logs.

I am not sure how to quickly fix this as ValidateApp is used at 22 locations and it does many multiple things that are sometimes necessary, sometimes not.
The best way would be to do a large refactoring.

I could find it. The `app logs` commands calls [`ValidateApp`](https://git.coopcloud.tech/coop-cloud/abra/src/commit/09048ee2234636f449a1e8ba020941a944ae687c/cli/internal/validate.go#L120) This function does much more than it should do (`ValidateApp ensures the app name arg is valid.`). It calls [`EnsureExists`](https://git.coopcloud.tech/coop-cloud/abra/src/commit/09048ee2234636f449a1e8ba020941a944ae687c/pkg/recipe/recipe.go#L250) which clones the recipe if it doesn't exist. This violates the principle of single responsibility and makes things complicated because the recipe is not necessary for acessing the logs. I am not sure how to quickly fix this as `ValidateApp` is used at 22 locations and it does many multiple things that are sometimes necessary, sometimes not. The best way would be to do a large refactoring.
Author
Owner

Nice investigation @moritz, thank you!

My principles while programming abra were Principle of Does It Work ™️ 🙃 Maybe we could do a co-work / online call one day to see how to strategise a refactor of ValidateApp?

I think that would be good to do. I'm scared to do it because we have few tests but then again, we have a lot of people who can help us doing some release candidate testing and that has worked for us in the past.

Taking a look at coop-cloud/abra#235 now 💯

Nice investigation @moritz, thank you! My principles while programming `abra` were Principle of Does It Work ™️ 🙃 Maybe we could do a co-work / online call one day to see how to strategise a refactor of `ValidateApp`? I think that would be good to do. I'm scared to do it because we have few tests but then again, we have a lot of people who can help us doing some release candidate testing and that has worked for us in the past. Taking a look at https://git.coopcloud.tech/coop-cloud/abra/pulls/235 now 💯
3wordchant modified the project from (deleted) to (deleted) 2023-01-11 16:14:05 +00:00
3wordchant modified the project from (deleted) to Federation & abra fixes 2023-01-11 16:18:25 +00:00
Author
Owner

I believe this got fixed? We made the release, stuff has been down and no complaints. Going to close, please re-open if there is more to do.

I believe this got fixed? We made the release, stuff has been down and no complaints. Going to close, please re-open if there is more to do.
Member

In most scenarios abra should work if git.coopcloud.tech is down.
But I think there are still a few rare conditions, which could make problems.
For example running abra app logs can only execute if the recipe repo is cloned. I think this should not be necessary for simply looking up the logs.
But I consider this is not a very high priority case.

In most scenarios abra should work if git.coopcloud.tech is down. But I think there are still a few rare conditions, which could make problems. For example running `abra app logs` can only execute if the recipe repo is cloned. I think this should not be necessary for simply looking up the logs. But I consider this is not a very high priority case.
Author
Owner

Oh yeh, let's keep this one going then! Any other situations come to mind?

Looking at the various call sites of ValidateApp, yeh, I think we could include a new boolean which determines if we should error out if the recipe can't be cloned? Or better, if we should even clone the recipe to run the command? There could be some case-by-case time saving to be made here? Can take a run at this unless you feel like it @moritz?

Oh yeh, let's keep this one going then! Any other situations come to mind? Looking at the various call sites of `ValidateApp`, yeh, I think we could include a new boolean which determines if we should error out if the recipe can't be cloned? Or better, if we should even clone the recipe to run the command? There could be some case-by-case time saving to be made here? Can take a run at this unless you feel like it @moritz?
Author
Owner

OK, coop-cloud/abra#275 should cover this streaming logs case and trys to set up the code to make this easier going forward. Gonna close this when merged. Let's open more specific tickets for further offline support. Thanks!

OK, https://git.coopcloud.tech/coop-cloud/abra/pulls/275 should cover this streaming logs case and trys to set up the code to make this easier going forward. Gonna close this when merged. Let's open more specific tickets for further offline support. Thanks!
Sign in to join this conversation.
No description provided.