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

error on git pull #687

Closed
hohwille opened this issue Jan 13, 2022 · 3 comments · Fixed by #773
Closed

error on git pull #687

hohwille opened this issue Jan 13, 2022 · 3 comments · Fixed by #773
Assignees
Labels
enhancement New feature or request

Comments

@hohwille
Copy link
Member

When you create a local feature-branch of your settings and run devon ide setup you will end up in an error like this:

Installing devon autocompletion
There is no tracking information for the current branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.

    git pull <remote> <branch>

If you wish to set tracking information for this branch you can do so with:

    git branch --set-upstream-to=origin/<branch> feature/fix-settings

Failed to run command: git pull -q

******** ATTENTION ********
ERROR: Failed to run command git
We are sorry for the inconvenience. Please check the above errors, resolve them and try again.
Exit code was 1

My observations are:

  1. the end-user does not have a clue what git repo the error is about. Here it is the settings git repo but it could also be the mirrors or a project specific git repo. IMHO end-users will be confused.
  2. this should only raise a warning but not an error preventing the setup to work. The intention should be that an ide admin can test the setup before pushing the new feature-branch with his changes.

Therefore IMHO doGitPullOrClone should be able to detect this scenario (no tracking for current branch) and log a warning instead of triggering a pull ending in an error.

@hohwille hohwille added the enhancement New feature or request label Jan 13, 2022
@hohwille hohwille self-assigned this May 24, 2022
hohwille added a commit to hohwille/ide that referenced this issue May 31, 2022
@hohwille
Copy link
Member Author

hohwille commented May 31, 2022

Test of PR #773:
In case I am on a local branch:

There is no tracking information for the current branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.

    git pull <remote> <branch>

If you wish to set tracking information for this branch you can do so with:

    git branch --set-upstream-to=origin/<branch> local_test_branch

Can not update git repository: /d/projects/devonfw/settings
It seems you are working on a local branch. For testing, you may continue...
Do you want to ignore the problem and continue anyhow?
(yes/no):

In case I am offline:

fatal: unable to access 'https://github.com/devonfw/ide-settings.git/': Could not resolve host: github.com
fatal: unable to access 'https://github.com/devonfw/ide-settings.git/': Could not resolve host: github.com

******** ATTENTION ********
ERROR: Can not update git repository: /d/projects/devonfw/settings
See above error for details - check your network connectivity and retry.
We are sorry for the inconvenience. Please check the above errors, resolve them and try again.

And finally in case I have created a git repo without any remote:

Can not update git repository: /d/projects/devonfw/settings
This is a local git repo with no remote - if you did this for testing, you may continue...
Do you want to ignore the problem and continue anyhow?
(yes/no):

@hohwille hohwille added this to the release:2022.04.002 milestone May 31, 2022
hohwille added a commit to hohwille/ide that referenced this issue May 31, 2022
improve robustness for network issues
@hohwille
Copy link
Member Author

For the record:

  • If you want to do this for local testing and get annoyed by this yes/no question, you can simply add -f for "force" or -b for "batch" mode what will continue automatically entering "yes" for you.
  • I improved doAskToContinue so the message is still printed and the answer is printed as Yes (batch/force) so from the logs one can better identify what was going on.

hohwille added a commit to hohwille/ide that referenced this issue May 31, 2022
thanks to shellcheck, fixed also network error vs. local branch
@hohwille
Copy link
Member Author

hohwille commented Jun 3, 2022

On GHA the change causes tests to fail:

Successfully installed (installation software for) java
To be fully functional please rerun 'devon' command to update your PATH properly.
Starting installation of maven in version 3.8.1 to /home/runner/work/ide/ide/scripts/target/integration-test/test-setup/software/maven
You are not currently on a branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.

    git pull <remote> <branch>

Can not update git repository: /home/runner/work/ide/ide/scripts/target/integration-test/test-setup/mirrors
It seems you are working on a local branch. For testing, you may continue...
Do you want to ignore the problem and continue anyhow?
Error: The operation was canceled.

So for some reason on github he fails to update mirrors git repo and for some yet unknown reason thinks he is on a local branch. He waits for user input what makes the build to fail/timeout.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant