MatrixAI / Polykey

Polykey Core Library - Open Source Decentralized Secret Sharing System for Zero Trust Delegation of Authority
https://polykey.com
GNU General Public License v3.0
27 stars 4 forks source link

Inconsistent vault log when pulling secrets from a modified vault (received vault log is different) - should use fast forward merge #714

Closed aryanjassal closed 1 week ago

aryanjassal commented 3 weeks ago

Describe the bug

When I pull the changes from a modified vault on my local system, the log on both machines were different, while they should be identical.

cmcdragonkai ➜ matrix-framework-13-ryzen-7040  ➜ ~/Projects/Polykey-CLI
 $ ./dist/polykey.js vaults log myvault
commitId     6641db528e0e79412898425a3ea84e349aa5c82b
committer    vcj3ufun2506jn44q7rr9bc1hv4c6eebicusfj1bl9sr27ookknlg
timestamp    Fri May 03 2024 19:53:49 GMT+1000 (Australian Eastern Standard Time)
message      "abc modified\n"
commitId     4e648a16325ebedd0847473ec04f02a0891b1be1
committer    vcj3ufun2506jn44q7rr9bc1hv4c6eebicusfj1bl9sr27ookknlg
timestamp    Fri May 03 2024 19:45:41 GMT+1000 (Australian Eastern Standard Time)
message      "abc modified\n"
commitId     c987ff12719344b962e9586aa25b7a28bb328bc8
committer    vcj3ufun2506jn44q7rr9bc1hv4c6eebicusfj1bl9sr27ookknlg
timestamp    Fri May 03 2024 19:45:13 GMT+1000 (Australian Eastern Standard Time)
message      "abc added\n"
commitId     88e97c3937ac2ee86595918d5ef136b9b92d0da0
committer    vcj3ufun2506jn44q7rr9bc1hv4c6eebicusfj1bl9sr27ookknlg
timestamp    Fri May 03 2024 19:44:02 GMT+1000 (Australian Eastern Standard Time)
message      "Initial Commit\n"
aryanj@supercomputer ❯ ./pk vaults log myvault                                                       
commitId        aa08262fd12acc954561093cd1d4784cf772d588
committer       vcj3ufun2506jn44q7rr9bc1hv4c6eebicusfj1bl9sr27ookknlg
timestamp       Fri May 03 2024 19:54:14 GMT+1000 (Australian Eastern Standard Time)
message         "Merge branch \'HEAD\' of http://\n"
commitId        6641db528e0e79412898425a3ea84e349aa5c82b
committer       vcj3ufun2506jn44q7rr9bc1hv4c6eebicusfj1bl9sr27ookknlg
timestamp       Fri May 03 2024 19:53:49 GMT+1000 (Australian Eastern Standard Time)
message         "abc modified\n"
commitId        dd0d131b9997c74cabfe7202e68d3044fe59a5de
committer       vet1dhoduhkmn4749r8usiopivklr8i4qoh9kjnhtgeg5rie4nvh0
timestamp       Fri May 03 2024 19:48:42 GMT+1000 (Australian Eastern Standard Time)
message         "Initial Commit\n"
commitId        4e648a16325ebedd0847473ec04f02a0891b1be1
committer       vcj3ufun2506jn44q7rr9bc1hv4c6eebicusfj1bl9sr27ookknlg
timestamp       Fri May 03 2024 19:45:41 GMT+1000 (Australian Eastern Standard Time)
message         "abc modified\n"
commitId        c987ff12719344b962e9586aa25b7a28bb328bc8
committer       vcj3ufun2506jn44q7rr9bc1hv4c6eebicusfj1bl9sr27ookknlg
timestamp       Fri May 03 2024 19:45:13 GMT+1000 (Australian Eastern Standard Time)
message         "abc added\n"
commitId        88e97c3937ac2ee86595918d5ef136b9b92d0da0
committer       vcj3ufun2506jn44q7rr9bc1hv4c6eebicusfj1bl9sr27ookknlg
timestamp       Fri May 03 2024 19:44:02 GMT+1000 (Australian Eastern Standard Time)
message         "Initial Commit\n"

To Reproduce

  1. Add a secret to a vault
  2. Share the vault
  3. Modify the secret in the vault
  4. Pull changes for the log
  5. Observe different logs

Expected behavior

The logs should be identical for any and all instances of the vault, irrelevant of the vault pulling new changes or not.

Screenshots

Platform (please complete the following information)

Additional context

image

This is a bug with the vault log - pull system. Needs to be fast forward merge. _Originally posted by @CMCDragonkai in https://github.com/MatrixAI/Polykey/issues/709#issuecomment-2095014382_

Notify maintainers

Resolved

This was adressed by doing the following.

  1. When calling git.clone and git.pull I made sure to target the canonicalBranch ref name. This really was all that was needed to make sure that the history was correct.
  2. I also enabled the fastForward and fastForwardOnly flags for git.pull to ensure only linear history was pulled from the remote.
linear[bot] commented 3 weeks ago

ENG-306 Inconsistent local log when pulling secrets from a modified vault

CMCDragonkai commented 3 weeks ago

Maybe this can snuck into #709 if it is due to the git domain issue.

CMCDragonkai commented 1 week ago

Would this only be completed if you've also pushed this up to Polykey-CLI? I don't think a new version is updated yet? @brian.botha

tegefaulkes commented 1 week ago

That is true, I'm going to do a new release now.

tegefaulkes commented 6 days ago

This needs to be retested manually to be sure that the fix is been addressed

CMCDragonkai commented 6 days ago

Should new issues be created in PK-CLI for such integration/acceptance testing? It's not enough to be done on the PK library - you may do it with @CryptoTotalWar.

tegefaulkes commented 5 days ago

I'd say for things like this, this issue shouldn't be closed until confirmed manually in the CLI after a release.