Skip to content

Commit

Permalink
Merge pull request #37 from lazara3/master
Browse files Browse the repository at this point in the history
defect #1177010: [GitLab] can't parsing an empty project without file…
  • Loading branch information
lazara3 authored Mar 10, 2021
2 parents d361c46 + a6ed1f1 commit f529899
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 5 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,14 @@ However, password encryption is optional. You can enter the password plain value

## Troubleshooting

### Multi-Branch

If you create a pipeline with one branch, and then add branches, ALM Octane will not reflect this change.
In this case, delete the original pipeline and create a new one for the multibranch plan.
### Can not see the project in the job list of Octane

The project must contain files and not be empty. Make sure there is at least one branch in your GitLab project.

### GitLab WebHooks

If you can run the pipeline from Octane but cannot see progress and results:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public boolean isUserHasPermissionForProject(Project project) {
if (currentMember.isPresent() && currentMember.get().getAccessLevel().value >= AccessLevel.MAINTAINER.value) {
return true;
} else {
log.info(currentUser.getName() + "doesnt have enough permission for project " + project.getPath());
log.info(currentUser.getName() + " doesnt have enough permission for project " + project.getPath());
return false;
}
} catch (GitLabApiException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,15 @@ public int getId() {
}

public String getCurrentBranchOrDefault() {
return currentBranch == null ? getBranches().get(0).getName() : currentBranch;
if(currentBranch!= null)
return currentBranch;

if(getBranches().size()>0){
return getBranches().get(0).getName();
}else{
throw new ArrayIndexOutOfBoundsException ("there is not branches for this project, the project is empty:"+this.displayName);
}

}

public String getCurrentBranch() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,9 @@ public CIProxyConfiguration getProxyConfiguration(URL targetUrl) {
try {
CIProxyConfiguration result = null;
if (ProxyHelper.isProxyNeeded(applicationSettings, targetUrl)) {
if(log.isDebugEnabled()){
log.debug("proxy is required for host " + targetUrl);
}

log.debug("proxy is required for host " + targetUrl);

ConfigStructure config = applicationSettings.getConfig();
String protocol = targetUrl.getProtocol();
URL proxyUrl = new URL(config.getProxyField(protocol, "proxyUrl"));
Expand Down

0 comments on commit f529899

Please sign in to comment.