NIFI-15148 - Registry Clients - Support for branch creation#10471
Open
pvillard31 wants to merge 4 commits intoapache:mainfrom
Open
NIFI-15148 - Registry Clients - Support for branch creation#10471pvillard31 wants to merge 4 commits intoapache:mainfrom
pvillard31 wants to merge 4 commits intoapache:mainfrom
Conversation
dce8ef2 to
c3d55fc
Compare
Contributor
exceptionfactory
left a comment
There was a problem hiding this comment.
Thanks for implementing this new feature @pvillard31.
I reviewed the service changes and the majority of the implementation looks good. I noted a few minor recommendations.
...ifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/dao/impl/StandardFlowRegistryDAO.java
Outdated
Show resolved
Hide resolved
...ifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/dao/impl/StandardFlowRegistryDAO.java
Outdated
Show resolved
Hide resolved
...ework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/StandardNiFiServiceFacade.java
Outdated
Show resolved
Hide resolved
...ework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/StandardNiFiServiceFacade.java
Outdated
Show resolved
Hide resolved
| .thenReturn(expectedEntity); | ||
|
|
||
| final Response response = versionsResource.createFlowBranch(groupId, requestEntity); | ||
| assertEquals(200, response.getStatus()); |
Contributor
There was a problem hiding this comment.
HttpURLConnection.HTTP_OK can be used in place for 200 here and in other methods.
| final NiFiCoreException exception = assertThrows(NiFiCoreException.class, | ||
| () -> dao.createBranchForUser(userContext, "registry-1", sourceLocation, "feature")); | ||
|
|
||
| assertEquals("Unable to create branch [feature] in registry with ID registry-1: Branch [feature] already exists", exception.getMessage()); |
Contributor
There was a problem hiding this comment.
In general it is best to avoid asserting an exact message, recommend asserting that the message contains a particular keyword, such as registry-1 if that is the goal.
| final NiFiCoreException exception = assertThrows(NiFiCoreException.class, | ||
| () -> serviceFacade.createFlowBranch(revision, PROCESS_GROUP_ID, "feature", null, null)); | ||
|
|
||
| assertEquals("Unable to create branch [feature] in registry with ID registry-1: Branch [feature] already exists", exception.getMessage()); |
Contributor
There was a problem hiding this comment.
See note on message matching.
Contributor
Author
|
Thanks @exceptionfactory - I pushed a commit to address your comments |
Signed-off-by: Pierre Villard <pierre.villard.fr@gmail.com>
Co-authored-by: David Handermann <exceptionfactory@apache.org>
c8fbd26 to
0e4e7f6
Compare
...mework/nifi-web/nifi-web-api/src/test/java/org/apache/nifi/web/api/TestVersionsResource.java
Outdated
Show resolved
Hide resolved
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
NIFI-15148 - Registry Clients - Support for branch creation
It requires apache/nifi-api#25 and a new NiFi API release.
Not very satisfied with the "Create Branch" modal view but I'm sure someone more familiar with the UI will be able to help getting something better.
Tracking
Please complete the following tracking steps prior to pull request creation.
Issue Tracking
Pull Request Tracking
NIFI-00000NIFI-00000Pull Request Formatting
mainbranchVerification
Please indicate the verification steps performed prior to pull request creation.
Build
./mvnw clean install -P contrib-checkLicensing
LICENSEandNOTICEfilesDocumentation