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

SDK-361 and SDK-356 - Update wizard to support custom distributions and more platform and distribution versions #315

Merged
merged 7 commits into from
Nov 26, 2024

Conversation

mseaton
Copy link
Member

@mseaton mseaton commented Nov 26, 2024


String customDistroMessage = "Please specify distribution artifact";
String customDistroDefault = SDKConstants.REFERENCEAPPLICATION_2_4;
Copy link
Member Author

Choose a reason for hiding this comment

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

By adding these to this top-level wizard step, we move the option to specify a custom distribution out from under the RefApp 2.x section and into the top-level section where it belongs. This then allows us to focus the refapp 2.x section on paging through the published versions in Maven

}

return answer;
}
Copy link
Member Author

Choose a reason for hiding this comment

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

This is the main code that now drives the Wizard when one is selecting a platform, 2.x refapp or 3.x refapp version. This downloads all suggested versions and allows paging through all of them, rather than just presenting the most recent 5 or 6 or whatever.

Artifact artifact = new Artifact(REFAPP_3X_ARTIFACT_ID, "3.0.0", REFAPP_3X_GROUP_ID, REFAPP_3X_TYPE);
String version = promptForArtifactVersion("Please choose a " + REFAPP_3X_PROMPT + " version", artifact, null, versionsHelper);
artifact.setVersion(version);
return artifact;
Copy link
Member Author

Choose a reason for hiding this comment

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

Much more straightforward and simplified methods here for prompting for versions, and able to remove the web of other methods below that are no longer used or needed.

if (!version.toString().endsWith("-SNAPSHOT") && optionsMap.size() < MAX_OPTIONS_SIZE) {
optionsMap.put(String.format(optionTemplate, version),
artifact.getGroupId() + ":" + artifact.getArtifactId() + ":" + version);
}
Copy link
Member Author

Choose a reason for hiding this comment

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

This is something that was easier NOT to support in this change, and it didn't seem like something we need anymore now that 3.0.0 has been released. This particular distro artifact was only ever a snapshot/beta/alpha of 3.0.0, so there should not be any need for it anymore. Someone could still choose to install it via the custom distribution option, by specifying the full maven coordinate string, but I don't think we need this sitting in the list of versions in the Wizard, so I removed it.

String dockerMachineIp = dockerHost.substring(beginIndex + 2, endIndex);
return String.format(SDKConstants.URI_MYSQL_DOCKER, dockerMachineIp);
}
}
Copy link
Member Author

Choose a reason for hiding this comment

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

Unrelated, this method wasn't used, so I cleaned it out.

return entry.toFile().isDirectory();
}
})) {
try (DirectoryStream<Path> subDirectories = Files.newDirectoryStream(openMRS, entry -> entry.toFile().isDirectory())) {
Copy link
Member Author

Choose a reason for hiding this comment

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

IDE-suggested code cleanup.

@mseaton mseaton merged commit e46df8c into master Nov 26, 2024
2 checks passed
@mseaton mseaton deleted the SDK-361 branch November 26, 2024 20:18
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.

1 participant