[RTFACT-17901] Unable to enable smart repository config parameters from Mission control script Created: 27/Nov/18  Updated: 23/Jun/19

Status: Open
Project: Artifactory Binary Repository
Component/s: None
Affects Version/s: 6.3.3
Fix Version/s: None

Type: Improvement Priority: Normal
Reporter: Seshu Kumar Reddy Assignee: Unassigned
Resolution: Unresolved Votes: 2
Labels: None


 Description   

Currently, the customer is creating a smart remote repository using a script via mission control, we are able to create a smart remote repo using the script but not successful in getting the below fields enabled for the smart remote repo :

Report Statistics 

Sync Properties 

Source Absence Detection 

The groovy script used to create smart remote repo is picked from the below link :

https://github.com/jfrog/mission-control-config-scripts/blob/master/repository/create/remote-nuget-gallery.groovy

 

The parameters for a remote{{Repository}} block are listed as referred to this link .
currently, the above parameters are not listed in the remoteRepository block, for which we are trying to induce these parameters in the script and failed for the same.

We tried enabling these parameters in the script but failed to get them reflected as when the smart remote repository is created 

synchronizeProperties true
originAbsenceDetection true

contentSynchronisation true 

The customer wants to have all the configuration for the smart remote repo to be done by the script, rather than manually checking from UI for the config changes.

 

 

 

 



 Comments   
Comment by Mark Richardson [ 14/Feb/19 ]

I ran in to this too. Here is an ugly workaround taking advantage of how mission control seems to be serializing classes:

class ContentSynchronisation {
    def boolean enabled
    def Statistics statistics
    def Properties properties
    def Source source
    
    class Statistics {
        def boolean enabled
    }
    
    class Properties {
        def boolean enabled
    }
    
    class Source {
        def boolean originAbsenceDetection
    }
}

artifactory('My Instance') {
    remoteRepository('my-remote') {
        // . . .
        
        replication {
            // . . .
        }
      
        contentSynchronisation new ContentSynchronisation().with {
            enabled = true
            statistics = new ContentSynchronisation.Statistics().with { 
                enabled = true
                return it
            }
            properties = new ContentSynchronisation.Properties().with { 
                enabled = true
                return it
            }
            source = new ContentSynchronisation.Source().with { 
                originAbsenceDetection = true
                return it
            }
            return it
        }
    }
}
Comment by Mark Richardson [ 14/Feb/19 ]

Note with the above script you still have to go in and toggle the configuration (turn off, save, turn on, save).

Generated at Tue Sep 22 17:41:11 UTC 2020 using Jira 8.5.3#805003-sha1:b4933e02eaff29a49114274fe59e1f99d9d963d7.