zeus icon indicating copy to clipboard operation
zeus copied to clipboard

Change Requests

Open dcramer opened this issue 8 years ago • 7 comments

Let's rethink patches, and create a native concept for "Change Requests". These will power a few things:

  • Pull Requests (GitHub) and status checks
  • Diffs (Phabricator)

They'll become a top level concern, where effectively builds become either associated with a Change Request or a Commit (unrelated to "why" its being built).

dcramer avatar Dec 07 '17 18:12 dcramer

(i had already started on some work on this, so will continue that)

dcramer avatar Dec 07 '17 18:12 dcramer

Might be worth rethinking the complexity of source with this..

The way its designed is good to be able to just abstracting view any 'source' and all associated data, but really the questions we want to ask are:

  • give me details for this commit
  • give me details for this pull request
  • give me details for this specific build

If we keep source, it likely needs to look like:

Build -> Source -> {Revision, ChangeRequest, ...}

That likely means source should change to use a 'source object type' and 'source object id' construct. The tricky bit is revision's dont have a GUID associated with them, but we could fix that. Alternatively we'd have to make 'source object id' be an abstract string field, which isn't great.

dcramer avatar Dec 07 '17 20:12 dcramer

Ok going Source -> ChangeRequest, as a PR/CR can have many sources over time and we'd want to track them uniformly.

dcramer avatar Dec 11 '17 04:12 dcramer

Still working on this.

Plan right now is:

  • You upsert a ChangeRequest
  • You upsert a source on a ChangeRequest (though we need to figure out how we approach this yet, for now we'll likely just use the 'latest source' to handle force push situations)
  • CR's are automatically associated given sources

The open questions are:

  • Should a change request have a full commit range? It does on GitHub, and to support GitHub and full diffs we'd want that
  • How do we handle the case when a CR is just a patch with a parent revision?

dcramer avatar Jan 15 '18 00:01 dcramer

Branch is feat/change-requests

dcramer avatar Jan 15 '18 00:01 dcramer

Decided on adding a 'head_revision' field (in addition to 'parent_revision') to ChangeRequest.

dcramer avatar Jan 15 '18 21:01 dcramer

gonna rm -rf the Source relation for now as we dont need it and I dont want to add the complexity until it has a good reason

for now you can just upsert the change request with head/parent commit, and when we support patch builds we'll implement it everywhere

dcramer avatar Jan 15 '18 21:01 dcramer