Skip to content

Make cross config resolver version and content aware - #1958

Open
vkalapov wants to merge 1 commit into
masterfrom
cross-mta-race-condition-fix
Open

vkalapov wants to merge 1 commit into
masterfrom
cross-mta-race-condition-fix

Conversation

@vkalapov

Copy link
Copy Markdown
Contributor

No description provided.

@vkalapov
vkalapov force-pushed the cross-mta-race-condition-fix branch 3 times, most recently from f7be185 to 77ed097 Compare November 11, 2026 12:46
@vkalapov
vkalapov force-pushed the cross-mta-race-condition-fix branch from 77ed097 to 1eddf49 Compare November 11, 2026 12:52
@sonarqubecloud

Copy link
Copy Markdown

@vkalapov
vkalapov marked this pull request as ready for review November 12, 2026 07:35
// Identity of a configuration entry's provided dependency, ignoring version
private record ProviderIdentity(String nid, String id, String namespace, String targetOrg, String targetSpace) {
static ProviderIdentity from(ConfigurationEntry entry) {
CloudTarget target = entry.getTargetSpace() == null ? new CloudTarget() : entry.getTargetSpace();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Shouldn't we keep them null?

private record ProviderIdentity(String nid, String id, String namespace, String targetOrg, String targetSpace) {
static ProviderIdentity from(ConfigurationEntry entry) {
CloudTarget target = entry.getTargetSpace() == null ? new CloudTarget() : entry.getTargetSpace();
return new ProviderIdentity(entry.getProviderNid(), entry.getProviderId(), entry.getProviderNamespace(),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

There are more fields which are missing here - cloudTargets, spaceId and contentId . Should we also include them into comparison?

Comment on lines +23 to +28
private static ConfigurationEntry entry(String version, String namespace, CloudTarget target, String content) {
return new ConfigurationEntry(NID, PID, version == null ? null : Version.parseVersion(version), namespace, target, content,
List.of(), "space-guid", null);
}

private static ConfigurationEntry entry(String version, String content) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Use method names with verb in them.

ConfigurationEntry newer = entry("1.0.0-20261110083334", "{\"url\":\"new\"}");
List<ConfigurationEntry> result = resolver.reduceRedundantEntries(List.of(older, newer));
assertEquals(1, result.size());
assertSame(newer, result.getFirst());

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why assertSame was used instead of assertEquals?

This branch has not been deployed

No deployments
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.

3 participants