robertwb commented on code in PR #24825:
URL: https://github.com/apache/beam/pull/24825#discussion_r1059167074
##########
sdks/typescript/src/apache_beam/utils/service.ts:
##########
@@ -326,14 +330,37 @@ export class JavaJarService extends SubprocessService {
}
}
- static mavenJarUrl(
+ static async mavenJarUrl(
artifactId: string,
version: string,
classifier: string | undefined = undefined,
appendix: string | undefined = undefined,
repo: string = JavaJarService.APACHE_REPOSITORY,
groupId: string = JavaJarService.BEAM_GROUP_ID
- ): string {
+ ): Promise<string> {
+ if (version == "latest") {
+ const medatadataUrl = [
+ repo,
+ groupId.replaceAll(".", "/"),
+ artifactId,
+ "maven-metadata.xml",
+ ].join("/");
+ const metadata = await new Promise<string>((resolve, reject) => {
+ let data = "";
+ https.get(medatadataUrl, (res) => {
+ res.on("data", (chunk) => {
+ data += chunk;
+ });
+ res.on("end", () => {
+ resolve(data);
+ });
+ res.on("error", (e) => {
+ reject(e);
+ });
+ });
+ });
Review Comment:
I'm going to avoid taking on another dependency right now, but that's good
to keep in mind if we end up needing to make these kinds of calls more often.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]