Skip to content

Commit

Permalink
Merge pull request #3493 from mercedes-benz/develop
Browse files Browse the repository at this point in the history
Merge `develop` into `master` for GHA release
  • Loading branch information
haerter-tss authored Oct 8, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
2 parents d21e7c7 + ca23391 commit f56acfb
Showing 134 changed files with 3,816 additions and 650 deletions.
15 changes: 13 additions & 2 deletions github-actions/scan/action.yml
Original file line number Diff line number Diff line change
@@ -136,6 +136,18 @@ runs:
working-directory: ${{ github.workspace }}/sechub/github-actions/scan
shell: bash

# Copy the index.js to the root of the repository
# By doing this any file and folder references inside the scan action will be relative to the root of the repository
# The index.js file will be copied as 'sechub-scan.js' and the 'exec-child.js' file will be copied as 'sechub-exec-child.js'
# This is done to avoid any conflicts with existing 'index.js' & 'exec-child.js' files in the repository
- name: Copy index.js To Root Of Repository
run: |
cp dist/index.js ../../../sechub-scan.js
sed -i 's/exec-child/sechub-exec-child/g' ../../../sechub-scan.js
cp dist/exec-child.js ../../../sechub-exec-child.js
working-directory: ${{ github.workspace }}/sechub/github-actions/scan
shell: bash

- name: Set GitHub Environment Variables
uses: actions/github-script@v7
env:
@@ -147,7 +159,7 @@ runs:
core.exportVariable('ACTIONS_CACHE_URL', process.env['ACTIONS_CACHE_URL'])
- name: Run SecHub Scan
run: node dist/index.js
run: node sechub-scan.js
env:
config-path: ${{ inputs.config-path }}
url: ${{ inputs.url }}
@@ -167,5 +179,4 @@ runs:
ACTIONS_RUNTIME_TOKEN: ${{ env.ACTIONS_RUNTIME_TOKEN }}
ACTIONS_RUNTIME_URL: ${{ env.ACTIONS_RUNTIME_URL }}
ACTIONS_CACHE_URL: ${{ env.ACTIONS_CACHE_URL }}
working-directory: ${{ github.workspace }}/sechub/github-actions/scan
shell: bash
2 changes: 1 addition & 1 deletion gradle/libraries.gradle
Original file line number Diff line number Diff line change
@@ -83,7 +83,7 @@ ext {
httpmime: "4.3.1",

/* Owasp Zap wrapper */
owaspzap_client_api: "1.13.0",
owaspzap_client_api: "1.14.0",
jcommander: "1.82",

thymeleaf_extras_springsecurity5: "3.1.2.RELEASE",
Original file line number Diff line number Diff line change
@@ -65,6 +65,7 @@ protected AdapterExecutionResult execute(PDSAdapterConfig config, AdapterRuntime

assertThreadNotInterrupted();

/* create and configure current PDS context object */
PDSContext pdsContext = contextFactory.create(config, this, runtimeContext);
handleResilienceConfiguration(pdsContext);

Original file line number Diff line number Diff line change
@@ -61,17 +61,21 @@ protected String createAdapterId() {
@Override
public final AdapterExecutionResult start(C config, AdapterMetaDataCallback callback) throws AdapterException {
AdapterRuntimeContext runtimeContext = new AdapterRuntimeContext();
/*
* callback is from product executor and resolves adapter meta data for the
* product result (which is reused on soft restart of job
*/
runtimeContext.callback = callback;
runtimeContext.metaData = callback.getMetaDataOrNull();

if (runtimeContext.metaData == null) {

/* not reused, we need a complete new PDS job */
runtimeContext.metaData = new AdapterMetaData();
runtimeContext.metaData.adapterVersion = getAdapterVersion();
runtimeContext.type = ExecutionType.INITIAL;

} else {

/* reuse existing PDS job means we have a restart */
runtimeContext.type = ExecutionType.RESTART;

}
Original file line number Diff line number Diff line change
@@ -7,13 +7,15 @@
import org.springframework.stereotype.Component;

import com.mercedesbenz.sechub.domain.administration.config.AdministrationConfigService;
import com.mercedesbenz.sechub.sharedkernel.Step;
import com.mercedesbenz.sechub.sharedkernel.messaging.AdministrationConfigMessage;
import com.mercedesbenz.sechub.sharedkernel.messaging.AsynchronMessageHandler;
import com.mercedesbenz.sechub.sharedkernel.messaging.DomainMessage;
import com.mercedesbenz.sechub.sharedkernel.messaging.IsReceivingAsyncMessage;
import com.mercedesbenz.sechub.sharedkernel.messaging.JobMessage;
import com.mercedesbenz.sechub.sharedkernel.messaging.MessageDataKeys;
import com.mercedesbenz.sechub.sharedkernel.messaging.MessageID;
import com.mercedesbenz.sechub.sharedkernel.usecases.other.UseCaseSystemSuspendsJobsWhenSigTermReceived;

@Component
public class JobAdministrationMessageHandler implements AsynchronMessageHandler {
@@ -44,6 +46,9 @@ public void receiveAsyncMessage(DomainMessage request) {
case JOB_FAILED:
handleJobFailed(request);
break;
case JOB_SUSPENDED:
handleJobSuspended(request);
break;
case JOB_CANCELLATION_RUNNING:
handleJobCancellationRunning(request);
break;
@@ -86,4 +91,13 @@ private void handleJobFailed(DomainMessage request) {
deleteService.delete(message.getJobUUID());
}

@IsReceivingAsyncMessage(MessageID.JOB_SUSPENDED)
@UseCaseSystemSuspendsJobsWhenSigTermReceived(@Step(number = 7, name = "Administration handles suspended job", description = "Administration domain removes suspended job from its running job list"))
private void handleJobSuspended(DomainMessage request) {
JobMessage message = request.get(MessageDataKeys.JOB_SUSPENDED_DATA);
// we do drop job info - we only hold running and waiting jobs. The suspended
// job will be restarted and appear later again.
deleteService.delete(message.getJobUUID());
}

}
Original file line number Diff line number Diff line change
@@ -77,6 +77,7 @@ private void updateSchedulerJobInformation(SchedulerMessage status) {
saveStatusEntry(SchedulerStatusEntryKeys.SCHEDULER_JOBS_STARTED, status.getAmountOfJobsStarted());
saveStatusEntry(SchedulerStatusEntryKeys.SCHEDULER_JOBS_CANCEL_REQUESTED, status.getAmountOfJobsCancelRequested());
saveStatusEntry(SchedulerStatusEntryKeys.SCHEDULER_JOBS_CANCELED, status.getAmountOfJobsCanceled());
saveStatusEntry(SchedulerStatusEntryKeys.SCHEDULER_JOBS_SUSPENDED, status.getAmountOfJobsSuspended());
saveStatusEntry(SchedulerStatusEntryKeys.SCHEDULER_JOBS_ENDED, status.getAmountOfJobsEnded());

}
Original file line number Diff line number Diff line change
@@ -18,6 +18,10 @@ public enum SchedulerStatusEntryKeys implements StatusEntryKey {

SCHEDULER_JOBS_CANCEL_REQUESTED("status.scheduler.jobs.cancel_requested"),

SCHEDULER_JOBS_RESUMING("status.scheduler.jobs.resuming"),

SCHEDULER_JOBS_SUSPENDED("status.scheduler.jobs.suspended"),

SCHEDULER_JOBS_ENDED("status.scheduler.jobs.ended"),

;
Loading

0 comments on commit f56acfb

Please sign in to comment.