Skip to content

Commit

Permalink
control-service: fix read deployment job version
Browse files Browse the repository at this point in the history
Why
The Read Deployment API returns incorrect data.

What
Changed the job version to point to git commit sha instead of deployment
version.

Signed-off-by: Miroslav Ivanov miroslavi@vmware.com
  • Loading branch information
mivanov1988 committed Oct 23, 2023
1 parent e2e1a01 commit c362471
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ private static void mergeDeploymentResources(
public static DataJobDeploymentStatus toJobDeploymentStatus(
ActualDataJobDeployment actualDataJobDeployment, DataJob job) {
var deploymentStatus = new DataJobDeploymentStatus();
deploymentStatus.setJobVersion(actualDataJobDeployment.getDeploymentVersionSha());
deploymentStatus.setJobVersion(actualDataJobDeployment.getGitCommitSha());
deploymentStatus.setPythonVersion(actualDataJobDeployment.getPythonVersion());
deploymentStatus.setId(actualDataJobDeployment.getDataJobName());
deploymentStatus.setEnabled(actualDataJobDeployment.getEnabled());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public void testToJobDeploymentStatus() {
var deployment = createActualJobDeployment(job);
var status = DeploymentModelConverter.toJobDeploymentStatus(deployment, job);

Assertions.assertEquals("test-sha", status.getJobVersion());
Assertions.assertEquals("test-commit-sha", status.getJobVersion());
Assertions.assertEquals("3.9-secure", status.getPythonVersion());
Assertions.assertEquals("name", status.getId());
Assertions.assertEquals(true, status.getEnabled());
Expand Down Expand Up @@ -53,13 +53,13 @@ private DataJob createTestJob(String jobName, String teamName) {

private ActualDataJobDeployment createActualJobDeployment(DataJob dataJob) {
var deployment = new ActualDataJobDeployment();
deployment.setGitCommitSha("actualSha");
deployment.setGitCommitSha("test-commit-sha");
deployment.setDataJobName(dataJob.getName());
deployment.setPythonVersion("3.9-secure");
deployment.setEnabled(true);
deployment.setLastDeployedBy("user");
deployment.setSchedule("sched");
deployment.setDeploymentVersionSha("test-sha");
deployment.setDeploymentVersionSha("test-deployment-sha");
deployment.setLastDeployedDate(OffsetDateTime.MIN);
var resources = new DataJobDeploymentResources();
resources.setMemoryLimitMi(1);
Expand Down

0 comments on commit c362471

Please sign in to comment.