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

commit:validate command #906

Open
wants to merge 16 commits into
base: development
Choose a base branch
from

Conversation

matthiaz
Copy link
Contributor

@matthiaz matthiaz commented Feb 14, 2020

We occasionally get customers that destroy their data by renaming a container. It's documented, but it gets missed.

This PR adds a new platform commit:validate method that can check the commit against a few common mistakes that users do.

platform get will now create a pre-commit hook to launch that validate command.
This will protect the user from mistakes, before they push it to us.

Currently, this pre-commit hook warns when it detects:

  • Downgrades of services (mysql, mongodb...) (also warns on upgrades since a downgrade usually follows an upgrade that went bad)
  • Changing the name of an application container (which would destroy mount data)
  • Changing the name of a service container container (which would destroy database data)
  • Committing files larger than 1MB
  • Warns of going over plan disk usage
  • Checks for common mistakes in the build hook that cause stuck builds (e.g npm run serve)

It will not block the commit, you will get asked if you want to continue. And you can also disable each check individually using git config

To stop platform get from creating the hooks, you can do platform get --no-create-hooks (handy for scripts).

image

@matthiaz matthiaz changed the title Pre commit hooks WIP: Pre commit hooks Feb 17, 2020
@matthiaz matthiaz changed the title WIP: Pre commit hooks Pre commit hooks Feb 17, 2020
@matthiaz matthiaz changed the title Pre commit hooks WIP: Pre commit hooks Feb 19, 2020
@matthiaz matthiaz changed the title WIP: Pre commit hooks Pre commit hooks Feb 26, 2020
@matthiaz matthiaz changed the title Pre commit hooks WIP: Pre commit hooks Mar 5, 2020
@matthiaz matthiaz changed the title WIP: Pre commit hooks Pre commit hooks Nov 26, 2020
@matthiaz
Copy link
Contributor Author

@pjcdawkins do you need further input from me on this?
I'm looking back into this and it still has its uses.

@matthiaz matthiaz changed the title Pre commit hooks commit:validate command May 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant