openlawlibrary / taf

The Archive Framework
GNU Affero General Public License v3.0
10 stars 7 forks source link

feat: on repo creation a git hook that validates repo before push #423

Closed ronantakizawa closed 1 month ago

ronantakizawa commented 1 month ago

Description (e.g. "Related to ...", etc.)

When running taf repo create, a git hook that validates the repo before pushing is made. Resolves issue #393

Code review checklist (for code reviewer to complete)

renatav commented 1 month ago

I was using this today and I think that it's also important to provide some feedback that validation is in progress. A lot of our commands automatically commit and push. Because push is using subprocess (subprocess.run(command, **options)), all of the output we get when we run git push through the command line is not visible. Because validation is started from the first commit if there is no last_validated_commit, it can take a while. It would make sense to check if there is a git hook here and log "Validating and pushing"