Skip to content

Commit 729dc77

Browse files
mivanov1988gorankokinpre-commit-ci[bot]dependabot[bot]yonitoo
authored
control-service: Add python_version to GraphQL API (#1909)
# Why As part of the initiative to add support for multiple Python versions, we need to extend the GraphQL API to return python_version for each individual execution. # What Added job_python_version column to the data_job_execution table and job_python_version field to all DTOs related to the GraphQL API. # Test done Unit tests. IT test will be added later since the feature for adding support for multiple Python versions is not ready for e2e testing. Signed-off-by: Miroslav Ivanov miroslavi@vmware.com --------- Signed-off-by: Miroslav Ivanov miroslavi@vmware.com Signed-off-by: gorankokin <gorankokin@gmail.com> Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: Yoan Salambashev <ysalambashev@vmware.com> Signed-off-by: Duygu Hasan [hduygu@vmware.com](mailto:hduygu@vmware.com) Signed-off-by: Andon Andonov <andonova@vmware.com> Co-authored-by: github-actions <> Co-authored-by: Goran Kokinovski <gorankokin@gmail.com> Co-authored-by: Goran Kokinovski <gkokinovski@vmware.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Yoan Salambashev <36246462+yonitoo@users.noreply.github.com> Co-authored-by: ivakoleva <ikoleva@vmware.com> Co-authored-by: Duygu Hasan <87015481+duyguHsnHsn@users.noreply.github.com> Co-authored-by: Andy <87700128+doks5@users.noreply.github.com> Co-authored-by: a_git_a <agita.jaunzeme@gmail.com> Co-authored-by: Antoni Ivanov <aivanov@vmware.com>
1 parent f485392 commit 729dc77

File tree

6 files changed

+7
-12
lines changed

6 files changed

+7
-12
lines changed

projects/control-service/projects/pipelines_control_service/src/main/java/com/vmware/taurus/datajobs/ToApiModelConverter.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ public static V2DataJobDeployment toV2DataJobDeployment(
166166
v2DataJobDeployment.setId(jobDeploymentStatus.getCronJobName());
167167
v2DataJobDeployment.setEnabled(jobDeploymentStatus.getEnabled());
168168
v2DataJobDeployment.setJobVersion(jobDeploymentStatus.getGitCommitSha());
169+
v2DataJobDeployment.setJobPythonVersion(jobDeploymentStatus.getPythonVersion());
169170
v2DataJobDeployment.setMode(DataJobMode.fromValue(jobDeploymentStatus.getMode()));
170171
v2DataJobDeployment.setResources(jobDeploymentStatus.getResources());
171172
v2DataJobDeployment.setLastDeployedBy(jobDeploymentStatus.getLastDeployedBy());

projects/control-service/projects/pipelines_control_service/src/main/java/com/vmware/taurus/service/graphql/model/V2DataJobDeployment.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ public class V2DataJobDeployment {
1919
private String id;
2020
private String vdkVersion;
2121
private String jobVersion;
22+
private String jobPythonVersion;
2223
private DataJobMode mode;
2324
private Boolean enabled = true;
2425
private DataJobContacts contacts;

projects/control-service/projects/pipelines_control_service/src/main/resources/schema.graphqls

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ type DataJobExecutionDeployment {
7676
enabled: Boolean
7777
contacts: DataJobContacts
7878
jobVersion: String
79+
jobPythonVersion: String
7980
deployedDate: String
8081
deployedBy: String
8182
mode: String
@@ -104,6 +105,7 @@ type DataJobDeployment {
104105
enabled: Boolean
105106
contacts: DataJobContacts
106107
jobVersion: String
108+
jobPythonVersion: String
107109
lastDeployedDate: String
108110
lastDeployedBy: String
109111
mode: String

projects/control-service/projects/pipelines_control_service/src/test/java/com/vmware/taurus/RepositoryUtil.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ public static DataJobExecution createDataJobExecution(
145145
.lastDeployedBy("test_user")
146146
.lastDeployedDate(getTimeAccurateToMicroSecond())
147147
.jobVersion("test_version")
148+
.jobPythonVersion("3.11")
148149
.jobSchedule("*/5 * * * *")
149150
.opId("test_op_id")
150151
.vdkVersion("test_vdk_version")

projects/control-service/projects/pipelines_control_service/src/test/java/com/vmware/taurus/datajobs/webhook/ToApiModelConverterJobExecutionTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ public void setUp() {
4343
dataJobDeployment.enabled(true);
4444
dataJobDeployment.setDeployedBy("test-user");
4545
dataJobDeployment.setDeployedDate(OffsetDateTime.MAX);
46+
dataJobDeployment.pythonVersion("3.11");
4647

4748
expected = new DataJobExecution();
4849
expected.setDeployment(dataJobDeployment);
@@ -75,6 +76,7 @@ public void setUp() {
7576
toConvert.setResourcesCpuRequest(1.4f);
7677
toConvert.setResourcesMemoryRequest(100);
7778
toConvert.setResourcesMemoryLimit(150);
79+
toConvert.setJobPythonVersion("3.11");
7880
}
7981

8082
@Test

projects/control-service/projects/pipelines_control_service/src/test/java/com/vmware/taurus/service/JobExecutionRepositoryIT.java

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -164,18 +164,6 @@ public void testFindDataJobExecutionsByDataJobName_existingDataJobExecution_shou
164164
Assertions.assertTrue(actualJobExecutions.isEmpty());
165165
}
166166

167-
@Test
168-
public void
169-
testFindDataJobExecutionsByDataJobName_existingDataJobExecution_shouldReturnResult2() {
170-
DataJob actualDataJob = RepositoryUtil.createDataJob(jobsRepository);
171-
172-
String executionId = "test-execution-id";
173-
ExecutionStatus executionStatus = ExecutionStatus.RUNNING;
174-
DataJobExecution expectedJobExecution =
175-
RepositoryUtil.createDataJobExecution(
176-
jobExecutionRepository, executionId, actualDataJob, executionStatus);
177-
}
178-
179167
@Test
180168
void testFindFirstByDataJobNameOrderByStartTimeDesc_withNoExecutions_shouldReturnEmpty() {
181169
DataJob dataJob = RepositoryUtil.createDataJob(jobsRepository);

0 commit comments

Comments
 (0)