Skip to content
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-9776 Adding the possibility to export flow definition with referenced services #5859

Merged
merged 2 commits into from
Apr 20, 2022

Conversation

simonbence
Copy link
Contributor

@simonbence simonbence commented Mar 11, 2022

This PR aims to open the possibility to export Flow Definition of a group with the referenced Controller Servcies from outside the scope of the Process Group.

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:

  • Have you ensured that the full suite of tests is executed via mvn -Pcontrib-check clean install at the root nifi folder?
  • Have you written or updated unit tests to verify your changes?
  • Have you verified that the full build is successful on JDK 8?
  • Have you verified that the full build is successful on JDK 11?
  • If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under ASF 2.0?
  • If applicable, have you updated the LICENSE file, including the main LICENSE file under nifi-assembly?
  • If applicable, have you updated the NOTICE file, including the main NOTICE file found under nifi-assembly?
  • If adding new Properties, have you added .displayName in addition to .name (programmatic access) for each of the new properties?

For documentation related changes:

  • Have you ensured that format looks appropriate for the output in which it is rendered?

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.

@simonbence
Copy link
Contributor Author

simonbence commented Mar 11, 2022

Hi @bbende ! Can you please take a look if you have some time? I think, as this change is connected to the registry, your input would be most useful. Many thanks!

Copy link
Contributor

@bbende bbende left a comment

Choose a reason for hiding this comment

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

Backend code looks good, and functionality is working as expected, nice work!

My only comment is around the wording of the menu items. Personally I know what the two options mean, but I wonder if the word "referenced" on its own is clear enough.

Take an example like this, process group being downloaded has:

  • Processor A referencing service A, where service A is inside the group
  • Processor A referencing service B, where service B is in a parent group

To me, these are both "referenced" services, its just that one is inside the PG and one is outside. So if you choose "without referenced services" we aren't saying we'll exclude both referenced services, we are just excluding the references that come from outside.

I'm not sure if added the word "external" or something else could make it a little clearer for users that aren't familiar with this.

@andrewmlim
Copy link
Contributor

My initial impression of the UI is the same as Bryan's: "referenced" services could be downloaded with both options. It's more a matter of whether the services are in or out of the scope of the process group.

Suggested alternative:

  • Without externally referenced services
  • With externally referenced services

or if those are too long:

  • Without external services
  • With external services

@andrewmlim
Copy link
Contributor

andrewmlim commented Mar 11, 2022

For the User Guide update, I understand the thinking behind adding two main bullets. But to reduce repetition, I thought we could add something like this:

- *Download flow definition*: This option allows the user to download the flow definition of the process group as a JSON file. The file can be used as a backup or imported into a link:https://nifi.apache.org/registry.html[NiFi Registry^] using the <<toolkit-guide.adoc#nifi_CLI,NiFi CLI>>. There are two choices when downloading a flow definition:

** *Without external services*: Controller services referenced by the selected process group but outside its scope (e.g., services in a parent group) _will not be_ included in the flow definition.
** *With external services*: Controller services referenced by the selected process group but outside its scope (e.g., services in a parent group) _will be_ included in the flow definition.

(Note: If "Download flow definition" is selected for a versioned process group, there is no versioning information in the download. In other words, the resulting contents of the JSON file is the same whether the process group is versioned or not.)

- *Create template*: This option allows the user to create a template from the selected Process Group.
- *Copy*: This option places a copy of the selected Process Group on the clipboard, so that it may be pasted elsewhere on the canvas by right-clicking on the canvas and selecting Paste. The Copy/Paste actions also may be done using the keystrokes Ctrl-C (Command-C) and Ctrl-V (Command-V).
- *Empty all queues*: This option allows the user to empty all queues in the selected Process Group. All FlowFiles from all connections waiting at the time of the request will be removed.
- *Delete*: This option allows the DFM to delete a Process Group.


(Note: If "Download flow definition" is selected for a versioned process group, there is no versioning information in the download. In other words, the resulting contents of the JSON file is the same whether the process group is versioned or not.)
Copy link
Contributor

Choose a reason for hiding this comment

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

@simonbence I think it would be more helpful if this Note is included with the "Download flow definition" section. It could get lost here at the end.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tried it that way as well and the rendered documentation looked pretty bad: the node did cut the list into two separate parts.

Copy link
Contributor

Choose a reason for hiding this comment

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

@simonbence OK, no problem. LGTM +1 then.

@andrewmlim andrewmlim merged commit 285a8cb into apache:main Apr 20, 2022
asfgit pushed a commit that referenced this pull request Apr 20, 2022
…enced services (#5859)

* NIFI-9776 Adding the possibility to export flow definition with referenced services

* NIFI-9776 Refining naming based on code review
genehynson pushed a commit to influxdata/nifi that referenced this pull request May 17, 2022
…enced services (apache#5859)

* NIFI-9776 Adding the possibility to export flow definition with referenced services

* NIFI-9776 Refining naming based on code review
krisztina-zsihovszki pushed a commit to krisztina-zsihovszki/nifi that referenced this pull request Jun 28, 2022
…enced services (apache#5859)

* NIFI-9776 Adding the possibility to export flow definition with referenced services

* NIFI-9776 Refining naming based on code review
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants