ionic-team / ionic-team/ionic-cli
Ionic doctor check trying to fix GIT repo origin that is actually working
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 2k
- Forks
- 681
- PR merge metrics
- No merged PRs in 30d
Description
Description:
$ ionic doctor check is telling me my GIT config is wrong, but it's not true:
$ ionic doctor check
✔ Detecting issues: 16 / 16 complete - done!
Detected 2 issues.
[WARN] App linked to 57d1... with invalid git configuration.
This app is linked to an app on Ionic (57d1...), but the git configuration is not valid. To fix, the following
step(s) need to be taken:
1) Run: ionic git remote
This is because I'm using SSH key aliases for my hosts. I work with projects from different companies and Bitbucket doesn't allow the same SSH key for different accounts. This is my ~/.ssh/config:
Host company1
HostName bitbucket.org
IdentityFile ~/.ssh/company1
Host company2
HostName bitbucket.org
IdentityFile ~/.ssh/company2
Host company1.ionic
HostName git.ionicjs.com
IdentityFile ~/.ssh/company1
Port 22
Host company2.ionic
HostName git.ionicjs.com
IdentityFile ~/.ssh/company2
Port 22
And this is my project's .git/config:
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[remote "origin"]
url = git@company1:company1/bla.git
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
merge = refs/heads/master
[remote "ionic"]
url = git@company1.ionic:myname/bla.git
fetch = +refs/heads/*:refs/remotes/ionic/*
Of course I could use my personal SSH key for both projects in Ionic's repo (like ~/.ssh/id_rsa.pub or just create a new one), but I want my work projects worlds to be sepparated among them and from my personal projects (yet in other account).
I bet other Bitbucket users are going through the same, since this is the recommended method from them.
Origin of the issue: https://bitbucket.org/site/master/issues/5154/someone-has-already-registered-that-ssh
Bitbucket's proposed solution (I can't find it now but it was also in Confluence's official docs): https://developer.atlassian.com/blog/2016/04/different-ssh-keys-multiple-bitbucket-accounts/
My ionic info:
$ ionic info
cli packages: (/home/shamank/.nvm/versions/node/v8.2.1/lib/node_modules)
@ionic/cli-utils : 1.15.0
ionic (Ionic CLI) : 3.15.0
global packages:
cordova (Cordova CLI) : 7.1.0
local packages:
@ionic/app-scripts : 3.0.1
Cordova Platforms : android 6.2.3 browser 5.0.1 ios 4.4.0
Ionic Framework : ionic-angular 3.7.1
System:
Android SDK Tools : 26.1.1
Node : v8.2.1
npm : 4.6.1
OS : Linux 3.19
Environment Variables:
ANDROID_HOME : /home/shamank/Android/Sdk
Misc:
backend : pro
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the ionic doctor check command and the .git/config example in the issue, then locate the validation of the ionic remote and how SSH host aliases are handled. Reproduce the warning with an aliased host such as company1.ionic; done means a working aliased remote is not reported as invalid while genuinely incorrect configuration is still detected.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- git, typescript
- Domain
- cli, devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100