feat: add credential manager configuration to the oclif init hook#3786
feat: add credential manager configuration to the oclif init hook#3786jdodson wants to merge 6 commits into
Conversation
…ing git config, and added tests so it stays closed.
…s`, the command shell completion actually runs, so the hook never skipped completion.
erika-wallace
left a comment
There was a problem hiding this comment.
LGTM. I had a few suggestions/questions about the code though.
|
|
||
| const git = new Git() | ||
| try { | ||
| await git.configureCredentialHelper() |
There was a problem hiding this comment.
Should we comment out / temporarily remove the configureCredentialHelper() call in login, apps:create, git:clone, and git:remote since we would be configuring git twice - once in the init hook and again in the actual command?
There was a problem hiding this comment.
@k80bowman What do you think? I don't think so but maybe?
There was a problem hiding this comment.
My thinking is that we keep it because they're the permanent path once the temporary hook is removed at v12.
The idempotency check already makes the duplicate call a no-op. (According to Claude)
There was a problem hiding this comment.
With the check, that makes sense to me
…i_init_hook' into jbd_git_credential_manager_in_cli_init_hook
Summary
In order to ensure that our customers are able to continue working with their existing Heroku projects without interruption, we are going to temporarily add the configuration of the git credential manager to the oclif init hook in the CLI. The plan is to add it now and then remove it potentially as part of the v12 release of the CLI.
What's done:
Type of Change
Breaking Changes (major semver update)
!after your change type to denote a change that breaks current behaviorFeature Additions (minor semver update)
Patch Updates (patch semver update)
Testing
Build first:
This change adds a hook that runs before every CLI command and tells git to use
heroku git:credentialsfor Heroku git operations. The steps below confirm it works, runs everywhere it should, and never breaks a command.First, clear the setting so you can watch the hook add it:
Expected:
!heroku git:credentials--version,-v, theversioncommand,autocomplete, or bareheroku. For each skipped invocation below, clear the setting first, run the command, then check that nothing was added:Expected: nothing printed after any of the
--getchecks (the setting was not added)Expected: the version prints and the command exits normally (no crash, no error from the hook)
Screenshots (if applicable)
Related Issues
GUS work item: https://gus.lightning.force.com/lightning/r/ADM_Work__c/a07EE00002coSPMYA2/view