-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
NIFI-9628: Added a uiOnly flag when requesting Controller Service det… #5712
Conversation
…ails and the list of Controller Services. This allows us to return much less data when retrieving these resources.
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 @markap14! Considering the motivation for this PR, I think you could also consider adding the uiOnly
flag to PUT /nifi-api/controller-services/{id}/references
and PUT /nifi-api/controller-services/{id}/run-status
. Currently when enabling or disabling a Controller Service we invoke these APIs and it is still returning the referencing component descriptors
and properties
.
dataType: 'json' | ||
dataType: 'json', | ||
data: { | ||
uiOnly: true |
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.
The parameter contexts endpoint does not support the uiOnly
parameter. Was this added inadvertently?
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.
Oops, good catch. That was definitely inadvertently
@@ -1015,4 +1018,33 @@ private void normalizeCoordinates(Collection<? extends ComponentDTO> components) | |||
} | |||
} | |||
|
|||
public static void stripNonUiRelevantFields(final ControllerServiceEntity serviceEntity) { |
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.
What was the motivation for adding these methods to SnippetUtils
?
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.
It's referenced from a few different places. So I wanted to extract the logic into some sort of utility class that could be easily referenced from all of the resources that needed it. We could create a separate util class - ControllerServiceUtils
or something like that maybe? Didn't feel like that warranted its own util class, and i figured one could argue that this deals with a snippet of the flow. Though I suppose this util class is actually intended for interacting with Snippets with a capital S, the specific components. I could move it into its own util class if you prefer.
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.
SnippetUtils
is intended for interacting with Snippets with a capital S. We could do another class or we could even put it in the ApplicationResource
. I believe all the calling code is in a class that extends ApplicationResource
.
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.
Yeah fair. Could definitely put it in ApplicationResource.
…r service run-status and references also
Thanks for reviewing @mcgilman . I pushed a new commit that I believe addresses all of the above. |
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.
@markap14 thanks for the updates! +1 looks great.
apache#5712) * NIFI-9628: Added a uiOnly flag when requesting Controller Service details and the list of Controller Services. This allows us to return much less data when retrieving these resources. * NIFI-9628: Addressed review feedback; added uiOnly flag for controller service run-status and references also * NIFI-9628: Fixed checkstyle issues by removing unused imports This closes apache#5712
apache#5712) * NIFI-9628: Added a uiOnly flag when requesting Controller Service details and the list of Controller Services. This allows us to return much less data when retrieving these resources. * NIFI-9628: Addressed review feedback; added uiOnly flag for controller service run-status and references also * NIFI-9628: Fixed checkstyle issues by removing unused imports This closes apache#5712
…ails and the list of Controller Services. This allows us to return much less data when retrieving these resources.
Thank you for submitting a contribution to Apache NiFi.
Please provide a short description of the PR here:
Description of PR
Enables X functionality; fixes bug NIFI-YYYY.
In order to streamline the review of the contribution we ask you
to ensure the following steps have been taken:
For all changes:
Is there a JIRA ticket associated with this PR? Is it referenced
in the commit message?
Does your PR title start with NIFI-XXXX where XXXX is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character.
Has your PR been rebased against the latest commit within the target branch (typically
main
)?Is your initial contribution a single, squashed commit? Additional commits in response to PR reviewer feedback should be made on this branch and pushed to allow change tracking. Do not
squash
or use--force
when pushing to allow for clean monitoring of changes.For code changes:
mvn -Pcontrib-check clean install
at the rootnifi
folder?LICENSE
file, including the mainLICENSE
file undernifi-assembly
?NOTICE
file, including the mainNOTICE
file found undernifi-assembly
?.displayName
in addition to .name (programmatic access) for each of the new properties?For documentation related changes:
Note:
Please ensure that once the PR is submitted, you check GitHub Actions CI for build issues and submit an update to your PR as soon as possible.