Skip to content

Jimbo4350/audit

Repository files navigation

audit - dependency tree tracker

This package tracks the dependency tree of a given repository.

Run the following command:

`stack exec -- audit-exe --audit audit`

This does the following

  1. Creates currentDepTree.dot & currentDepTreeVersions.txt. The file currentDepTree.dot captures the current state of the dependency tree for the repository (generated by the stack dot command); currentDepTreeVersions.txt (generated by the stack ls dependencies command) contains versions of all the dependencies in the repository.
  2. Creates an sqlite db with three tables: auditor, hash and diff.
  3. Populates the auditor table with the dependencies and versions from currentDepTree.dot & currentDepTreeVersions.txt respectively.
  4. Creates a hash using currentDepTree.dot & currentDepTreeVersions.txt and inserts it into the hash table.

NB: The diff table is empty because this table only holds changes to the dependency tree.

From this point running stack exec -- audit-exe --audit audit will generate repoinfo/updatedDepTree.dot, repoinfo/updatedDepTreeVersions.txt and a hash using these two files. The newly generated hash is compared to the hash in the hash table. If the hashes differ then the dependency tree has changed (a dependency has been added/removed or a dependency version has changed).

General usage

After the initial stack exec -- audit-exe --audit audit command, running the command again will "audit" your current dependency tree and print any changes to the terminal.

NB: These changes will only be made permanent when you run stack exec -- audit-exe --audit load. Running this command inserts the dependency tree changes from the diff table into the auditor table and then deletes all the enteries in the diff table.

The auditor table can be thought of as the permanent/historical dependency tree. The diff table can be though of as a temporary updated dependency tree which can only be made permanent by running the load command. The hash table stores a hash of the permanent/historial dependency tree and is a convenient way of checking if there have been any changes.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published