Skip to content

Commit 38a1415

Browse files
committed
v1.0.1
1 parent 03b165b commit 38a1415

File tree

6 files changed

+14
-7
lines changed

6 files changed

+14
-7
lines changed

CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file.
44

55
## [1.0.1] - 2024-09-25
66

7+
### Changed
8+
- TEAM_MANAGER role can run manual scan via GUI and via API
9+
- Enlarged parallel scan pool from 5 to 15
10+
- Provided `pipreqs` to enchance python support for SCA
11+
- It is visible when scan is currently running
12+
13+
714
### Fixed
815
- Performance issues that occurs while having 300+ imported repositories on dashboard and component view
916

backend/src/main/java/io/mixeway/mixewayflowapi/api/coderepo/controller/CodeRepoController.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public ResponseEntity<CodeRepo> getCodeRepo(@PathVariable(name = "id")Long id, P
7171
}
7272
}
7373

74-
@PreAuthorize("hasAuthority('ADMIN')")
74+
@PreAuthorize("hasAuthority('TEAM_MANAGER')")
7575
@GetMapping(value= "/api/v1/coderepo/{id}/run")
7676
public ResponseEntity<StatusDTO> runScan(@PathVariable("id") Long id, Principal principal){
7777
try {

backend/src/main/java/io/mixeway/mixewayflowapi/api/coderepo/service/CodeRepoApiService.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public CodeRepo getRepo(Long id, Principal principal) {
2929
return findCodeRepoService.findById(id, principal);
3030
}
3131

32-
public void runScan(Long id, Principal principal) throws ScanException, IOException, InterruptedException {
32+
public void runScan(Long id, Principal principal) {
3333
CodeRepo repo = findCodeRepoService.findById(id, principal);
3434
if (repo != null){
3535
scanManagerService.scanRepository(repo, repo.getDefaultBranch(),null, null);

backend/src/main/java/io/mixeway/mixewayflowapi/scanmanager/scheduler/ScanScheduler.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public class ScanScheduler {
3636
private final CodeRepoRepository codeRepoRepository;
3737
private final ScanManagerService scanManagerService;
3838
private final SCAService scaService;
39-
private static final int THREAD_POOL_SIZE = 5; // Adjust the pool size as needed
39+
private static final int THREAD_POOL_SIZE = 15; // Adjust the pool size as needed
4040
private final GetCodeRepoInfoService getCodeRepoInfoService;
4141

4242
/**
@@ -54,7 +54,7 @@ public void runAfterStartup() {
5454
* Scheduled task that runs every day at 3 AM.
5555
* This method scans all code repositories concurrently using a fixed thread pool.
5656
*/
57-
@Scheduled(cron = "0 0 3 * * ?")
57+
@Scheduled(cron = "0 0 1 * * ?")
5858
public void runEveryDayAt3AM() {
5959
Iterable<CodeRepo> codeRepos = codeRepoRepository.findAll();
6060
ExecutorService executorService = Executors.newFixedThreadPool(THREAD_POOL_SIZE);

backend/src/main/java/io/mixeway/mixewayflowapi/scanmanager/service/ScanManagerService.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@ public class ScanManagerService {
4242
private final SCAService scaService;
4343
private final GitCommentService gitCommentService;
4444

45-
private final int maxConcurrentScans = 5; // Maximum number of concurrent scans
45+
private final int maxConcurrentScans = 15; // Maximum number of concurrent scans
4646
private final Semaphore semaphore = new Semaphore(maxConcurrentScans); // Limit concurrent scans
4747
private final ConcurrentHashMap<Long, Lock> repoLocks = new ConcurrentHashMap<>(); // Ensure no parallel scans for the same repo
4848

4949
private final ExecutorService executorService = Executors.newFixedThreadPool(8);
50-
private final ExecutorService scanExecutorService = Executors.newFixedThreadPool(10);
50+
private final ExecutorService scanExecutorService = Executors.newFixedThreadPool(15);
5151
private final ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1);
5252

5353
// Counters for tracking parallel scans

frontend/src/app/views/show-repo/show-repo.component.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ <h2 style="margin-bottom: 1rem;"><strong>{{repoData?.name}}</strong> &nbsp;
1818
<!-- Date of Creation -->
1919
<small style="margin-top: 1rem;">Default branch: {{repoData?.defaultBranch.name}}</small>
2020
<small style="margin-top: 1rem;">Created: {{repoData?.insertedDate | date }}</small>
21-
<button *ngIf="!scanRunning && userRole==='ADMIN'" cButton color="info" shape="rounded-pill" style="margin-top:10px;" (click)="runScan()">Run Scan</button>
21+
<button *ngIf="!scanRunning && (userRole==='ADMIN' || userRole==='TEAM_MANAGER')" cButton color="info" shape="rounded-pill" style="margin-top:10px;" (click)="runScan()">Run Scan</button>
2222

2323
<br/>
2424
</div>

0 commit comments

Comments
 (0)