-
Notifications
You must be signed in to change notification settings - Fork 324
Add Domains V3 resource to CloudFoundryClient #1030
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
Conversation
|
|
|
Hi @twoseat, do you have any feedbacks or concern on this PR? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! Everything looks really good apart from the breaking change noted and a few minor formatting things (I think I caught all the instances of these, hence there are a lot of comments but nothing major to change).
It would be enormously helpful to me if you could add in Integration Tests. I understand that you almost certainly won't be able to run them, which means there will almost certainly be problems with them. But just having the structure there makes it easier to get through the merge, so I won't judge you on any mistakes!
| import org.cloudfoundry.client.v2.blobstores.Blobstores; | ||
| import org.cloudfoundry.client.v2.buildpacks.Buildpacks; | ||
| import org.cloudfoundry.client.v2.domains.Domains; | ||
| import org.cloudfoundry.client.v2.domains.DomainsV2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a breaking change - ideally we would have thought ahead and called it DomainsV2 from the beginning, but we are where we are, so this needs to remain unchanged. Introducing DomainsV3 and ReactorDomainsV3 is fine, even if it looks a little inconsistent.
| import org.cloudfoundry.reactor.client.v2.blobstores.ReactorBlobstores; | ||
| import org.cloudfoundry.reactor.client.v2.buildpacks.ReactorBuildpacks; | ||
| import org.cloudfoundry.reactor.client.v2.domains.ReactorDomains; | ||
| import org.cloudfoundry.reactor.client.v2.domains.ReactorDomainsV2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Breaking change (see above)
| public Domains domains() { | ||
| return new ReactorDomains(getConnectionContext(), getRootV2(), getTokenProvider(), getRequestTags()); | ||
| public DomainsV2 domainsV2() { | ||
| return new ReactorDomainsV2(getConnectionContext(), getRootV2(), getTokenProvider(), getRequestTags()); | ||
| } | ||
|
|
||
| @Override | ||
| @Value.Derived | ||
| public DomainsV3 domainsV3() { | ||
| return new ReactorDomainsV3(getConnectionContext(), getRootV3(), getTokenProvider(), getRequestTags()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Breaking change (see above)
| import org.cloudfoundry.client.v2.domains.DeleteDomainRequest; | ||
| import org.cloudfoundry.client.v2.domains.DeleteDomainResponse; | ||
| import org.cloudfoundry.client.v2.domains.Domains; | ||
| import org.cloudfoundry.client.v2.domains.DomainsV2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Breaking change (see above)
|
|
||
| /** | ||
| * The Reactor-based implementation of {@link Domains} | ||
| * The Reactor-based implementation of {@link DomainsV2} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Breaking change (see above)
| * @param request the List Organization Domains request | ||
| * @return the response from the List Organization Domains request | ||
| */ | ||
| Mono<ListOrganizationDomainsResponse> listDomains(ListOrganizationDomainsRequest request); //TODO needs tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it still need tests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch! I added test but forgot to remove the TODO 😅
| /** | ||
| * The organization id | ||
| */ | ||
| @JsonIgnore | ||
| abstract String getOrganizationId(); | ||
|
|
||
| /** | ||
| * The domain ids to filter by | ||
| */ | ||
| @FilterParameter("guids") | ||
| @Nullable | ||
| abstract List<String> getDomainIds(); | ||
|
|
||
| /** | ||
| * The names | ||
| */ | ||
| @FilterParameter("names") | ||
| @Nullable | ||
| abstract List<String> getNames(); | ||
|
|
||
| /** | ||
| * The owning organization ids | ||
| */ | ||
| @FilterParameter("organization_guids") | ||
| @Nullable | ||
| abstract List<String> getOwningOrganizationIds(); | ||
|
|
||
| /** | ||
| * The metadata query | ||
| */ | ||
| @FilterParameter("label_selector") | ||
| @Nullable | ||
| abstract String getLabelSelector(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alphabetical order
| import org.cloudfoundry.client.v2.applications.ApplicationsV2; | ||
| import org.cloudfoundry.client.v2.buildpacks.Buildpacks; | ||
| import org.cloudfoundry.client.v2.domains.Domains; | ||
| import org.cloudfoundry.client.v2.domains.DomainsV2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Breaking change (see above)
| protected final CloudFoundryClient cloudFoundryClient = mock(CloudFoundryClient.class, RETURNS_SMART_NULLS); | ||
|
|
||
| protected final Domains domains = mock(Domains.class, RETURNS_SMART_NULLS); | ||
| protected final DomainsV2 domainsV2 = mock(DomainsV2.class, RETURNS_SMART_NULLS); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Breaking change (see above)
| when(this.cloudFoundryClient.applicationsV3()).thenReturn(this.applicationsV3); | ||
| when(this.cloudFoundryClient.buildpacks()).thenReturn(this.buildpacks); | ||
| when(this.cloudFoundryClient.domains()).thenReturn(this.domains); | ||
| when(this.cloudFoundryClient.domainsV2()).thenReturn(this.domainsV2); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Breaking change (see above)
955d12f to
9403974
Compare
9403974 to
7382122
Compare
3cf55d0 to
9a011a4
Compare
|
@twoseat Thanks for your thorough review! I believe I have addressed all the comments you left and made sure no I also added integration tests, but I may need some help with getting one of them to pass - |
|
Thanks for the updates @LittleBaiBai - I'm working on it now, and have found what I guess is your domains issue (there's an undocumented |

[#1008]