-
Notifications
You must be signed in to change notification settings - Fork 935
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
Proposal: remove automatic installation of pre-commit hooks on bootstrap #851
Comments
`node scripts/register_git_hook` fails depending on the installed git version because it ends up calling `git rev-parse --git-common-dir`. Depending on the git version, `--git-common-dir` returns the literal string `--git-common-dir` when it is suppose to return $GIT_COMMON_DIR if set and if not $GIT_DIR. Then it proceeds to try to install from a path that doesn't exist because it will use `--git-common-dir` in the path. The goal for this fix is to bypass hard failures in 1.x since I do not believe it is appropriate to fail building something due to git. But I do not want to just remove adding the pre-commit git hook if people are already used to it being installed while bootstrapping. Here, I propose the removal of git hooks on bootstrap in a 2+ version of Dashboards: opensearch-project#851 Issue resolved: opensearch-project#850 Signed-off-by: Kawika Avilla <[email protected]>
`node scripts/register_git_hook` fails depending on the installed git version because it ends up calling `git rev-parse --git-common-dir`. Depending on the git version, `--git-common-dir` returns the literal string `--git-common-dir` when it is suppose to return $GIT_COMMON_DIR if set and $GIT_DIR if the previous is not set. Then it proceeds to try to install from a path that doesn't exist because it will use `--git-common-dir` in the path. The goal for this fix is to bypass hard failures in 1.x since I do not believe it is appropriate to fail building something due to git. But I do not want to just remove adding the pre-commit git hook if people are already used to it being installed while bootstrapping. Here, I propose the removal of git hooks on bootstrap in a 2+ version of Dashboards: opensearch-project#851 Issue resolved: opensearch-project#850 Signed-off-by: Kawika Avilla <[email protected]>
`node scripts/register_git_hook` fails depending on the installed git version because it ends up calling `git rev-parse --git-common-dir`. Depending on the git version, `--git-common-dir` returns the literal string `--git-common-dir` when it is suppose to return $GIT_COMMON_DIR if set and $GIT_DIR if the previous is not set. Then it proceeds to try to install from a path that doesn't exist because it will use `--git-common-dir` in the path. The goal for this fix is to bypass hard failures in 1.x since I do not believe it is appropriate to fail building something due to git. But I do not want to just remove adding the pre-commit git hook if people are already used to it being installed while bootstrapping. Here, I propose the removal of git hooks on bootstrap in a 2+ version of Dashboards: opensearch-project#851 Issue resolved: opensearch-project#850 Signed-off-by: Kawika Avilla <[email protected]>
It is hard to enforce unless it is enforced way to check, if we don't enforce it, we'll have lot PRs not having proper linting. Could you describe the errors and behaviors? Can we modify the script such it can support both version or we just mentioned what version of git is required. |
`node scripts/register_git_hook` fails depending on the installed git version because it ends up calling `git rev-parse --git-common-dir`. Depending on the git version, `--git-common-dir` returns the literal string `--git-common-dir` when it is suppose to return $GIT_COMMON_DIR if set and $GIT_DIR if the previous is not set. Then it proceeds to try to install from a path that doesn't exist because it will use `--git-common-dir` in the path. The goal for this fix is to bypass hard failures in 1.x since I do not believe it is appropriate to fail building something due to git. But I do not want to just remove adding the pre-commit git hook if people are already used to it being installed while bootstrapping. Here, I propose the removal of git hooks on bootstrap in a 2+ version of Dashboards: #851 Issue resolved: #850 Signed-off-by: Kawika Avilla <[email protected]>
`node scripts/register_git_hook` fails depending on the installed git version because it ends up calling `git rev-parse --git-common-dir`. Depending on the git version, `--git-common-dir` returns the literal string `--git-common-dir` when it is suppose to return $GIT_COMMON_DIR if set and $GIT_DIR if the previous is not set. Then it proceeds to try to install from a path that doesn't exist because it will use `--git-common-dir` in the path. The goal for this fix is to bypass hard failures in 1.x since I do not believe it is appropriate to fail building something due to git. But I do not want to just remove adding the pre-commit git hook if people are already used to it being installed while bootstrapping. Here, I propose the removal of git hooks on bootstrap in a 2+ version of Dashboards: opensearch-project#851 Issue resolved: opensearch-project#850 Backport PR: opensearch-project#852 Signed-off-by: Kawika Avilla <[email protected]>
`node scripts/register_git_hook` fails depending on the installed git version because it ends up calling `git rev-parse --git-common-dir`. Depending on the git version, `--git-common-dir` returns the literal string `--git-common-dir` when it is suppose to return $GIT_COMMON_DIR if set and $GIT_DIR if the previous is not set. Then it proceeds to try to install from a path that doesn't exist because it will use `--git-common-dir` in the path. The goal for this fix is to bypass hard failures in 1.x since I do not believe it is appropriate to fail building something due to git. But I do not want to just remove adding the pre-commit git hook if people are already used to it being installed while bootstrapping. Here, I propose the removal of git hooks on bootstrap in a 2+ version of Dashboards: opensearch-project#851 Issue resolved: opensearch-project#850 Backport PR: opensearch-project#852 Signed-off-by: Kawika Avilla <[email protected]>
`node scripts/register_git_hook` fails depending on the installed git version because it ends up calling `git rev-parse --git-common-dir`. Depending on the git version, `--git-common-dir` returns the literal string `--git-common-dir` when it is suppose to return $GIT_COMMON_DIR if set and $GIT_DIR if the previous is not set. Then it proceeds to try to install from a path that doesn't exist because it will use `--git-common-dir` in the path. The goal for this fix is to bypass hard failures in 1.x since I do not believe it is appropriate to fail building something due to git. But I do not want to just remove adding the pre-commit git hook if people are already used to it being installed while bootstrapping. Here, I propose the removal of git hooks on bootstrap in a 2+ version of Dashboards: #851 Issue resolved: #850 Backport PR: #852 Signed-off-by: Kawika Avilla <[email protected]>
`node scripts/register_git_hook` fails depending on the installed git version because it ends up calling `git rev-parse --git-common-dir`. Depending on the git version, `--git-common-dir` returns the literal string `--git-common-dir` when it is suppose to return $GIT_COMMON_DIR if set and $GIT_DIR if the previous is not set. Then it proceeds to try to install from a path that doesn't exist because it will use `--git-common-dir` in the path. The goal for this fix is to bypass hard failures in 1.x since I do not believe it is appropriate to fail building something due to git. But I do not want to just remove adding the pre-commit git hook if people are already used to it being installed while bootstrapping. Here, I propose the removal of git hooks on bootstrap in a 2+ version of Dashboards: #851 Issue resolved: #850 Backport PR: #852 Signed-off-by: Kawika Avilla <[email protected]>
Yeah so I have a work around merged that checks if the literal script for More details here: #850 But it feels a little too hacky. Could we split it out instead of automatically attaching it the bootstrap script and have it in the developer guide. Otherwise potentially we can add a new script and call it while building for a release build. |
Why can't we just enforce the newest git version for developers ? If it is not automated it will be hard for us to maintain and enforce everyone to follow the way. So let's dive deep on see how can we automate, IMO if git version is issue, I am fine putting that as requirement.
IMO, this is too late stage to identify such errors. |
Is your feature request related to a problem? Please describe.
#850, came about because I was trying to bootstrap on an incompatible version of git. The bootstrap script automatically calls the script to install pre-commit git hooks, if the git version is not compatible then it would fail, I have made PR to fail silently on the error that stems from git version here: #852.
Describe the solution you'd like
Pre-commit git hooks shouldn't be a blocker when trying to just build the application. So it should by default not be installed for application. Developers can still call
node scripts/register_git_hook
or we can create another package.json script to call this script. But we should do in this a 2+ version of OpenSearch Dashboards so we don't break current workflows.The text was updated successfully, but these errors were encountered: