Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Structured Change Detection for Mutation Events and Schema Compliance #55

Open
joshuakarp opened this issue Oct 1, 2021 · 4 comments
Open
Assignees
Labels
development Standard development enhancement New feature or request r&d:polykey:core activity 1 Secret Vault Sharing and Secret History Management

Comments

@joshuakarp
Copy link

Specification

Whilst considering vault schemas, it became apparent that it would be extremely beneficial to implement some kind of filesystem event-watching API integrated into the EFS, such that we can track changes before and after they're made directly to the files in the EFS. That is, before and after changes are made to files, we can generate an accumulating list of these changes. Then, we can provide hooks for these pre-edit and post-edit changes.

This would allow us to solve 3 problems in one:

  • enforce the vault schema before a file change is made (i.e. pre-edit vs. having to do a post-edit check)
  • easier automatic commit message generator
  • accurate elimination of dirty commits

The latter 2 problems are currently being solved by a hacky, post-edit solution through recursive scans over the EFS (see the top-level comment from @scottmmorris here).

Additional context

Some further discussion of pre-edit and post-edit from the vaults refactoring MR:

Tasks

  1. ...
  2. ...
  3. ...
@CMCDragonkai
Copy link
Member

CMCDragonkai commented Oct 25, 2021

@scottmmorris can you expand on the relevant items in the vaultsrefactoring MR https://gitlab.com/MatrixAI/Engineering/Polykey/js-polykey/-/merge_requests/205 and why is this issue important.

@joshuakarp
Copy link
Author

joshuakarp commented Dec 3, 2021

There's been some further discussion of this with VaultInternal here https://vimeo.com/manage/videos/652700328

Specifically, we'd be able to significantly reduce the complexity of VaultInternal.commit by implementing this.

Currently, commit performs a recursive search over all files within the vault directory (in the EFS), utilising the iso-git-provided statusMatrix to deduce the changes made. This would be completely unnecessary with the addition of this event-watching API.

It would also allow us to solve MatrixAI/Polykey#260 (single digit modification is not detected by isomorphic-git's status call) because we'd no longer need to rely on the statusMatrix (which is most likely the cause of this "mystery bug").

@CMCDragonkai
Copy link
Member

Interesting usage of git for finding changed files: https://github.com/facebook/jest/tree/main/packages/jest-changed-files.

Relies on shelling out to the git command. Obviously pre-edit and post-edit change events is more efficient, but interesting to compare.

@CMCDragonkai CMCDragonkai changed the title Implement event-watching API for pre-edit file changes Structured Change Detection for Mutation Events and Schema Compliance Jul 16, 2023
@linear linear bot closed this as not planned Won't fix, can't repro, duplicate, stale Nov 18, 2024
@tegefaulkes
Copy link
Contributor

Linear marked this as stale so I'm reopening.

@tegefaulkes tegefaulkes reopened this Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
development Standard development enhancement New feature or request r&d:polykey:core activity 1 Secret Vault Sharing and Secret History Management
Development

No branches or pull requests

4 participants