Make WordPress Core

Opened 3 weeks ago

Closed 2 weeks ago

Last modified 2 weeks ago

#62766 closed defect (bug) (fixed)

Build/Test Tools: Fix the date time log for performance tests commit

Reported by: mukesh27's profile mukesh27 Owned by: mukesh27's profile mukesh27
Milestone: 6.8 Priority: normal
Severity: normal Version:
Component: Build/Test Tools Keywords: has-patch
Focuses: performance Cc:

Description

When a commit is made in the WordPress repository, performance data is recorded and displayed on the WordPress dashboard. However, the timestamp value sent with the commit is in an incorrect date format that the dashboard supports, causing it to display the wrong date. This issue needs to be fixed.

Original report: https://github.com/youknowriad/codevitals/issues/31

The WordPress dashboard fetches data through API requests, such as: https://www.codevitals.run/api/evolution/14?limit=10.

However, the API is returning an incorrect measured_at timestamp. For example, the response includes a timestamp like "1970-01-21T01:46:33.000Z", which does not match the actual commit date provided in the corresponding GitHub commit. For ex see: https://github.com/WordPress/wordpress-develop/actions/runs/12383856936/job/34567371506#step:41:23.

Example API Response

  "id": 259315,
  "metric_id": 14,
  "value": 12.7313,
  "raw_value": 15.985,
  "branch": "trunk",
  "measured_at": "1970-01-21T01:46:33.000Z",
  "hash": "f6fb194a0755d82037247916305b51ae70b995d0",
  "project_id": 2

Attachments (1)

commit-date-correct.png (180.2 KB) - added by flixos90 2 weeks ago.
Screenshot of API data showing correct date on latest commit

Download all attachments as: .zip

Change History (12)

This ticket was mentioned in PR #8072 on WordPress/wordpress-develop by @mukesh27.


3 weeks ago
#1

  • Keywords has-patch added; needs-patch removed

#2 @ayeshrajans
3 weeks ago

Changes make sense to me. It's also great that we can get rid of one more GH-Actions job step!

#3 @flixos90
3 weeks ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 59570:

Build/Test Tools: Fix incorrect commit time being reported to WordPress Code Vitals Dashboard.

Props mukesh27, ayeshrajans.
Fixes #62766.

#5 @flixos90
3 weeks ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

I approved this too early 🤦

The workflow failed, see https://github.com/WordPress/wordpress-develop/actions/runs/12585313776/job/35076824568. I think it's because the COMMITTED_AT environment variable is using a Shell script as value, which does not work?

I'll revert the commit for now, so that this doesn't cause subsequent commits to not be sent to the dashboard, which would be worse than sending wrong timestamps.

#6 @flixos90
3 weeks ago

In 59571:

Build/Test Tools: Revert [59570].

The fix did not work properly and is causing performance data for commits to not be sent at all. It is therefore reverted until a proper solution has been implemented.

See #62766.

@flixos90 commented on PR #8072:


3 weeks ago
#7

Reopening because the commit was reverted, see https://core.trac.wordpress.org/ticket/62766#comment:5

I believe we need to reinstate the extra workflow step and run the git command as part of that, then use it as output to pipe it into the COMMITTED_AT environment variable.

@mukesh27 commented on PR #8072:


2 weeks ago
#8

@felixarntz I have set the ENV variable in the previous step ( tested in https://github.com/WordPress/wordpress-develop/pull/8072/commits/07ec67dd92a1869070be3ab8b82a96af6342355e ). Hopefully, this fixes the issue. I'm not entirely sure how to test this locally.

#9 @flixos90
2 weeks ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In 59582:

Build/Test Tools: Fix incorrect commit time being reported to WordPress Code Vitals Dashboard.

2nd attempt of [59570].

Props mukesh27, ayeshrajans, swissspidy, desrosj.
Fixes #62766.

@flixos90
2 weeks ago

Screenshot of API data showing correct date on latest commit

#10 @flixos90
2 weeks ago

I just confirmed that this is now working as expected, see the relevant workflow that passes: https://github.com/WordPress/wordpress-develop/actions/runs/12640532442

You can also inspect the data in the Code Vitals dashboard to verify that the commit data in the API for the latest commit(s) has the correct date attached, per the screenshot above: The last commit is the one that fixed this, and it has the correct measured_at value, in contrast to the previous one(s) with incorrect 1970 dates.

Note: See TracTickets for help on using tickets.