diff --git a/repo-scripts/upgrade-reference b/repo-scripts/upgrade-reference
index d2b101bafc33fa5df3b353c957c842bef67d6340_cmVwby1zY3JpcHRzL3VwZ3JhZGUtcmVmZXJlbmNl..6669ca0a69cc091429c34942fb733a62f6651cff_cmVwby1zY3JpcHRzL3VwZ3JhZGUtcmVmZXJlbmNl 100755
--- a/repo-scripts/upgrade-reference
+++ b/repo-scripts/upgrade-reference
@@ -35,7 +35,7 @@
 
     # Find the benchrepo file
     topdir_file = os.listdir(tmp_directory)
-    assert len(topdir_file) == 2
+    assert len(topdir_file) == 2, topdir_file
 
     benchrepo = [x for x in topdir_file if x.endswith(".benchrepo")]
     assert len(benchrepo) == 1
@@ -108,6 +108,12 @@
     # some old version of the file has the partial_sets at the wrong level
     new_benchrepo["reference-repo"].pop("partial_sets", None)
 
+    # add/update the role definition in reference file
+    #
+    # note: same comment about "optional partial-sets argument apply
+    if 'roles' in partial_config:
+        new_benchrepo["roles"] = partial_config["roles"]
+
     # And write it
     with open(benchrepo_path, "w") as new_benchrepo_file:
         new_benchrepo_file.write(
diff --git a/tests/test-upgrade-reference.t b/tests/test-upgrade-reference.t
index d2b101bafc33fa5df3b353c957c842bef67d6340_dGVzdHMvdGVzdC11cGdyYWRlLXJlZmVyZW5jZS50..6669ca0a69cc091429c34942fb733a62f6651cff_dGVzdHMvdGVzdC11cGdyYWRlLXJlZmVyZW5jZS50 100644
--- a/tests/test-upgrade-reference.t
+++ b/tests/test-upgrade-reference.t
@@ -120,6 +120,12 @@
     id: my-source-repo
     repo-prefix: my-source-repo-39241d24
     source: some-dir/my-source-repo
+  roles:
+    pull:
+      noop:
+        same:
+          source: reference
+          target: same
 
   $ ls some-dir > first-run
 
@@ -250,3 +256,9 @@
     id: my-source-repo
     repo-prefix: my-source-repo-1a2b3c4d
     source: some-dir/my-source-repo
+  roles:
+    pull:
+      noop:
+        same:
+          source: reference
+          target: same