Skip to content

feat: Enhanced Audit System with Special Operations Tracking#782

Draft
Katerina-Charakhovich wants to merge 2 commits intodevelopmentfrom
feat/Enhanced-Audit-System-with-Special-Operations-Tracking
Draft

feat: Enhanced Audit System with Special Operations Tracking#782
Katerina-Charakhovich wants to merge 2 commits intodevelopmentfrom
feat/Enhanced-Audit-System-with-Special-Operations-Tracking

Conversation

@Katerina-Charakhovich
Copy link
Contributor

Applicable issues

Description of changes

Checklist

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@ai-dial-actions
Copy link
Contributor

Dependency Review

The following issues were found:
  • ✅ 0 vulnerable package(s)
  • ✅ 0 package(s) with incompatible licenses
  • ✅ 0 package(s) with invalid SPDX license definitions
  • ⚠️ 2 package(s) with unknown licenses.
See the Details below.

License Issues

settings.gradle

PackageVersionLicenseIssue Type
com.gradle:common-custom-user-data-gradle-plugin2.1NullUnknown License
com.gradle:develocity-gradle-plugin4.3.1NullUnknown License

OpenSSF Scorecard

PackageVersionScoreDetails
maven/com.gradle:common-custom-user-data-gradle-plugin 2.1 UnknownUnknown
maven/com.gradle:develocity-gradle-plugin 4.3.1 UnknownUnknown

Scanned Files

  • settings.gradle

@Katerina-Charakhovich Katerina-Charakhovich changed the title initial commit feat: Enhanced Audit System with Special Operations Tracking Mar 23, 2026
@ai-dial-actions
Copy link
Contributor

Dependency Review

The following issues were found:
  • ✅ 0 vulnerable package(s)
  • ✅ 0 package(s) with incompatible licenses
  • ✅ 0 package(s) with invalid SPDX license definitions
  • ⚠️ 2 package(s) with unknown licenses.
See the Details below.

License Issues

settings.gradle

PackageVersionLicenseIssue Type
com.gradle:common-custom-user-data-gradle-plugin2.1NullUnknown License
com.gradle:develocity-gradle-plugin4.3.1NullUnknown License

OpenSSF Scorecard

PackageVersionScoreDetails
maven/com.gradle:common-custom-user-data-gradle-plugin 2.1 UnknownUnknown
maven/com.gradle:develocity-gradle-plugin 4.3.1 UnknownUnknown

Scanned Files

  • settings.gradle

AdminSettings,
ImportConfig,
ExportConfig,
ToolResource,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May be ToolSetResource

.build();
}

@Transactional
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is it removed?

resourceId = StringUtils.isNotBlank(resourceId) ? resourceId : entity.getActivityId().toString();
entity.setResourceId(resourceId);
auditActivityJpaRepository.save(entity);
entityManager.flush();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is that needed?

private final EntityManager entityManager;

@Transactional
private UUID startParentOperation(ActivityType activityType,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's specify public method before private ones

}

@Transactional
public void logAuditOperation(ActivityType activityType,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should it be public?

}

@Transactional
public void importConfigTransactional(Config config, ConfigImportOptions importOptions) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should it be public?

@Transactional
public UUID logImportOperation(String scope, ConfigImportOptions importOptions) {
var metaJson = AuditMetaBuilder.with(objectMapper)
.put("scope", scope)
Copy link
Collaborator

@KirylKurnosenka KirylKurnosenka Mar 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Considering that possible values are "core" or "admin" I think it should be "format"/"type" rather than "scope"

String resourceId,
String operationMetadataJson) {
var entity = createAuditEntity(activityType, resourceType, resourceId, operationMetadataJson);
resourceId = StringUtils.isNotBlank(resourceId) ? resourceId : entity.getActivityId().toString();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can resourceId be not null in certain cases?

private final ObjectMapper objectMapper;
private final EntityManager entityManager;

@Transactional
Copy link
Collaborator

@KirylKurnosenka KirylKurnosenka Mar 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Transactional on private method doesn't work

}

@Transactional
public UUID logImportOperation(String scope, ConfigImportOptions importOptions) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think logging of operations like import should not start transaction on their own if transaction doesn't exist, they should just support existing transaction or throw exception if transaction doesn't exist

public StreamingResponseBody exportConfig(ExportRequest request) {
ExportFormat exportFormat = request.getExportFormat();
ExportConfig config = configExporter.getConfig(request);
auditActivityLogService.logConfigExport(request);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since transaction is read only, I think new activity record will not be saved in DB

Export,
ExportRawConfig,
PublicationApprove,
PublicationUpdate,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use existing Create, Update, Delete actions?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[SPIKE] Enhanced Audit System with Special Operations Tracking

3 participants