Issue fork drupalorg-3248567

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

drumm created an issue. See original summary.

drumm’s picture

Assigned: Unassigned » drumm

  • drumm committed 3ebf5e9 on 7.x-3.x
    Issue #3248567: Set GitLab repositories to squash merge by default
    
drumm’s picture

The commit above has been deployed and will set this setting for new projects. Over the weekend a bulk update is running to update existing projects. Once that’s complete:

  • Set up integrity checks to verify all projects have the setting
  • Remove the lines of code referenced in the issue summary
drumm’s picture

Code used for the bulk update:

$project_api = versioncontrol_gitlab_get_client()->api('projects');
$result = (new EntityFieldQuery())->entityCondition('entity_type', 'node')
->entityCondition('bundle', project_project_node_types())
->execute();
foreach (array_keys($result['node']) as $nid) {
  $repository = versioncontrol_project_repository_load($nid);
  print $repository->name . PHP_EOL;
  $project_api->update($repository->gitlab_project_id, ['squash_option' => 'default_on']);
}

  • drumm committed 36a64df on 7.x-3.x
    Issue #3248567: Setting squash option on merge request opening is no...

  • drumm committed 635398d on 7.x-3.x
    Issue #3248567: Squash merge by default is needed on fork repositories,...
  • drumm committed bf7e899 on 7.x-3.x
    Revert "Issue #3248567: Setting squash option on merge request opening...
drumm’s picture

We needed to update every issue fork project too:

$project_api = versioncontrol_gitlab_get_client()->api('projects');
$result = (new EntityFieldQuery())->entityCondition('entity_type', 'drupalorg_issue_fork')->execute();
foreach (array_keys($result['drupalorg_issue_fork']) as $gitlab_project_id) {
  print '.';
  $project_api->update($gitlab_project_id, ['squash_option' => 'default_on']);
}

  • drumm committed 557dfa1 on 7.x-3.x
    Issue #3248567: Setting squash option on merge request opening is no...

  • drumm committed 0d2f462 on 7.x-3.x
    Issue #3248567: Explicitly set squash option when www.drupal.org opens...
drumm’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.