SysML-v2-API-Services icon indicating copy to clipboard operation
SysML-v2-API-Services copied to clipboard

referencedCommit and head are null which should not be allowed

Open samatstariongroup opened this issue 2 years ago • 1 comments

From what I can gather from the "Systems Modeling Application Programming Interface (API) and Services" version 1.0, release 2022-11 the property referencedCommit and head (which redefines referencedCommit) of the Branch class are not nullable.

image

When executing the following HTTP request

http://sysml2-sst.intercax.com:9000/projects/8e085296-7e28-4d1d-bbbc-d28beffac3d7/branches

it is apparent that the server returns faulty data.

image

samatstariongroup avatar Jan 11 '23 14:01 samatstariongroup

It could be the other way around, API is correct and diagram is wrong? When you create a new project, a new "main" branch is also created with zero commits on it, so there is no commit to point to. Github works the same way, when you create a new repo/project you will have a default "main" branch with zero commits.

I see 3 solutions:

  1. Keep nullable as implemented
  2. Automatic creation of empty "initialCommit" + "main" branch when creating a new project
  3. Separate endpoint for "initialCommit" that you POST agains project (not branch)

Number 1 mimics GitHub, a known mental model. Number 2 removes the need for nullable head/refCommit, so is maybe the preferred solution.

atlewee avatar May 05 '23 10:05 atlewee