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

ide create «settings-url»#«branch» not working #824

Closed
hohwille opened this issue Nov 29, 2024 · 1 comment · Fixed by #828
Closed

ide create «settings-url»#«branch» not working #824

hohwille opened this issue Nov 29, 2024 · 1 comment · Fixed by #828
Labels
bug Something isn't working

Comments

@hohwille
Copy link
Member

Expected behavior

As a IDEasy settings admin, I want to create a IDEasy project specifying a feature branch to my settings git repo so that I can test the changes before developers pull in updates that may break something and block their daily work.

See the feature described in usage.

Actual behavior

$ ide create test-settings-branch https://github.com/devonfw/ide-settings.git#dev-ide-settings
Creating new IDEasy project in D:\projects\test-settings-branch
Start: Clone settings repository
Cloning into '.'...
fatal: unable to update url base from redirection:
  asked for: https://github.com/devonfw/ide-settings.git#dev-ide-settings/info/refs?service=git-upload-pack
   redirect: https://github.com/devonfw/ide-settings
Running command 'C:\Program Files\Git\cmd\git.exe' with arguments 'clone' '--recursive' 'https://github.com/devonfw/ide-settings.git#dev-ide-settings' '--config' 'core.autocrlf=false' '.'
failed with exit code 128!
Git failed to clone https://github.com/devonfw/ide-settings.git#dev-ide-settings into D:\projects\test-settings-branch\settings.
Successfully updated settings repository.
Templates folder is missing in settings repository.
Start: Install or update software
Successfully installed java in version 23.0.1_11
Start: Install mvn
No templates found in settings git repo neither in D:\projects\test-settings-branch\settings\templates nor in D:\projects\test-settings-branch\settings\devon - configuration broken
Successfully installed mvn in version 3.9.9
Artifact already exists at C:\Users\hohwille\Downloads\ide\default\node-v23.3.0-windows-x64.zip
To force update please delete the file and run again.
Checksum 868cd7af6f0c042944c38b1bc1212d608177478da2a141bd404f9366d8fbd2dd is correct.
Unpacking 100% [===============================================================] 33/33MiB (0:00:03 / 0:00:00) 11.3MiB/s
Successfully installed node in version v23.3.0
Start: Install npm
Successfully installed npm in version 10.9.1
Successfully ended step 'Install or update software'.
Cannot find repositories folder nor projects folder.
Successfully created new project 'test-settings-branch'.
Successfully completed ide (create,test-settings-branch,https://github.com/devonfw/ide-settings.git#dev-ide-settings)
$ cd test-settings-branch/
$ ls -la settings/
total 0
drwxr-xr-x 1 hohwille 1049089 0 Nov 29 18:30 ./
drwxr-xr-x 1 hohwille 1049089 0 Nov 29 18:30 ../

Steps to reproduce (bug) / Use Case of feature request (enhancement)

  1. ide create test-settings-branch https://github.com/devonfw/ide-settings.git#dev-ide-settings

Related/Dependent Issues

Comments/Hints:

fatal: unable to update url base from redirection:
  asked for: https://github.com/devonfw/ide-settings.git#dev-ide-settings/info/refs?service=git-upload-pack

It seems as if the feature branch was not properly separated from the URL passed to git.

public void clone(GitUrl gitRepoUrl, Path targetRepository) {
verifyGitInstalled();
GitUrlSyntax gitUrlSyntax = IdeVariables.PREFERRED_GIT_PROTOCOL.get(getContext());
gitRepoUrl = gitUrlSyntax.format(gitRepoUrl);
this.processContext.directory(targetRepository);
ProcessResult result;
if (!this.context.isOffline()) {
this.context.getFileAccess().mkdirs(targetRepository);
this.context.requireOnline("git clone of " + gitRepoUrl.url());
this.processContext.addArg("clone");
if (this.context.isQuietMode()) {
this.processContext.addArg("-q");
}
this.processContext.addArgs("--recursive", gitRepoUrl.url(), "--config", "core.autocrlf=false", ".");
result = this.processContext.run(PROCESS_MODE);
if (!result.isSuccessful()) {
this.context.warning("Git failed to clone {} into {}.", gitRepoUrl.url(), targetRepository);
}
String branch = gitRepoUrl.branch();
if (branch != null) {
this.processContext.addArgs("checkout", branch);
result = this.processContext.run(PROCESS_MODE);
if (!result.isSuccessful()) {
this.context.warning("Git failed to checkout to branch {}", branch);
}
}
} else {
throw CliOfflineException.ofClone(gitRepoUrl.parseUrl(), targetRepository);
}
}

Affected version:

  • 2024.12.001-beta-SNAPSHOT
@hohwille hohwille added the bug Something isn't working label Nov 29, 2024
@github-project-automation github-project-automation bot moved this to 🆕 New in IDEasy board Nov 29, 2024
@hohwille
Copy link
Member Author

Bingo:
image

hohwille added a commit to hohwille/IDEasy that referenced this issue Nov 29, 2024
…URL validations, offline errors, etc.

hack to avoid git mv bug preventing diff to be readable, doing git mv in next commit
hohwille added a commit to hohwille/IDEasy that referenced this issue Nov 29, 2024
hohwille added a commit that referenced this issue Dec 2, 2024
@github-project-automation github-project-automation bot moved this from 🆕 New to ✅ Done in IDEasy board Dec 2, 2024
@hohwille hohwille added this to the release:2024.12.001 milestone Dec 3, 2024
hohwille added a commit that referenced this issue Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

1 participant