Skip to content

Add needs-review flag param to getArguments#6

Open
kavya-chopra wants to merge 1 commit into
thought-machine:tm-masterfrom
kavya-chopra:add-flag
Open

Add needs-review flag param to getArguments#6
kavya-chopra wants to merge 1 commit into
thought-machine:tm-masterfrom
kavya-chopra:add-flag

Conversation

@kavya-chopra

Copy link
Copy Markdown

No description provided.

@toastwaffle toastwaffle left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR should include some logic using this flag

goddenrich pushed a commit to goddenrich/arcanist that referenced this pull request Jul 8, 2026
Summary:
This previously only worked for more traditional workflows like diff because it
expected `$this->arguments` to be an array. But in modern workflows, it's a
`PhutilArgumentParser` instead.  Since extension workflows might also like to
use the more modern approach and require a clean working copy, it seems like
this ought to be fixed.

Test Plan:
Make a quick and simple custom workflow and try using `$this->requireCleanWorkingCopy()`.

Before:

```
$ arc publish # a new command for my project
[2025-05-30 23:42:32] EXCEPTION: (Error) Cannot use object of type PhutilArgumentParser as array at [<arcanist>/src/workflow/ArcanistWorkflow.php:1009]
arc-thing(), arcanist(head=lfn/master, ref.lfn/master=8691fb3816a0)
  #0 ArcanistWorkflow::shouldRequireCleanUntrackedFiles() called at [<arcanist>/src/workflow/ArcanistWorkflow.php:1122]
  thought-machine#1 ArcanistWorkflow::requireCleanWorkingCopy() called at [<arc-thing>/workflow/MediaThingArcPublishWorkflow.php:80]
  thought-machine#2 MediaThingArcPublishWorkflow::runWorkflow(PhutilArgumentParser) called at [<arcanist>/src/workflow/ArcanistWorkflow.php:227]
  thought-machine#3 ArcanistWorkflow::executeWorkflow(PhutilArgumentParser) called at [<arcanist>/src/toolset/ArcanistPhutilWorkflow.php:21]
  thought-machine#4 ArcanistPhutilWorkflow::execute(PhutilArgumentParser) called at [<arcanist>/src/parser/argument/PhutilArgumentParser.php:493]
  thought-machine#5 PhutilArgumentParser::parseWorkflowsFull(array) called at [<arcanist>/src/runtime/ArcanistRuntime.php:171]
  thought-machine#6 ArcanistRuntime::executeCore(array) called at [<arcanist>/src/runtime/ArcanistRuntime.php:37]
  thought-machine#7 ArcanistRuntime::execute(array) called at [<arcanist>/support/init/init-arcanist.php:6]
  thought-machine#8 require_once(string) called at [<arcanist>/bin/arc:10]
```

After:

```
$ arc publish
... success!
```

Reviewers: O1 Blessed Committers, valerio.bozzolan, aklapper

Reviewed By: O1 Blessed Committers, valerio.bozzolan, aklapper

Subscribers: aklapper, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Differential Revision: https://we.phorge.it/D26041
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants