Page MenuHomePhorge

Allow branch names to be integer values to avoid an InvalidArgumentException
AbandonedPublic

Authored by aklapper on Sep 16 2023, 13:51.

Details

Summary

phutil_nonempty_string() is too strict for branch names, as there seem to be
cases that an integer value is passed. Thus us phutil_nonempty_scalar() instead.

EXCEPTION: (InvalidArgumentException) Call to phutil_nonempty_string() expected null or a string, got: int. at [<arcanist>/src/utils/utils.php:2124]
 arcanist(), ava(), phorge(), translations(), wmf-ext-misc()
   #0 <#2> phutil_nonempty_string(integer) called at [<phorge>/src/applications/repository/storage/PhabricatorRepository.php:749]

Closes T15640

Test Plan

Unknown

Diff Detail

Repository
rP Phorge
Branch
T15640 (branched from master)
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 844
Build 844: arc lint + arc unit

Event Timeline

avivey requested changes to this revision.Sep 17 2023, 07:35
avivey subscribed.

Why would a branch name be an integer and not a string?

Without a test plan / reproduction, these kind of changes could be hiding a real issue.

This revision now requires changes to proceed.Sep 17 2023, 07:35

Abandoning per last comment; guess we should debug a bit more first in downstream to understand the root cause better