Skip to content

Conversation

@camrrx
Copy link
Member

@camrrx camrrx commented Nov 18, 2025

Proposed changes

  • Ingestion json connectors file
  • Display catalog page

Testing Instructions

  1. Go on catalog page
  2. You should have access to all the connectors

Related issues

Checklist

  • I consider the submitted work as finished
  • I tested the code for its functionality
  • I wrote test cases for the relevant uses case
  • I added/update the relevant documentation (either on github or on notion)
  • Where necessary I refactored code to improve the overall quality
  • For bug fix -> I implemented a test that covers the bug

Further comments

If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...

@camrrx camrrx force-pushed the issue/4311-implement-catalog branch from 904924e to 59a39d5 Compare November 18, 2025 15:28
@savacano28 savacano28 changed the title [backend] Catalog connector ingestion data [backend] feat(catalog): add catalog connector ingestion data (#4311) Nov 19, 2025
@camrrx camrrx changed the title [backend] feat(catalog): add catalog connector ingestion data (#4311) [backend/frontend] feat(catalog): add catalog connector ingestion data (#4311) Nov 24, 2025
@camrrx camrrx force-pushed the issue/4311-implement-catalog branch 2 times, most recently from a7dc269 to 4dbcc90 Compare November 25, 2025 10:25
@camrrx camrrx force-pushed the issue/4311-implement-catalog branch from 4081880 to 4625d5e Compare November 27, 2025 09:49
@camrrx camrrx marked this pull request as ready for review November 27, 2025 09:51
return fileName;
} catch (Exception e) {
log.error("Error upload image MinIO", e);
return "img/icon-connector-default.png";
Copy link
Member Author

Choose a reason for hiding this comment

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

We don't have default image yet

@camrrx camrrx requested a review from MarineLeM November 27, 2025 15:05
@camrrx camrrx force-pushed the issue/4311-implement-catalog branch from 6d54eab to e5608a5 Compare December 3, 2025 10:57
Comment on lines 21 to 44
@Slf4j
@Service
@Transactional
public class CatalogConnectorIngestionService {
private static final Set<String> PROTECTED_KEYS = Set.of(
"COLLECTOR_ID",
"INJECTOR_ID",
"EXECUTOR_ID"
);
private final CatalogConnectorService catalogConnectorService;
private final FileService fileService;
private final ConnectorInstanceService connectorInstanceService;
private final ConnectorInstanceConfigurationRepository connectorInstanceConfigurationRepository;

public CatalogConnectorIngestionService(
CatalogConnectorService catalogConnectorService,
FileService fileService,
ConnectorInstanceService connectorInstanceService,
ConnectorInstanceConfigurationRepository connectorInstanceConfigurationRepository) {
this.catalogConnectorService = catalogConnectorService;
this.fileService = fileService;
this.connectorInstanceService = connectorInstanceService;
this.connectorInstanceConfigurationRepository = connectorInstanceConfigurationRepository;
}
Copy link
Member

Choose a reason for hiding this comment

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

Suggestion: to keep source code cleaner (or more "magical"), Lombok provides class annotations to hide constructors such as this one which only assigns instance fields.

@RequiredArgsConstructor on the class allows you to delete this constructor (Lombok will autogenerate it).

Suggested change
@Slf4j
@Service
@Transactional
public class CatalogConnectorIngestionService {
private static final Set<String> PROTECTED_KEYS = Set.of(
"COLLECTOR_ID",
"INJECTOR_ID",
"EXECUTOR_ID"
);
private final CatalogConnectorService catalogConnectorService;
private final FileService fileService;
private final ConnectorInstanceService connectorInstanceService;
private final ConnectorInstanceConfigurationRepository connectorInstanceConfigurationRepository;
public CatalogConnectorIngestionService(
CatalogConnectorService catalogConnectorService,
FileService fileService,
ConnectorInstanceService connectorInstanceService,
ConnectorInstanceConfigurationRepository connectorInstanceConfigurationRepository) {
this.catalogConnectorService = catalogConnectorService;
this.fileService = fileService;
this.connectorInstanceService = connectorInstanceService;
this.connectorInstanceConfigurationRepository = connectorInstanceConfigurationRepository;
}
@Slf4j
@Service
@Transactional
@RequiredArgsConstructor
public class CatalogConnectorIngestionService {
private static final Set<String> PROTECTED_KEYS = Set.of(
"COLLECTOR_ID",
"INJECTOR_ID",
"EXECUTOR_ID"
);
private final CatalogConnectorService catalogConnectorService;
private final FileService fileService;
private final ConnectorInstanceService connectorInstanceService;
private final ConnectorInstanceConfigurationRepository connectorInstanceConfigurationRepository;

Comment on lines 54 to 57
for (JsonNode contract : contracts) {
CatalogConnector catalogConnector = buildCatalogConnector(contract);
catalogConnectorList.add(catalogConnector);
}
Copy link
Member

Choose a reason for hiding this comment

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

Note: no error handling here. A lot of things can go wrong in deserialisation situations, so are we prepared for an all-or-nothing ingestion (because the process is transactional) ?
I'm asking because functionally, what are we expecting to see if there is, for example, a single contract throwing an error?

Copy link
Member Author

Choose a reason for hiding this comment

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

To confirm with @jborozco !

byte[] imageBytes = Base64.getDecoder().decode(base64Data);
InputStream dataStream = new ByteArrayInputStream(imageBytes);

String fileName = connectorSlug + "-logo.png";
Copy link
Member

Choose a reason for hiding this comment

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

it seems like this would have the potential for collisions, but not terribly dangerous apart if we accidentally upload the same path elsewhere in the codebase.

Suggestion: using the DB-generated ID for the persisted catalog connector object as one of the filename fragments.

This would have you remove the use of .saveAll(List<CatalogConnector>) in favour of a loop with .save(CatalogConnector) in extractCatalog; but that's OK because we are already within a transaction scope (the overhead of using a loop+save is to create a new transaction scope for each iteration)

@Override
@Transactional
public <S extends T> List<S> saveAll(Iterable<S> entities) {

	Assert.notNull(entities, ENTITIES_MUST_NOT_BE_NULL);

	List<S> result = new ArrayList<>();

	for (S entity : entities) {
		result.add(save(entity));
	}

	return result;
}

Copy link
Member Author

Choose a reason for hiding this comment

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

Good suggestion, as discuss we'll not do it now.

List<CatalogConnector> saved = catalogConnectorService.saveAll(catalogConnectorList);

for (CatalogConnector connector : saved) {
cleanupInstanceConfigurations(connector);
Copy link
Member

Choose a reason for hiding this comment

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

good thinking

Comment on lines 163 to 168
// Configuration changed to "PASSWORD" format but the stored value is not encrypted:
// - schemaConf exists
// - format is PASSWORD
// - must be deleted for security
boolean mustDeleteBecausePassword =
schemaConf != null && isFormastPasswordButNotEncrypted(schemaConf, instConf);
Copy link
Member

Choose a reason for hiding this comment

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

It looks like we should make an effort to encrypt the currently plaintext value with the known XTM Composer public key instead of nuking the config line altogether. What are your thoughts?

Copy link
Member Author

Choose a reason for hiding this comment

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

Todo : another PR when the method to encrypt will be merged


CatalogConnector connector = ingestion.buildCatalogConnector(contract);

assertThat(connector.getContainerType()).isNull();
Copy link
Member

Choose a reason for hiding this comment

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

Is this correct? This looks like this could cause issues down the line. What are the impacts of this occurrence?

Copy link
Member Author

Choose a reason for hiding this comment

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

We keep it like this as discussed

Comment on lines 262 to 271
// required
boolean isRequired = false;
if (required != null && required.isArray()) {
for (JsonNode req : required) {
if (req.asText().equals(key)) {
isRequired = true;
break;
}
}
}
Copy link
Member

Choose a reason for hiding this comment

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

should we be concerned that perhaps there is an entry in [required] that doesn't match any listed properties? Thoughts?

Note this would meant the contract is malformed. Consider adding some logging.

@camrrx camrrx force-pushed the issue/4311-implement-catalog branch from cb3305c to c9f9b17 Compare December 8, 2025 15:04
@codecov
Copy link

codecov bot commented Dec 9, 2025

Codecov Report

❌ Patch coverage is 51.32743% with 110 lines in your changes missing coverage. Please review.
✅ Project coverage is 50.89%. Comparing base (267049f) to head (4f4f5c4).
⚠️ Report is 1 commits behind head on release/current.

Files with missing lines Patch % Lines
...g_connectors/CatalogConnectorIngestionService.java 63.09% 42 Missing and 20 partials ⚠️
...o/openaev/utils/mapper/CatalogConnectorMapper.java 6.66% 14 Missing ⚠️
...ev/rest/catalog_connector/CatalogConnectorApi.java 0.00% 11 Missing ⚠️
...penaev/runner/CatalogConnectorIngestionRunner.java 0.00% 11 Missing ⚠️
...-api/src/main/java/io/openaev/utils/TimeUtils.java 0.00% 6 Missing ⚠️
...ce/catalog_connectors/CatalogConnectorService.java 33.33% 4 Missing ⚠️
...tor_instance/service/ConnectorInstanceService.java 33.33% 2 Missing ⚠️
Additional details and impacted files
@@                 Coverage Diff                 @@
##             release/current    #4379    +/-   ##
===================================================
  Coverage              50.89%   50.89%            
- Complexity              3762     3785    +23     
===================================================
  Files                    914      919     +5     
  Lines                  27396    27621   +225     
  Branches                2059     2098    +39     
===================================================
+ Hits                   13942    14058   +116     
- Misses                 12608    12697    +89     
- Partials                 846      866    +20     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@camrrx camrrx merged commit 90d2f18 into release/current Dec 9, 2025
12 checks passed
@camrrx camrrx deleted the issue/4311-implement-catalog branch December 9, 2025 16:44
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.

4 participants