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

deploy_flow_version dont deploy latest version #262

Open
GrasOliver opened this issue Feb 4, 2021 · 3 comments
Open

deploy_flow_version dont deploy latest version #262

GrasOliver opened this issue Feb 4, 2021 · 3 comments
Assignees
Labels
Milestone

Comments

@GrasOliver
Copy link

GrasOliver commented Feb 4, 2021

  • Nipyapi version: 0.16.1
  • NiFi version: 1.11.4
  • NiFi-Registry version: 0.6.0
  • Python version: 3.8.3
  • Operating System:
    • Windows 10 64-Bit local dev-machine
    • centos 7: productive machine

Description

Contrary to the documentation that says the latest version would be deployed a random version will be deployed.
After a short analysis i think this issue is caused by the fix access of the first list entry in versioning.deploy_flow_version:
Line 742
target_flow = target_flow[0].versioned_flow_snapshot_metadata

Also it seems that the self.get_versions_with_http_info(registry_id, bucket_id, flow_id, **kwargs) in get_versions() (Line: 4005, flow_api.py)
is always returning the versions in a different order.

What I Did

Commit a Flow that there are 3 Versions in the Nifi-Registry for the Flow.
call deploy_flow_version with no version parameter.

Urgency

We can workaround this issue by setting the version attribute to flow.version_count

@Chaffelson Chaffelson self-assigned this Oct 20, 2021
@Chaffelson Chaffelson added the bug label Oct 20, 2021
@Kafkalasch
Copy link

I can reproduce it. The issue is here: When providing now version info to deploy_flow_version:

...
if version is None:
        target_flow = flow_versions.versioned_flow_snapshot_metadata_set
...
target_flow = target_flow[0].versioned_flow_snapshot_metadata 
...
// assuming that target_flow[0] is the latest version. But is not, it is in random order as @GrasOliver already wrote

@Kafkalasch
Copy link

oh sorry, i read your comment too fast. you basically provided all the information already and my comment brings no additional input.

@Chaffelson
Copy link
Owner

Ugh that is annoying - I had thought the API returns the versions in a deterministic sort order, perhaps that has changed or it never actually did. We'll patch this for the next version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants