Skip to content
This repository has been archived by the owner on May 14, 2021. It is now read-only.

MINIFI-433 - PG Variable Registry support in templates #115

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pvillard31
Copy link
Contributor

Thank you for submitting a contribution to Apache NiFi - MiNiFi.

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 MINIFI-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 master)?

  • Is your initial contribution a single, squashed commit?

For code changes:

  • Have you ensured that the full suite of tests is executed via mvn -Pcontrib-check clean install at the root nifi-minifi folder?
  • Have you written or updated unit tests to verify your changes?
  • 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 minifi-assembly?
  • If applicable, have you updated the NOTICE file, including the main NOTICE file found under minifi-assembly?

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 travis-ci for build issues and submit an update to your PR as soon as possible.

@pvillard31
Copy link
Contributor Author

Do not merge as-is.

I added unit tests, and it seems to behave as expected but when testing with a local build, variables are not included in the flow.xml.gz generated from the config.yml. I guess I missed something somewhere, but didn't find it so far. I still submitted the PR in case someone wants to have a look.

@JPercivall
Copy link
Contributor

Hey @pvillard31, took a look and I believe the problems you're seeing are due to variables at the root level not being accounted for in the template transformation. In ConfigSchemaFunction, for the root group level you're passing null for the variables[1]. So the check for "variables" in the recursive function below that will not have the variables for the root group.

The transformation works for the actual config transformation (from config.yml to flow.xml) because there's no special passing of the variables[2].

The reason the unit tests don't catch it because the toolkit unit test doesn't include a variable at the root level[3] (the ConfigMainTest though).

[1] https://github.com/apache/nifi-minifi/pull/115/files#diff-086bfd1ce3301edce34fd8af627c1470R88
[2] https://github.com/apache/nifi-minifi/pull/115/files#diff-a022622bcf128ab992d247f2a8694a0eR429
[3] https://github.com/apache/nifi-minifi/pull/115/files#diff-f9d5c0852f4099119785f1880d047d24R12282
[4] https://github.com/apache/nifi-minifi/pull/115/files#diff-76cab7aede126aa1ab9da5d56a4b5580R282

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants