Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change production protocol to v1_33.0 #2452

Merged
merged 7 commits into from
Nov 10, 2023
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ public class TestSDLCLoader

private static final MockTracer tracer = new MockTracer();

private static final String CLIENT_VERSION = "v1_33_0";

@BeforeClass
public static void setUpClass()
{
Expand Down Expand Up @@ -85,7 +87,7 @@ public void testSdlcLoaderRetriesOnSomeHttpResponses() throws Exception
configureWireMockForRetries();
SDLCLoader sdlcLoader = createSDLCLoader();

PureModelContextData pmcdLoaded = sdlcLoader.load(Lists.fixedSize.empty(), pointer, "v1_32_0", tracer.activeSpan());
PureModelContextData pmcdLoaded = sdlcLoader.load(Lists.fixedSize.empty(), pointer, CLIENT_VERSION, tracer.activeSpan());
Assert.assertNotNull(pmcdLoaded);

Object tries = tracer.finishedSpans()
Expand All @@ -109,7 +111,7 @@ public void testSdlcLoaderDoesNotRetryOnHardFailures() throws Exception

try
{
sdlcLoader.load(Lists.fixedSize.empty(), pointer, "v1_32_0", tracer.activeSpan());
sdlcLoader.load(Lists.fixedSize.empty(), pointer, CLIENT_VERSION, tracer.activeSpan());
Assert.fail("Should throw");
}
catch (EngineException e)
Expand All @@ -131,7 +133,7 @@ public void testSdlcLoaderForWorkspacesWithoutDependency() throws Exception

configureWireMockForRetries();
SDLCLoader sdlcLoader = createSDLCLoader();
PureModelContextData pmcdLoaded = sdlcLoader.load(Lists.fixedSize.empty(), pointer, "v1_32_0", tracer.activeSpan());
PureModelContextData pmcdLoaded = sdlcLoader.load(Lists.fixedSize.empty(), pointer, CLIENT_VERSION, tracer.activeSpan());
Assert.assertNotNull(pmcdLoaded);
Assert.assertEquals(1, pmcdLoaded.getElements().size());
Assert.assertEquals("pkg::pkg::myClass", pmcdLoaded.getElements().get(0).getPath());
Expand All @@ -153,7 +155,7 @@ public void testSdlcLoaderForWorkspacesWithDependency() throws Exception

ModelManager modelManager = new ModelManager(DeploymentMode.TEST, tracer, sdlcLoader);

PureModelContextData pmcdLoaded = modelManager.loadData(pointer, "v1_32_0", Lists.fixedSize.empty());
PureModelContextData pmcdLoaded = modelManager.loadData(pointer, CLIENT_VERSION, Lists.fixedSize.empty());

Assert.assertNotNull(pmcdLoaded);
Assert.assertEquals(2, pmcdLoaded.getElements().size());
Expand Down Expand Up @@ -204,19 +206,19 @@ private static void configureWireMockForRetries() throws JsonProcessingException
PureModelContextData data = PureModelContextData.newPureModelContextData(new Protocol(), new PureModelContextPointer(), Lists.fixedSize.empty());
String pmcdJson = objectMapper.writeValueAsString(data);

WireMock.stubFor(WireMock.get("/alloy/projects/groupId/artifactId/versions/1.0.0/pureModelContextData?clientVersion=v1_32_0")
WireMock.stubFor(WireMock.get("/alloy/projects/groupId/artifactId/versions/1.0.0/pureModelContextData?clientVersion="+CLIENT_VERSION)
.inScenario("RETRY_FAILURES")
.whenScenarioStateIs(Scenario.STARTED)
.willReturn(WireMock.aResponse().withStatus(503).withBody("a failure"))
.willSetStateTo("FAILED_1"));

WireMock.stubFor(WireMock.get("/alloy/projects/groupId/artifactId/versions/1.0.0/pureModelContextData?clientVersion=v1_32_0")
WireMock.stubFor(WireMock.get("/alloy/projects/groupId/artifactId/versions/1.0.0/pureModelContextData?clientVersion="+CLIENT_VERSION)
.inScenario("RETRY_FAILURES")
.whenScenarioStateIs("FAILED_1")
.willReturn(WireMock.aResponse().withStatus(503).withBody("a failure"))
.willSetStateTo("FAILED_2"));

WireMock.stubFor(WireMock.get("/alloy/projects/groupId/artifactId/versions/1.0.0/pureModelContextData?clientVersion=v1_32_0")
WireMock.stubFor(WireMock.get("/alloy/projects/groupId/artifactId/versions/1.0.0/pureModelContextData?clientVersion="+CLIENT_VERSION)
.inScenario("RETRY_FAILURES")
.whenScenarioStateIs("FAILED_2")
.willReturn(WireMock.okJson(pmcdJson))
Expand Down Expand Up @@ -247,13 +249,13 @@ private static void configureWireMockForRetries() throws JsonProcessingException
WireMock.stubFor(WireMock.get("/sdlc/api/projects/proj-1235/workspaces/workspaceAbc/revisions/HEAD/upstreamProjects")
.willReturn(WireMock.okJson("[{\"projectId\": \"org.finos.legend.dependency:models\",\"versionId\": \"2.0.1\"}]")));

WireMock.stubFor(WireMock.get("/alloy/projects/org.finos.legend.dependency/models/versions/2.0.1/pureModelContextData?clientVersion=v1_32_0")
WireMock.stubFor(WireMock.get("/alloy/projects/org.finos.legend.dependency/models/versions/2.0.1/pureModelContextData?clientVersion="+CLIENT_VERSION)
.willReturn(WireMock.okJson(pmcdJsonDep)));
}

private static void configureWireMockForNoRetries() throws JsonProcessingException
{
WireMock.stubFor(WireMock.get("/alloy/projects/groupId/artifactId/versions/1.0.0/pureModelContextData?clientVersion=v1_32_0")
WireMock.stubFor(WireMock.get("/alloy/projects/groupId/artifactId/versions/1.0.0/pureModelContextData?clientVersion="+CLIENT_VERSION)
.willReturn(WireMock.aResponse().withStatus(400).withBody("a failure")));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class PureClientVersions
assert !hasRepeatedVersions(versions) : "Repeated version id :" + versions.toBag().selectByOccurrences(i -> i > 1).toSet().makeString("[", ", ", "]");
}

public static String production = "v1_32_0";
public static String production = "v1_33_0";

static boolean hasRepeatedVersions(ImmutableList<String> versions)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ public class TestProtocolUpdates
public void testProductionProtocolVersion()
{
String productionProtocolVersion = PureClientVersions.production;
Assert.assertEquals("v1_32_0", productionProtocolVersion);
Assert.assertEquals("v1_33_0", productionProtocolVersion);
}
}
Loading