mirror of
https://github.com/fleetdm/fleet
synced 2026-05-23 17:08:53 +00:00
Measure #handbook PR open time (#23124)
Co-authored-by: Eric <eashaw@sailsjs.com>
This commit is contained in:
parent
64ce873e86
commit
95221e5abd
1 changed files with 13 additions and 13 deletions
26
website/scripts/get-bug-and-pr-report.js
vendored
26
website/scripts/get-bug-and-pr-report.js
vendored
|
|
@ -365,22 +365,22 @@ module.exports = {
|
|||
let averageDaysContributorPullRequestsAreOpenFor = Math.round(_.sum(daysSinceContributorPullRequestsWereOpened)/daysSinceContributorPullRequestsWereOpened.length);
|
||||
|
||||
|
||||
// Compute CEO-dependent PR KPIs, which are slightly simpler.
|
||||
// Compute Handbook PR KPIs, which are slightly simpler.
|
||||
// FUTURE: Refactor this to be less messy.
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
let ceoDependentOpenPrs = [];
|
||||
ceoDependentOpenPrs = ceoDependentOpenPrs.concat(allPublicOpenPrs.filter((pr) => !pr.draft && _.pluck(pr.labels, 'name').includes('~ceo')));
|
||||
ceoDependentOpenPrs = ceoDependentOpenPrs.concat(allNonPublicOpenPrs.filter((pr) => !pr.draft && _.pluck(pr.labels, 'name').includes('~ceo')));
|
||||
let handbookOpenPrs = [];
|
||||
handbookOpenPrs = handbookOpenPrs.concat(allPublicOpenPrs.filter((pr) => !pr.draft && _.pluck(pr.labels, 'name').includes('#handbook')));
|
||||
handbookOpenPrs = handbookOpenPrs.concat(allNonPublicOpenPrs.filter((pr) => !pr.draft && _.pluck(pr.labels, 'name').includes('#handbook')));
|
||||
|
||||
let ceoDependentPrsMergedRecently = [];
|
||||
ceoDependentPrsMergedRecently = ceoDependentPrsMergedRecently.concat(publicPrsMergedInThePastThreeWeeks.filter((pr) => !pr.draft && _.pluck(pr.labels, 'name').includes('~ceo')));
|
||||
ceoDependentPrsMergedRecently = ceoDependentPrsMergedRecently.concat(nonPublicPrsClosedInThePastThreeWeeks.filter((pr) => !pr.draft && _.pluck(pr.labels, 'name').includes('~ceo')));
|
||||
let handbookPrsMergedRecently = [];
|
||||
handbookPrsMergedRecently = handbookPrsMergedRecently.concat(publicPrsMergedInThePastThreeWeeks.filter((pr) => !pr.draft && _.pluck(pr.labels, 'name').includes('#handbook')));
|
||||
handbookPrsMergedRecently = handbookPrsMergedRecently.concat(nonPublicPrsClosedInThePastThreeWeeks.filter((pr) => !pr.draft && _.pluck(pr.labels, 'name').includes('#handbook')));
|
||||
|
||||
let ceoDependentPrOpenTime = ceoDependentPrsMergedRecently.reduce((avgDaysOpen, pr)=>{
|
||||
let handbookPrOpenTime = handbookPrsMergedRecently.reduce((avgDaysOpen, pr)=>{
|
||||
let openedAt = new Date(pr.created_at).getTime();
|
||||
let closedAt = new Date(pr.closed_at).getTime();
|
||||
let daysOpen = Math.abs(closedAt - openedAt) / ONE_DAY_IN_MILLISECONDS;
|
||||
avgDaysOpen = avgDaysOpen + (daysOpen / ceoDependentPrsMergedRecently.length);
|
||||
avgDaysOpen = avgDaysOpen + (daysOpen / handbookPrsMergedRecently.length);
|
||||
sails.log.verbose('Processing',pr.head.repo.name,':: #'+pr.number,'open '+daysOpen+' days', 'rolling avg now '+avgDaysOpen);
|
||||
return avgDaysOpen;
|
||||
}, 0);
|
||||
|
|
@ -451,15 +451,15 @@ module.exports = {
|
|||
|
||||
Number of issues with the "#g-mdm", "bug", and "customer-" labels opened in the past week: ${allBugsCreatedInPastWeekMobileDeviceManagementCustomerImpacting.length}
|
||||
|
||||
Number of issues with the "#g-emdm", "bug", and "~released bug" labels opened in the past week: ${allBugsCreatedInPastWeekMobileDeviceManagementReleased.length}
|
||||
Number of issues with the "#g-mdm", "bug", and "~released bug" labels opened in the past week: ${allBugsCreatedInPastWeekMobileDeviceManagementReleased.length}
|
||||
|
||||
Number of issues with the "#g-mdm", "bug", and "~unreleased bug" labels opened in the past week: ${allBugsCreatedInPastWeekMobileDeviceManagementUnreleased.length}
|
||||
|
||||
Pull requests requiring CEO review
|
||||
Handbook Pull requests
|
||||
---------------------------------------
|
||||
Number of open ~ceo pull requests in the fleetdm Github org: ${ceoDependentOpenPrs.length}
|
||||
Number of open #handbook pull requests in the fleetdm Github org: ${handbookOpenPrs.length}
|
||||
|
||||
Average open time (~ceo PRs): ${Math.round(ceoDependentPrOpenTime*100)/100} days.
|
||||
Average open time (#handbook PRs): ${Math.round(handbookPrOpenTime*100)/100} days.
|
||||
`);
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue