Page MenuHomePhabricator

Add "arc diff --draft"
ClosedPublic

Authored by epriestley on Oct 27 2017, 5:24 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Mar 19, 9:07 PM
Unknown Object (File)
Feb 13 2024, 8:00 AM
Unknown Object (File)
Feb 1 2024, 11:31 PM
Unknown Object (File)
Jan 31 2024, 7:04 AM
Unknown Object (File)
Jan 20 2024, 4:40 PM
Unknown Object (File)
Jan 16 2024, 5:11 PM
Unknown Object (File)
Jan 12 2024, 4:45 PM
Unknown Object (File)
Jan 1 2024, 4:56 PM
Subscribers
None

Details

Summary

Experimental branch. Ref T2543. Depends on D18742.

Add an "arc diff --draft" flag which holds revisions as drafts indefinitely.

Test Plan

Ran "arc diff --draft" when creating; ran "arc diff --draft" to try to update a revision and got a failure.

Diff Detail

Repository
rARC Arcanist
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

amckinley added inline comments.
src/workflow/ArcanistDiffWorkflow.php
593–596

I guess we don't do too much of this in general, and we shouldn't force people to upgrade unless they're actually going to be using --draft, but I wonder if we should ever build an generic versioned API instead of explicitly doing checks like this.

This revision is now accepted and ready to land.Oct 28 2017, 3:35 PM

We had a versioned API at one point and moved away from it (there's still some code in ConduitConnectConduitAPIMethod). Some reasons include:

  • Prototypes, extensions, configuration, and the ability to install/uninstall applications mean that two installs of Phabricator at version X may expose different capabilities via the API.
  • Sometimes we'll add a feature for a third-party, and not use it in arc until some time later. With capability tests, this isn't a problem. With versioning, we'd need to bump the version on every change, or accept that arc will claim that some versions which have the capability (between when it was added, and when the version was bumped) don't have the capability, which is confusing to users.
  • The implementation forced upgrades after checking versions ("you are out of date, upgrade"), and users hated it. An implementation wouldn't have to do this, but if we replace capability tests with version tests and don't force upgrades, we end up with the same code, just if ($version >= $version_with_draft) instead of if ($has_draft_capability), but both blocks are still inline somewhere in the actual code along the execution pathway for the feature.
  • Often, we can navigate API changes transparently (e.g., file.upload uses modern stuff if available and falls back if not).
This revision was automatically updated to reflect the committed changes.