Page MenuHomePhorge

Allow an infinite number of arcpatch_DXXXX_X branches to be created
Needs ReviewPublic

Authored by ncollins on Nov 12 2021, 20:23.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Oct 2, 21:58
Unknown Object (File)
Sat, Oct 1, 06:35
Unknown Object (File)
Sat, Oct 1, 06:35
Unknown Object (File)
Sat, Oct 1, 04:31
Unknown Object (File)
Fri, Sep 30, 05:38
Unknown Object (File)
Wed, Sep 28, 13:22
Unknown Object (File)
Tue, Sep 20, 15:29
Unknown Object (File)
Tue, Sep 20, 15:29

Details

Reviewers
None
Group Reviewers
O1: Blessed Committers
Summary

WIP

Make arcanist follow the zero one infinity rule

Test Plan

WIP

Diff Detail

Repository
rARC Arcanist
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

Although there's merit to the "zero, one, infinity" rule, it might not be the best option here. If something goes wrong and $err happens to always be falsy, this will end up in an infinite loop instead of giving a clear error message. There is probably a reasonable finite value (that's greater than 4) which can be chosen as the limit to the number of attempts.

src/workflow/ArcanistPatchWorkflow.php
222

Will this result in "{$base_name}_" rather than "{$base_name}" as the first proposed branch name?

235

This can be just $proposed_suffix++.

src/workflow/ArcanistPatchWorkflow.php
221

I think the linter would've requested there to be a space between while and open paren

222

Yea I think this would result in the first non-collision attempt always being suffixed with underscore. The naive approach here would be

if ($proposed_suffix == null) {
  $proposed_name = $base_name;
} else {
  $proposed_name = "{$base_name}_{$proposed_suffix}";
}