Sage-Bionetworks / syndccutils

code for managing data coordinating operations through Synapse
7 stars 8 forks source link

Instructions for pre-commit script #119

Closed ahayden closed 4 years ago

ahayden commented 5 years ago

It's simple, but this is probably all we need to do for repos like this... Installing this pre-commit script in this repository will overwrite scripts that people may already be using, but I don't think we'll run into that issue.

jaeddy commented 5 years ago

@ahayden what does this script do? I assume some sort of sanitization to make sure credentials aren't being pushed to GitHub.. but can't tell for sure.

ahayden commented 5 years ago

It runs a regex against the commit to find AWS key ids and secrets. It is matches, it interrupts the commit and informs the user, allows different ways to override, etc.

kelshmo commented 5 years ago

@ahayden there is no mechanism to enforce this to take place on all commits? Instead, the user has to carry the onus of preparing their environment correctly?

ahayden commented 4 years ago

I don't think there's a way to force execution in a commiter's environment, by design. Otherwise people would be owned through git all the time. Each person has to set it up... but for repos connected to CI, like travis, we can force the VM to run pre-commits... so we can make sure some checks like parsing and style fail after.