You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "Chamila De Alwis (Jira)" <ji...@apache.org> on 2021/02/17 01:36:00 UTC

[jira] [Commented] (NIFIREG-433) [Git Flow Persistence] Use of refspec for push remote is not working

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

Chamila De Alwis commented on NIFIREG-433:
------------------------------------------

Hi team, any input on this one? I could reproduce this relatively easily if asked to. 

> [Git Flow Persistence] Use of refspec for push remote is not working
> --------------------------------------------------------------------
>
>                 Key: NIFIREG-433
>                 URL: https://issues.apache.org/jira/browse/NIFIREG-433
>             Project: NiFi Registry
>          Issue Type: Bug
>    Affects Versions: 0.8.0
>            Reporter: Chamila De Alwis
>            Priority: Major
>
> The documentation states that for {{Remote to Push}} property for {{GitFlowPersistenceProvider}} can take a Git refspec for input if different branches needs to be used. However, when a value like {{refs/heads/dev:refs/remotes/origin/dev}} is set, Nifi Registry fails to startup with the following error message.
> {code}
> Caused by: java.lang.IllegalArgumentException: The configured remote 'refs/heads/dev:refs/remotes/origin/dev' to push does not exist. Available remotes are [origin]
>         at org.apache.nifi.registry.provider.flow.git.GitFlowMetaData.loadGitRepository(GitFlowMetaData.java:223)
>         at org.apache.nifi.registry.provider.flow.git.GitFlowPersistenceProvider.onConfigured(GitFlowPersistenceProvider.java:100)
>         at org.apache.nifi.registry.provider.StandardProviderFactory.getFlowPersistenceProvider(StandardProviderFactory.java:166)
>         at org.apache.nifi.registry.provider.StandardProviderFactory$$EnhancerBySpringCGLIB$$c667832b.CGLIB$getFlowPersistenceProvider$2(<generated>)
>         at org.apache.nifi.registry.provider.StandardProviderFactory$$EnhancerBySpringCGLIB$$c667832b$$FastClassBySpringCGLIB$$7ba69f22.invoke(<generated>)
>         at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:244)
>         at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:331)
>         at org.apache.nifi.registry.provider.StandardProviderFactory$$EnhancerBySpringCGLIB$$c667832b.getFlowPersistenceProvider(<generated>)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>         at java.lang.reflect.Method.invoke(Method.java:498)
>         at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154)
>         ... 86 common frames omitted
> {code}
> When digging into the code, it can be seen that in {{GitMetadata.loadGitRepository()}} (https://github.com/apache/nifi-registry/blob/rel/nifi-registry-0.8.0/nifi-registry-core/nifi-registry-framework/src/main/java/org/apache/nifi/registry/provider/flow/git/GitFlowMetaData.java#L218) the remotes are listed and compared with the value given. 
> I'm not familiar with JGit that much, but it looks like {{remote.getName().equals(remoteToPush)}} should be replaced with code to check the push refspecs against `remoteToPush` value. 
> Furthermore, when the actual push happens at {{GitMetaData.startPushThread()}}(https://github.com/apache/nifi-registry/blob/rel/nifi-registry-0.8.0/nifi-registry-core/nifi-registry-framework/src/main/java/org/apache/nifi/registry/provider/flow/git/GitFlowMetaData.java#L295) the remote to push is again set, but without the refspec. 
> Not sure if I've grasped this correctly. If this is possible and my configuration is wrong, would a more correct example be provided? 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)