Skip to content

Conversation

@pvillard31
Copy link
Contributor

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.

Screenshot 2025-10-28 at 15 51 33
Screenshot 2025-10-28 at 15 50 51
Screenshot 2025-10-28 at 15 53 32

Tracking

Please complete the following tracking steps prior to pull request creation.

Issue Tracking

Pull Request Tracking

  • Pull Request title starts with Apache NiFi Jira issue number, such as NIFI-00000
  • Pull Request commit message starts with Apache NiFi Jira issue number, as such NIFI-00000

Pull Request Formatting

  • Pull Request based on current revision of the main branch
  • Pull Request refers to a feature branch with one commit containing changes

Verification

Please indicate the verification steps performed prior to pull request creation.

Build

  • Build completed using ./mvnw clean install -P contrib-check
    • JDK 21
    • JDK 25

Licensing

  • New dependencies are compatible with the Apache License 2.0 according to the License Policy
  • New dependencies are documented in applicable LICENSE and NOTICE files

Documentation

  • Documentation formatting appears as expected in rendered files

@pvillard31 pvillard31 marked this pull request as ready for review November 9, 2025 08:43
@pvillard31 pvillard31 force-pushed the NIFI-15148 branch 2 times, most recently from dce8ef2 to c3d55fc Compare November 9, 2025 10:30
@exceptionfactory exceptionfactory added the ui Pull requests for work relating to the user interface label Nov 25, 2025
Copy link
Contributor

@exceptionfactory exceptionfactory left a comment

Choose a reason for hiding this comment

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

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.

.thenReturn(expectedEntity);

final Response response = versionsResource.createFlowBranch(groupId, requestEntity);
assertEquals(200, response.getStatus());
Copy link
Contributor

Choose a reason for hiding this comment

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

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());
Copy link
Contributor

Choose a reason for hiding this comment

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

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());
Copy link
Contributor

Choose a reason for hiding this comment

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

See note on message matching.

@pvillard31
Copy link
Contributor Author

Thanks @exceptionfactory - I pushed a commit to address your comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ui Pull requests for work relating to the user interface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants