Skip to content

A single digit modification is not detected by isomorphic-git's status call #260

@scottmmorris

Description

@scottmmorris

Describe the bug

When making a change in a file using await vault.commit(...) and changing only a single number on that file will sometimes cause isomorphic-git to not recognise that the file has been modified and therefore if no other changes were made a commit will not be made even though a file was changed.

To Reproduce

  1. Add a file using await vault.commit
      const secretVer1 = {
        name: secretName,
        content: 'Secret-1-content-ver1',
      };
  1. Modify the file using await vault.commit
      const secretVer2 = {
        name: secretName,
        content: 'Secret-1-content-ver2',
      };
  1. Check the log using await vault.log to see if the most recent modification shows up.

NOTE: This won't happen ALL the time. It seems to be most common when running large groups of tests together?

Expected behavior

We expect any file change, even a single digit change to be detected by isomorphic-git and therefore create a new commit when vault.commit is used.

Additional context

  • Most likely related to this issue on isomorphic-git
  • This issue has given a possible workaround by using resetIndex on each file in the vault
  • Discussion about the problem is here
  • This issue created for EFS has the potential to resolve this issue

Resolved

This was addressed by doing the following.

  1. All contents of the vault are added using git.add before processing the statusMatrix. Making sure everything is staged beforehand essentially solves the issue.
  2. Simplified the logic for handling the statusMatrix to a much simpler switch statement.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingr&d:polykey:core activity 1Secret Vault Sharing and Secret History Management

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions