This project is for recompiling a protections table, to remove redundancy. It is supplied as a sort of proof of concept at the moment. Do NOT use for any enterprise application. But if you are looking at how to solve this problem, here is how I did it. It really needs some heavy refactoring to get rid of the procedural style of things that has crept into the design. RUNNING p4re-prot.rb under the ./lib directory will take the config options from ./lib/configuration/config.rb (only really uses checkpoint value, the others are inteded for validation). re-prot-setup.rb does the some ina less messy fashion, the odd code style was for the messy tests that were quickly thrown up around the code. HOW DOES IT WORK? We create a tree structure in memory, that mimics the directory tree of the perforce server. For each node of the tree, we add the access level each user/group has at that path. For the re-compilation, we traverse the tree and look for duplicates and redundancy (though some is removed earlier), removing these from the tree. We then output the tree that is left as a protections table. WHERE ARE MY SPECS? The test specs are also not provided, because they were badly written, and not really helping prove anything. They require a re-write, though re-writing the tests would highlight the refactoring that needs to take place, a feat I don't currently have time for. VALIDATION In terms of validation, it is a problem that i didn't get round to before losing my perforce license, and therefore ability to create reasonable test cases. To test the output protections table in a truely meaningful way, the only method I could come up with is to fire up two instances of the perforce server one with the old protections, one with the new; then for each user/group find the protection level for each known directory/file on both servers and compare. Heavy handed; but to be sure that the protections are the same they MUST be tested using the actual Perforce Server binary.
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 8235 | Brett Bates |
Adding my protections re-compilation project. README explains the current status of the project. |