[ 
https://issues.apache.org/jira/browse/NIFIREG-135?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16349271#comment-16349271
 ] 

ASF GitHub Bot commented on NIFIREG-135:
----------------------------------------

Github user kevdoran commented on a diff in the pull request:

    https://github.com/apache/nifi-registry/pull/98#discussion_r165487223
  
    --- Diff: 
nifi-registry-framework/src/main/java/org/apache/nifi/registry/service/RegistryService.java
 ---
    @@ -589,8 +589,15 @@ public VersionedFlowSnapshot createFlowSnapshot(final 
VersionedFlowSnapshot flow
                 // update the modified date on the flow
                 metadataService.updateFlow(existingFlow);
     
    +            // get the updated flow, we need to use "with counts" here so 
we can return this is a part of the response
    +            final FlowEntity updatedFlow = 
metadataService.getFlowByIdWithSnapshotCounts(snapshotMetadata.getFlowIdentifier());
    +            if (updatedFlow == null) {
    +                throw new ResourceNotFoundException("Versioned flow does 
not exist for identifier " + snapshotMetadata.getFlowIdentifier());
    +            }
    +            final VersionedFlow updatedVersionedFlow = 
DataModelMapper.map(existingBucket, updatedFlow);
    +
    --- End diff --
    
    For the above block, I considered just modifying the in-scope versionedFlow 
object before returning, but thought it would be better (though more expensive) 
to just re-retrieve the flow, in case we add other fields to flow in the future 
that would be modified upon saving a new flow version.


> BucketFlowsApi.create_flow_version returns an incorrect version count
> ---------------------------------------------------------------------
>
>                 Key: NIFIREG-135
>                 URL: https://issues.apache.org/jira/browse/NIFIREG-135
>             Project: NiFi Registry
>          Issue Type: Bug
>    Affects Versions: 0.1.0
>            Reporter: Daniel Chaffelson
>            Assignee: Kevin Doran
>            Priority: Major
>             Fix For: 0.2.0
>
>
> Using the Python version of the Swagger defined client at:
> [https://github.com/Chaffelson/nipyapi/blob/master/nipyapi/registry/apis/bucket_flows_api.py]
> The VersionedFlow sub-object in the VersionedFlowSnapshot returned by the 
> create_flow_version call does not correctly increment the version_count 
> variable.
> If the Flow is subsequently retrieved using get_flow_version, the 
> version_count is correct.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to