Some minor improvements

feat: Do not create project automatically when pushed project does not exist (OD-2199)
fix: [Renovate] some pull request link in dependency dashboard is not rendered (OD-2200)
This commit is contained in:
Robin Shen 2024-12-02 11:30:08 +08:00
parent 85f4fb604a
commit e33f4bac2a
5 changed files with 10 additions and 36 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 357 KiB

View File

@ -24,13 +24,13 @@ Fast code search with regular expression.
![code search and navigation](./doc/images/code-navigation.gif)
## 👮‍ Flexible security and compliance scan
## 📦 Renovate integration to update project dependencies
Scan code dependencies, built binaries, or container images to find security
vulnerabilities, license violations, or secret exposures.
[**Tutorial**] (https://docs.onedev.io/category/security-and-compliance-scan)
Integrate with Renovate to update project dependencies via pull requests.
Merge pull requests automatically when approved by required reviewers, or pass required tests.
[**Tutorial**](https://docs.onedev.io/tutorials/cicd/dependency-update)
![vulnerabilities](./doc/images/vulnerabilities.png)
![vulnerabilities](./doc/images/renovate-integration.png)
## 🚦 Annotate code with coverage and problems

View File

@ -1,6 +1,5 @@
package io.onedev.server.git;
import com.google.common.base.Preconditions;
import io.onedev.commons.utils.ExplicitException;
import io.onedev.k8shelper.KubernetesHelper;
import io.onedev.server.OneDev;
@ -88,16 +87,8 @@ public class GitFilter implements Filter {
}
if (StringUtils.isBlank(projectPath))
throw new ExplicitException("Project not specified");
if (facade == null) {
if (clusterAccess || upload) {
throw new ExplicitException(String.format("Unable to find project '%s'", projectPath));
} else {
Project project = projectManager.setup(projectPath);
Preconditions.checkState(project.isNew());
projectManager.create(project);
facade = project.getFacade();
}
}
if (facade == null)
throw new ExplicitException(String.format("Unable to find project '%s'", projectPath));
return facade.getId();
}

View File

@ -1,6 +1,5 @@
package io.onedev.server.git;
import com.google.common.base.Preconditions;
import io.onedev.commons.utils.ExplicitException;
import io.onedev.commons.utils.StringUtils;
import io.onedev.commons.utils.command.ExecutionResult;
@ -18,7 +17,6 @@ import io.onedev.server.ssh.SshManager;
import io.onedev.server.util.OutputStreamWrapper;
import io.onedev.server.util.concurrent.PrioritizedRunnable;
import io.onedev.server.util.concurrent.WorkExecutor;
import org.apache.shiro.authz.UnauthorizedException;
import org.apache.shiro.util.ThreadContext;
import org.apache.sshd.common.channel.ChannelOutputStream;
import org.apache.sshd.server.Environment;
@ -92,23 +90,8 @@ class SshCommand implements Command, ServerSessionAware {
if (StringUtils.isBlank(projectPath))
throw new ExplicitException("Project not specified");
if (projectFacade == null) {
if (clusterAccess || upload) {
onExit(-1, "Unable to find project '" + projectPath + "'");
return;
} else {
try {
Project project = projectManager.setup(projectPath);
Preconditions.checkState(project.isNew());
projectManager.create(project);
projectFacade = project.getFacade();
} catch (UnauthorizedException e) {
if (e.getMessage() != null)
onExit(-1, e.getMessage());
else
onExit(-1, "Permission denied");
return;
}
}
onExit(-1, "Unable to find project '" + projectPath + "'");
return;
}
ClusterManager clusterManager = OneDev.getInstance(ClusterManager.class);

@ -1 +1 @@
Subproject commit 58346b5544e6337e2d7b8f39c04c5f5c1e38e656
Subproject commit fbcd6451366784fb9612db0e7177f1b408ed7445