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

user story #2456007: [Jenkins plugin] unit to runner keep backward compatibility #224

Conversation

mayarfl
Copy link
Collaborator

@mayarfl mayarfl commented Mar 25, 2024

No description provided.

@mayarfl mayarfl requested a review from itayka March 26, 2024 13:06
@@ -32,4 +32,18 @@ public static boolean isUnitToRunnerRelationDefined(EntitiesService entitiesServ
List<Entity> entities = entitiesService.getEntities(workspaceId, "metadata/fields", Arrays.asList(condition1, condition2), Collections.emptyList());
return !entities.isEmpty();
}

public static boolean isNewRunner(EntitiesService entitiesService, Long workspaceId, String runnerId) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

As far as I see, these new 2 methods are used only to check the unit to runner experiment status. So, you can combine them to a single method since it is used in multiple locations.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No, one is experiment and the second should identify if it is an old runner or newly created

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

List<String> fields = new ArrayList<>(Arrays.asList(EntityConstants.MbtUnit.ID_FIELD, EntityConstants.MbtUnit.NAME_FIELD,
EntityConstants.MbtUnit.DESCRIPTION_FIELD, EntityConstants.MbtUnit.REPOSITORY_PATH_FIELD));
if (bUnitToRunner) {
if (unitToRunnerEnabled) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

This a general question and sorry for its length.
What will happen in the following scenario? It is relevant to both plugin and FTE:

  1. A user creates a new MBT test runner (Jenkins or FTE).
  2. Discovery creates all the units in Octane. The units are connected to both the test runner and the scm repository
  3. The user deletes the test runner. As a result, the link to the test runner will be deleted but the units will still be connected to the scm repository
  4. Now the user creates a new test runner with the same repository as before. Will the units be linked to the ew test runner before running the discovery? If not, this flow will not update the test runner link on the old units

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, units will connect to the new runner, as in FTE

@andreibangau99 andreibangau99 merged commit fbf8b2f into master Apr 11, 2024
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