Technical details on how to store refs #4

オープン
jcgruenhage2018-06-10 10:35:14 +00:00に作成 · 2件のコメント
オーナー

I think the main question here is whether to prefer one larger state event over a few smaller ones. We could put all the refs into one large state event, or we could have a state event per ref with the ref being the key.

For the latter approach, we would still need to store the list of all refs somewhere, unless I missed some API to list all state keys for a given event type.

If the power level requirement was on the tuple (event_type, state_key) instead of just event_type, splitting it into multiple events would allow for setting different power level requirements per branch, but a quick read through https://matrix.org/docs/spec/client_server/r0.3.0.html#m-room-power-levels implies that this won't work.

I think the main question here is whether to prefer one larger state event over a few smaller ones. We could put all the refs into one large state event, or we could have a state event per ref with the ref being the key. For the latter approach, we would still need to store the list of all refs somewhere, unless I missed some API to list all state keys for a given event type. If the power level requirement was on the tuple (event_type, state_key) instead of just event_type, splitting it into multiple events would allow for setting different power level requirements per branch, but a quick read through https://matrix.org/docs/spec/client_server/r0.3.0.html#m-room-power-levels implies that this won't work.
jcgruenhage がラベル
Bikeshedding
を追加 2018-06-10 10:35:26 +00:00
作成者
オーナー

So basically either we store an state event of the type git.references and an empty state key, with a content like this:

Large state event:

git.references, empty state key

{
  "tags": [
    {
      "name": "v0.1.0",
      "hash": "sha1ofsomegitobject"
    }
  ],
  "heads": [
    {
      "name": "master",
      "hash": "sha1ofsomegitobject"
    }
  ]
}

Smaller per ref state events

git.references, empty state key

{
  "tags": [
    "v0.1.0"
  ],
  "heads": [
    "master"
  ]
}

git.references.tag, state key v0.1.0

"sha1ofsomegitobject"

git.references.head, state key master

"sha1ofsomegitobject"

Performance

I don't know which of those will perform better or worse, maybe homeserver implementers have a better idea here.

So basically either we store an state event of the type `git.references` and an empty state key, with a content like this: ## Large state event: ### `git.references`, empty state key ```json { "tags": [ { "name": "v0.1.0", "hash": "sha1ofsomegitobject" } ], "heads": [ { "name": "master", "hash": "sha1ofsomegitobject" } ] } ``` ## Smaller per ref state events ### `git.references`, empty state key ```json { "tags": [ "v0.1.0" ], "heads": [ "master" ] } ``` ### `git.references.tag`, state key `v0.1.0` ```json "sha1ofsomegitobject" ``` ### `git.references.head`, state key `master` ```json "sha1ofsomegitobject" ``` ## Performance I don't know which of those will perform better or worse, maybe homeserver implementers have a better idea here.
作成者
オーナー

So I currently prefer the smaller events, most of all because that means that we can merge people pushing to different branches on different servers at the same time. If multiple people push to the same branch at the same time, we'll definitely loose all pushes except one.

So I currently prefer the smaller events, most of all because that means that we can merge people pushing to different branches on different servers at the same time. If multiple people push to the same branch at the same time, we'll definitely loose all pushes except one.
サインインしてこの会話に参加。
ラベルなし
Bikeshedding
マイルストーンなし
担当者なし
1 人の参加者
通知
期日
期日が正しくないか範囲を超えています。 'yyyy-mm-dd' の形式で入力してください。

期日は未設定です。

依存関係

依存関係が設定されていません。

リファレンス: jcgruenhage/git-on-matrix#4
説明はありません。