Skip to content

More robust overnight benchmark commit identification - #7271

Open
trexfeathers wants to merge 1 commit into
SciTools:mainfrom
trexfeathers:bm-better-overnight
Open

More robust overnight benchmark commit identification#7271
trexfeathers wants to merge 1 commit into
SciTools:mainfrom
trexfeathers:bm-better-overnight

Conversation

@trexfeathers

Copy link
Copy Markdown
Contributor

Description

To prevent problems where a delayed GHA run misses benchmarks because the definition of 'yesterday' has changed.

Checklist

Important

The Iris core developers are here to help! If anything below is unclear, just post a comment asking for help 😊


Tip

Things you can trigger on this PR:

  • Add this label to trigger benchmarks: benchmark_thisRequest that this pull request be benchmarked to check if it introduces performance shifts
  • Visit this URL - swapping 9999 for this PR's number - to re-trigger the CLA check:
    https://cla-assistant.io/check/SciTools/iris?pullRequest=9999

@scitools-ciscitools-ciBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Templating

This PR includes changes that may be worth sharing via templating. For each file listed below, please either:

  • Action the suggestion via a pull request editing/adding the relevant file in the SciTools/.github templates/ directory. 1
  • Raise an issue against the SciTools/.github repo for the above action if you really don't have 10mins spare right now. Include an assignee, to avoid it being forgotten.
  • Dismiss the suggestion if the changes are not suitable for templating.

You will need to dismiss this review before this PR can be merged. Recommend the reviewer does this as their final action before merging, as this text will continually update as commits come in.

Templated files

The following changed files are templated:

Footnotes

  1. Include this text in the PR body to avoid any notifications about applying the template changes back to the source repo!
    @scitools-templating: please no update notification on: iris

@trexfeathers

Copy link
Copy Markdown
ContributorAuthor

Templating

This PR includes changes that may be worth sharing via templating. For each file listed below, please either:

  • Action the suggestion via a pull request editing/adding the relevant file in the SciTools/.github templates/ directory. 1
  • Raise an issue against the SciTools/.github repo for the above action if you really don't have 10mins spare right now. Include an assignee, to avoid it being forgotten.
  • Dismiss the suggestion if the changes are not suitable for templating.

You will need to dismiss this review before this PR can be merged. Recommend the reviewer does this as their final action before merging, as this text will continually update as commits come in.

Templated files

The following changed files are templated:

Footnotes

  1. Include this text in the PR body to avoid any notifications about applying the template changes back to the source repo!
    @scitools-templating: please no update notification on: iris

SciTools/.github#276

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

The workflow’s commit selection should be constrained to the first-parent chain to avoid selecting a non-mainline commit that could expand the benchmark range unexpectedly.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR updates the overnight benchmark GitHub Actions workflow to choose a more stable starting commit when runs are delayed, and records the change in a Towncrier internal changelog fragment.

Changes:

  • Switch overnight benchmark “first commit” selection from a fixed “yesterday at 23:00” cutoff to a “26 hours ago (UTC)” cutoff.
  • Add a changelog fragment documenting the workflow behavior change.
File summaries
FileDescription
changelog/7271.internal.rstDocuments the updated overnight benchmark cutoff logic.
.github/workflows/benchmarks_run.ymlUpdates the shell logic that determines the starting commit for overnight benchmark comparisons.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 2
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines 146 to +150
if [ "$first_commit" == "" ]
# 26 hours to cope with variability in GHA start times.
then
first_commit=$(git log --after="$(date -d "1 day ago" +"%Y-%m-%d") 23:00:00" --pretty=format:"%h" | tail -n 1)
cutoff_utc=$(date -u -d "26 hours ago" +"%Y-%m-%dT%H:%M:%SZ")
first_commit=$(git rev-list --since="$cutoff_utc" --reverse HEAD | head -n 1)
Comment on lines +1 to +4
:user:`trexfeathers` improved robustness of overnight benchmarks in GitHub
Actions - the start commit is the commit 26 hours ago, instead of the commit
24 hours after 23:00 yesterday - this is to cope with variability in GHA start
times. No newline at end of file
@codecov

codecovBot commented Sep 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.35%. Comparing base (253510b) to head (e10642b).

Additional details and impacted files
@@ Coverage Diff @@## main #7271 +/- ##
=======================================
Coverage 90.35% 90.35% =======================================
Files 93 93 Lines 25816 25816 Branches 4796 4796 =======================================
Hits 23327 23327 Misses 1709 1709 Partials 780 780 

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@trexfeathers