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

Show existing data when opening the site locally #1920

Open
Kobzol opened this issue Jun 9, 2024 · 2 comments · May be fixed by #1921
Open

Show existing data when opening the site locally #1920

Kobzol opened this issue Jun 9, 2024 · 2 comments · May be fixed by #1921
Labels
help wanted We are looking for volunteers to take on this issue

Comments

@Kobzol
Copy link
Contributor

Kobzol commented Jun 9, 2024

When you run the site locally, and open the compare.html page (which is shown by default), you will be greated with a very annoying error message (which essentially tells you that the backend has panicked, or something like that). It would be great if the default view for compare.html examined the database, and tried to show some reasonable data by default, e.g. the latest entry found in the DB and -30 days before that (same as what it does on the production web).

If there is only a single commit, it should be compared with itself (this can be useful to see absolute numbers of the benchmark metrics), to again avoid showing the error message.

@Kobzol Kobzol added the help wanted We are looking for volunteers to take on this issue label Jun 9, 2024
@s7tya
Copy link
Contributor

s7tya commented Jun 9, 2024

I'm fully supporting this. I always remember the magical period "from 2024-02-20 to 2024-02-25" while working on the compare page locally.

@s7tya
Copy link
Contributor

s7tya commented Jun 9, 2024

Currently, it attempts to get commits from the past 30 days using chrono::Utc::now().date_naive() - chrono::Duration::days(30). However, the latest commit available via fetch-latest is from 2024-03-14. It cannot find any commits after 2024-05-10, which is 30 days ago from today.

Bound::None => {
let last_month = chrono::Utc::now().date_naive() - chrono::Duration::days(30);
commit.is_master() && last_month <= commit.date.0.naive_utc().date()
}

I am wondering how to solve this problem. The first idea that came to mind is to add conditions to include commits within 30 days from the latest commit here:

.find(|commit| bound.left_match(commit))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted We are looking for volunteers to take on this issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants