Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is the PHID insufficient?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lando (specifically the revision worker) uses the diff ID (and so do other parts of Lando and moz-phab but those generally rely on the
differential.diff.*
endpoints.) This change removes the need to call the diff endpoints just to fetch the ID.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More specifically, why does the revision worker need the diff ID, surely it can use the PHID? Is there an API endpoint that requires the diff ID and doesn't take the PHID?
r+ anyways cause this is a small change, but it's still unclear why we need two IDs for the same object.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So generally Lando, moz-phab, and even Phabricator expose the diff ID (and also use it in the backend). PHIDs and IDs are generally included in API responses for the particular resource you are requesting, but generally referenced fields show the PHID and not the ID. IDs are integers, PHIDs are long strings.
Using the ID instead of the PHID matches the convention of using the more human readable ID elsewhere today (although we do currently use both in different places). There's no downside that I can think of to using the ID instead of the PHID.
This is part of Phabricator's design. As far as I understand PHIDs are universally unique across databases and tables and are composed of a string, and IDs are what you would expect from a unique integer within a table (e.g. a primary key). I suspect it was part of the original design in order to be able to query any object easily no matter which table or database it is in. It might come down to a matter of preference, but I prefer using the ID.