Skip to content
Snippets Groups Projects

Show old & new organization rank components side-by-side for verification

In drupalorg.module - ensure 'data' is always an array so foreach doesn’t need an if (!empty()) wrapper.

Refactors summing & weighting credit by project into a function.

Logs credit from the old and new system, so we can gain confidence in the new calculations, and ensure everything is working.

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
    • Author Maintainer
      Resolved by Neil Drumm

      In testing this I got quite a few timeouts, so not merging until we make sure the exception handling is thorough enough

      WD drupalorg: [Contribution Records] Could not get data from https://new.drupal.org/contribution-records-by-organization?organization=040lab&months=12. Message: Server error: `GET              [error]
      https://new.drupal.org/contribution-records-by-organization?organization=040lab&months=12` resulted in a `503 first byte timeout` response:

      For marketplace, I think it makes sense to retry 2-3 times with a delay. Since it is a cron, being slow is fine. And want some delay so we're not just stacking requests on the new site. If there is still no data, continue to the next organization so it isn't zero'd out or anything destructive.

      (The rest of the frontend will want to try only once and then show a "temporarily unavailable" message.)

      The new site probably still has the 15s default timeout in Fastly. We can raise that, and it'll be good for this ranking cron. For frontend requests, if new.drupal.org takes most of the 30s, then the legacy response won't have much space to complete. Maybe those should set a Guzzle timeout for 20s, or 10s if there is more than one on a single page.

  • Neil Drumm requested review from @fjgarlin

    requested review from @fjgarlin

  • Neil Drumm added 1 commit

    added 1 commit

    • 55762e6c - Restore & improve $updated logic

    Compare with previous version

  • Neil Drumm resolved all threads

    resolved all threads

  • Neil Drumm added 5 commits

    added 5 commits

    Compare with previous version

  • merged

  • 666 $wrapper->field_weighted_org_issue_cred_yr = $new_value;
    670 667 $updated = TRUE;
    671 668 }
    672 $wrapper->field_weighted_org_issue_cred_yr = $weights['issue credit'] * $year_issue_credit_weighted;
    673 669
    674 670 // Security advisory credit, weighted by project usage, last 12 months.
    675 $sa_year_issue_credit_weighted = 0;
    676 if (!empty($interval_credits_data['data'])) {
    677 foreach ($interval_credits_data['data'] as $project_nid => $info) {
    678 if (!isset($usage_weights[$project_nid])) {
    679 $usage_weights[$project_nid] = _drupalorg_weight_project($project_nid);
    680 }
    681 $sa_year_issue_credit_weighted += ( $usage_weights[$project_nid] * count($info['security_advisories']) );
    682 }
    671 $new_value = $weights['security advisory credit'] * _drupalorg_weight_credit($interval_credits_data['data'], 'security_advisories');
    672 if ($wrapper->field_drupalorg_rank_components[11] = $new_value) {
    Please register or sign in to reply
    Loading