Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto-update index periodically #1447

Merged
merged 4 commits into from
Oct 4, 2023
Merged

Conversation

mosteo
Copy link
Member

@mosteo mosteo commented Sep 9, 2023

Default every 24h. The user is asked the first time.

Fixes #1348

@mosteo mosteo marked this pull request as ready for review September 9, 2023 20:00
Copy link
Member

@Fabien-Chouteau Fabien-Chouteau left a comment

Choose a reason for hiding this comment

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

I see why you want to do this, we regularly have questions from people that never update the index. However I am a but worried about the consequences :)

What happens if there's no internet connection?

@mosteo
Copy link
Member Author

mosteo commented Sep 13, 2023

Actually I thought that you also wanted it :) given the discussion in #1348.

Yup, I forgot to test what happens in the offline case. We should fail the update gracefully with a warning and continue as before. We probably don't want to try again immediately but back-off for the configured period in any case. I'll do a bit more testing.

@rowan-walshe
Copy link
Contributor

I like the change. I was once on of those that had to ask why alr couldn't find a newer version of a crate that I could see in the index on GitHub.

One comment I have is that while alr update --online can be used to force update the index(es) before attempting crate updates, it feels like it should still call Auto_Update_Index if --online isn't set

@mosteo mosteo force-pushed the feat/autorefresh branch 3 times, most recently from a9474f5 to 38090b0 Compare October 4, 2023 07:26
@mosteo
Copy link
Member Author

mosteo commented Oct 4, 2023

Updated to ensure that an automatic update failure causes the regular backoff, and is handled as a warning.

Also added a test for it. I didn't find a simple solution to make the test locally, so that test uses an online repo I created to that effect. There may be solutions around that by using a local git server, but that seemed too complex just to avoid going online, given that that's not a crucial situation for our testing.

@mosteo mosteo requested a review from Fabien-Chouteau October 4, 2023 08:12
@mosteo mosteo merged commit aab567a into alire-project:master Oct 4, 2023
13 checks passed
@mosteo mosteo deleted the feat/autorefresh branch October 4, 2023 09:01
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.

Improve user experience with regards to index update
3 participants