From 6dc4cb18e070bfaf17ae2dc9f94e412b0260bf68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alfredo=20Espa=C3=B1a?= Date: Sun, 1 Aug 2021 11:15:16 -0600 Subject: [PATCH 1/2] Rename file endpoint to implementation --- README.md | 2 +- api-client-spring-boot-autoconfigure/pom.xml | 2 +- api-client-spring-boot-starter-sample/pom.xml | 2 +- .../ApiClientStarterSampleApplicationTests.java | 14 +++++++------- api-client-spring-boot-starter/pom.xml | 2 +- api-client/pom.xml | 2 +- .../java/org/azbuilder/api/client/RestClient.java | 10 +++++----- .../{FileData.java => ImplementationData.java} | 2 +- .../provider/version/Relationships.java | 2 +- .../Implementation.java} | 6 +++--- .../ImplementationAttributes.java} | 4 ++-- .../{file => implementation}/Relationships.java | 2 +- .../{file => implementation}/VersionData.java | 2 +- 13 files changed, 26 insertions(+), 26 deletions(-) rename api-client/src/main/java/org/azbuilder/api/client/model/organization/provider/version/{FileData.java => ImplementationData.java} (87%) rename api-client/src/main/java/org/azbuilder/api/client/model/organization/provider/version/{file/File.java => implementation/Implementation.java} (66%) rename api-client/src/main/java/org/azbuilder/api/client/model/organization/provider/version/{file/FileAttributes.java => implementation/ImplementationAttributes.java} (88%) rename api-client/src/main/java/org/azbuilder/api/client/model/organization/provider/version/{file => implementation}/Relationships.java (89%) rename api-client/src/main/java/org/azbuilder/api/client/model/organization/provider/version/{file => implementation}/VersionData.java (91%) diff --git a/README.md b/README.md index c3a8afc..350b152 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,6 @@ Simply add the following dependency to your project's `pom.xml` will enable you org.azbuilder.api.spring.starter api-client-spring-boot-starter - 0.3.1 + 0.4.1 ``` diff --git a/api-client-spring-boot-autoconfigure/pom.xml b/api-client-spring-boot-autoconfigure/pom.xml index d0b1a1d..4f3a0a2 100644 --- a/api-client-spring-boot-autoconfigure/pom.xml +++ b/api-client-spring-boot-autoconfigure/pom.xml @@ -19,7 +19,7 @@ 2.8.6 11.1 4.9.1 - 0.4.0 + 0.4.1 false 1.18.20 diff --git a/api-client-spring-boot-starter-sample/pom.xml b/api-client-spring-boot-starter-sample/pom.xml index bf51d87..4ea2a04 100644 --- a/api-client-spring-boot-starter-sample/pom.xml +++ b/api-client-spring-boot-starter-sample/pom.xml @@ -15,7 +15,7 @@ Demo project for Spring Boot 11 - 0.4.0 + 0.4.1 true diff --git a/api-client-spring-boot-starter-sample/src/test/java/org/azbuilder/api/client/sample/ApiClientStarterSampleApplicationTests.java b/api-client-spring-boot-starter-sample/src/test/java/org/azbuilder/api/client/sample/ApiClientStarterSampleApplicationTests.java index e844e8e..a2115a3 100644 --- a/api-client-spring-boot-starter-sample/src/test/java/org/azbuilder/api/client/sample/ApiClientStarterSampleApplicationTests.java +++ b/api-client-spring-boot-starter-sample/src/test/java/org/azbuilder/api/client/sample/ApiClientStarterSampleApplicationTests.java @@ -2,7 +2,7 @@ import org.azbuilder.api.client.model.organization.Organization; import org.azbuilder.api.client.model.organization.provider.version.Version; -import org.azbuilder.api.client.model.organization.provider.version.file.File; +import org.azbuilder.api.client.model.organization.provider.version.implementation.Implementation; import org.azbuilder.api.client.model.response.Response; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; @@ -63,7 +63,7 @@ void contextLoads() { System.out.println(restClient.getModuleByNameAndProvider(organizationId, "azure","azurerm").getData().get(0).getAttributes().getSource()); */ -/* + /* Response> listResponse = restClient.getOrganizationsByNameAndProvider("sampleOrg","sampleProvider"); @@ -74,14 +74,14 @@ void contextLoads() { restClient.getVersionsByOrganizationIdAndProviderIdAndVersionNumber( listResponse.getData().get(0).getId(), listResponse.getData().get(0).getRelationships().getProvider().getData().get(0).getId(), - "1"); - + "2.0.0"); - Response> files= restClient.getFileByOsArchVersion( + System.out.println(listVersion.getData().get(0).getId()); + Response> files= restClient.getImplementationByOsArchVersion( listResponse.getData().get(0).getId(), listResponse.getData().get(0).getRelationships().getProvider().getData().get(0).getId(), listVersion.getData().get(0).getId(), - "linux", + "darwin", "amd64"); System.out.println(files.getData().get(0).getId()); @@ -89,7 +89,7 @@ void contextLoads() { - System.out.println(restClient.getAllVersionsByProvider(listResponse.getData().get(0).getId(), + System.out.println(restClient.getAllVersionsByProviderWithImplementation(listResponse.getData().get(0).getId(), listResponse.getData().get(0).getRelationships().getProvider().getData().get(0).getId()).getIncluded().size());*/ } diff --git a/api-client-spring-boot-starter/pom.xml b/api-client-spring-boot-starter/pom.xml index a1b20fc..bb7af39 100644 --- a/api-client-spring-boot-starter/pom.xml +++ b/api-client-spring-boot-starter/pom.xml @@ -13,7 +13,7 @@ UTF-8 - 0.4.0 + 0.4.1 false diff --git a/api-client/pom.xml b/api-client/pom.xml index 0e1e372..f008228 100644 --- a/api-client/pom.xml +++ b/api-client/pom.xml @@ -15,7 +15,7 @@ Demo project for Spring Boot 11 - 0.4.0 + 0.4.1 11.1 3.8.0 false diff --git a/api-client/src/main/java/org/azbuilder/api/client/RestClient.java b/api-client/src/main/java/org/azbuilder/api/client/RestClient.java index dcc0077..2c0bfe6 100644 --- a/api-client/src/main/java/org/azbuilder/api/client/RestClient.java +++ b/api-client/src/main/java/org/azbuilder/api/client/RestClient.java @@ -8,7 +8,7 @@ import org.azbuilder.api.client.model.organization.job.JobRequest; import org.azbuilder.api.client.model.organization.module.Module; import org.azbuilder.api.client.model.organization.provider.version.Version; -import org.azbuilder.api.client.model.organization.provider.version.file.File; +import org.azbuilder.api.client.model.organization.provider.version.implementation.Implementation; import org.azbuilder.api.client.model.organization.workspace.Workspace; import org.azbuilder.api.client.model.organization.workspace.environment.Environment; import org.azbuilder.api.client.model.organization.workspace.secret.Secret; @@ -66,13 +66,13 @@ public interface RestClient { @RequestLine("GET /api/v1/organization?filter[organization]=name=={organizationName}&filter[provider]=name=={providerName}") Response> getOrganizationsByNameAndProvider(@Param("organizationName") String organizationName, @Param("providerName") String providerName); - @RequestLine("GET /api/v1/organization/{organizationId}/provider/{providerId}/version?include=file") - ResponseWithInclude, File> getAllVersionsByProviderWithFile(@Param("organizationId") String organizationId, @Param("providerId") String providerId); + @RequestLine("GET /api/v1/organization/{organizationId}/provider/{providerId}/version?include=implementation") + ResponseWithInclude, Implementation> getAllVersionsByProviderWithImplementation(@Param("organizationId") String organizationId, @Param("providerId") String providerId); @RequestLine("GET /api/v1/organization/{organizationId}/provider/{providerId}/version?filter[version]=versionNumber=={versionNumber}") Response> getVersionsByOrganizationIdAndProviderIdAndVersionNumber(@Param("organizationId") String organizationId, @Param("providerId") String providerId, @Param("versionNumber") String versionNumber); - @RequestLine("GET /api/v1/organization/{organizationId}/provider/{providerId}/version/{versionId}/file?filter[file]=os=={os};arch=={arch}") - Response> getFileByOsArchVersion(@Param("organizationId") String organizationId, @Param("providerId") String providerId, @Param("versionId") String versionId, @Param("os") String os, @Param("arch") String arch); + @RequestLine("GET /api/v1/organization/{organizationId}/provider/{providerId}/version/{versionId}/implementation?filter[implementation]=os=={os};arch=={arch}") + Response> getImplementationByOsArchVersion(@Param("organizationId") String organizationId, @Param("providerId") String providerId, @Param("versionId") String versionId, @Param("os") String os, @Param("arch") String arch); } diff --git a/api-client/src/main/java/org/azbuilder/api/client/model/organization/provider/version/FileData.java b/api-client/src/main/java/org/azbuilder/api/client/model/organization/provider/version/ImplementationData.java similarity index 87% rename from api-client/src/main/java/org/azbuilder/api/client/model/organization/provider/version/FileData.java rename to api-client/src/main/java/org/azbuilder/api/client/model/organization/provider/version/ImplementationData.java index 4bded2a..c53edb6 100644 --- a/api-client/src/main/java/org/azbuilder/api/client/model/organization/provider/version/FileData.java +++ b/api-client/src/main/java/org/azbuilder/api/client/model/organization/provider/version/ImplementationData.java @@ -8,6 +8,6 @@ @Getter @Setter -public class FileData { +public class ImplementationData { List data; } diff --git a/api-client/src/main/java/org/azbuilder/api/client/model/organization/provider/version/Relationships.java b/api-client/src/main/java/org/azbuilder/api/client/model/organization/provider/version/Relationships.java index cb653a5..ebbabbc 100644 --- a/api-client/src/main/java/org/azbuilder/api/client/model/organization/provider/version/Relationships.java +++ b/api-client/src/main/java/org/azbuilder/api/client/model/organization/provider/version/Relationships.java @@ -6,6 +6,6 @@ @Getter @Setter public class Relationships { - FileData file; + ImplementationData implementation; ProviderData provider; } diff --git a/api-client/src/main/java/org/azbuilder/api/client/model/organization/provider/version/file/File.java b/api-client/src/main/java/org/azbuilder/api/client/model/organization/provider/version/implementation/Implementation.java similarity index 66% rename from api-client/src/main/java/org/azbuilder/api/client/model/organization/provider/version/file/File.java rename to api-client/src/main/java/org/azbuilder/api/client/model/organization/provider/version/implementation/Implementation.java index b7dbaad..54e3c25 100644 --- a/api-client/src/main/java/org/azbuilder/api/client/model/organization/provider/version/file/File.java +++ b/api-client/src/main/java/org/azbuilder/api/client/model/organization/provider/version/implementation/Implementation.java @@ -1,4 +1,4 @@ -package org.azbuilder.api.client.model.organization.provider.version.file; +package org.azbuilder.api.client.model.organization.provider.version.implementation; import lombok.Getter; import lombok.Setter; @@ -6,7 +6,7 @@ @Getter @Setter -public class File extends Resource { - FileAttributes attributes; +public class Implementation extends Resource { + ImplementationAttributes attributes; Relationships relationships; } diff --git a/api-client/src/main/java/org/azbuilder/api/client/model/organization/provider/version/file/FileAttributes.java b/api-client/src/main/java/org/azbuilder/api/client/model/organization/provider/version/implementation/ImplementationAttributes.java similarity index 88% rename from api-client/src/main/java/org/azbuilder/api/client/model/organization/provider/version/file/FileAttributes.java rename to api-client/src/main/java/org/azbuilder/api/client/model/organization/provider/version/implementation/ImplementationAttributes.java index d006e90..ad80c0e 100644 --- a/api-client/src/main/java/org/azbuilder/api/client/model/organization/provider/version/file/FileAttributes.java +++ b/api-client/src/main/java/org/azbuilder/api/client/model/organization/provider/version/implementation/ImplementationAttributes.java @@ -1,11 +1,11 @@ -package org.azbuilder.api.client.model.organization.provider.version.file; +package org.azbuilder.api.client.model.organization.provider.version.implementation; import lombok.Getter; import lombok.Setter; @Getter @Setter -public class FileAttributes { +public class ImplementationAttributes { private String os; private String arch; private String filename; diff --git a/api-client/src/main/java/org/azbuilder/api/client/model/organization/provider/version/file/Relationships.java b/api-client/src/main/java/org/azbuilder/api/client/model/organization/provider/version/implementation/Relationships.java similarity index 89% rename from api-client/src/main/java/org/azbuilder/api/client/model/organization/provider/version/file/Relationships.java rename to api-client/src/main/java/org/azbuilder/api/client/model/organization/provider/version/implementation/Relationships.java index ce5d8bc..779f8c9 100644 --- a/api-client/src/main/java/org/azbuilder/api/client/model/organization/provider/version/file/Relationships.java +++ b/api-client/src/main/java/org/azbuilder/api/client/model/organization/provider/version/implementation/Relationships.java @@ -1,4 +1,4 @@ -package org.azbuilder.api.client.model.organization.provider.version.file; +package org.azbuilder.api.client.model.organization.provider.version.implementation; import lombok.Getter; import lombok.Setter; diff --git a/api-client/src/main/java/org/azbuilder/api/client/model/organization/provider/version/file/VersionData.java b/api-client/src/main/java/org/azbuilder/api/client/model/organization/provider/version/implementation/VersionData.java similarity index 91% rename from api-client/src/main/java/org/azbuilder/api/client/model/organization/provider/version/file/VersionData.java rename to api-client/src/main/java/org/azbuilder/api/client/model/organization/provider/version/implementation/VersionData.java index 1abaaeb..426f6d6 100644 --- a/api-client/src/main/java/org/azbuilder/api/client/model/organization/provider/version/file/VersionData.java +++ b/api-client/src/main/java/org/azbuilder/api/client/model/organization/provider/version/implementation/VersionData.java @@ -1,4 +1,4 @@ -package org.azbuilder.api.client.model.organization.provider.version.file; +package org.azbuilder.api.client.model.organization.provider.version.implementation; import lombok.Getter; import lombok.Setter; From b86a9099228f911eda4cb73d75afbb13fe091eae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alfredo=20Espa=C3=B1a?= Date: Sun, 1 Aug 2021 11:22:14 -0600 Subject: [PATCH 2/2] Add GitHub actions setup --- .github/workflows/maven-settings.xml | 38 ++++++++++++++++++++++++++++ .github/workflows/pull_request.yml | 23 +++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 .github/workflows/maven-settings.xml create mode 100644 .github/workflows/pull_request.yml diff --git a/.github/workflows/maven-settings.xml b/.github/workflows/maven-settings.xml new file mode 100644 index 0000000..4b85c55 --- /dev/null +++ b/.github/workflows/maven-settings.xml @@ -0,0 +1,38 @@ + + + + github + + + + github + + + central + https://repo1.maven.org/maven2 + + + github + https://maven.pkg.github.com/azbuilder/terraform-spring-boot + + true + + + true + + + + + + + + + github + ${env.USER_NAME} + ${env.ACCESS_TOKEN} + + + + \ No newline at end of file diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml new file mode 100644 index 0000000..6be765f --- /dev/null +++ b/.github/workflows/pull_request.yml @@ -0,0 +1,23 @@ +name: Java CI with Maven + +on: + pull_request: + branches: [ main ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Set up JDK 11 + uses: actions/setup-java@v2 + with: + java-version: '11' + distribution: 'adopt' + - name: Verify with Maven + run: mvn -s $GITHUB_WORKSPACE/.github/workflows/maven-settings.xml -B verify --file pom.xml + env: + USER_NAME: ${{ secrets.USER_NAME }} + ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} \ No newline at end of file