Răsfoiți Sursa

dev: automated commit - 2025-10-21 09:19:45

Mariano Z. 3 luni în urmă
părinte
comite
aa0e46a87d

+ 1 - 0
.gitattributes

@@ -6,6 +6,7 @@ zsh/.config/zsh/zsh_history* filter=git-crypt diff=git-crypt
 config/.config/sdm-ui.yaml filter=git-crypt diff=git-crypt
 config/.config/ngrok/ngrok.yml filter=git-crypt diff=git-crypt
 aws/.aws/config filter=git-crypt diff=git-crypt
+rbw/.config/rbw/config.json filter=git-crypt diff=git-crypt
 
 # Add any new paths for sensitive files in your new modules
 # For example, if you have API tokens in new locations:

+ 32 - 23
local-bin/.local/bin/generate_tinyrdm_connections.py

@@ -108,22 +108,28 @@ def group_connections(connections):
     groups = defaultdict(list)
     
     for conn in connections:
-        if conn['customer'] == 'internal':
-            group_name = 'Internal'
+        # Mirror DBeaver grouping: internal/features -> 'internal', otherwise by customer, else 'other'
+        if conn['customer'] == 'internal' or conn['customer'].startswith('feature'):
+            group_name = 'internal'
+        elif conn['stage'] in ['stage', 'production']:
+            group_name = conn['customer']
+        else:
+            group_name = 'other'
+        
+        # Keep stage-based color coding
+        if conn['stage'] == 'internal':
             conn_stage = 'internal'
-        elif conn['stage'] in ['stage']:
-            group_name = 'Stage'
+        elif conn['stage'] == 'stage':
             conn_stage = 'stage'
-        elif conn['stage'] in ['production']:
-            group_name = 'Production'
+        elif conn['stage'] == 'production':
             conn_stage = 'production'
         else:
-            continue
+            conn_stage = 'unknown'
         
         conn_yaml = create_connection_yaml(
-            conn['name'], 
-            conn['addr'], 
-            conn['port'], 
+            conn['name'],
+            conn['addr'],
+            conn['port'],
             conn_stage
         )
         
@@ -133,19 +139,22 @@ def group_connections(connections):
 
 def generate_yaml_content(groups):
     yaml_lines = []
-    group_order = ['Internal', 'Stage', 'Production']
-    
-    for group_name in group_order:
-        if group_name in groups:
-            yaml_lines.append(f"- name: {group_name}")
-            yaml_lines.append("  last_db: 0")
-            yaml_lines.append("  type: group")
-            yaml_lines.append("  connections:")
-            
-            for conn_yaml in groups[group_name]:
-                yaml_lines.append(conn_yaml)
-            
-            yaml_lines.append("")
+    # Prefer 'internal' first, then alphabetical by customer
+    ordered_groups = []
+    if 'internal' in groups:
+        ordered_groups.append('internal')
+    ordered_groups.extend(sorted([g for g in groups.keys() if g != 'internal']))
+    
+    for group_name in ordered_groups:
+        yaml_lines.append(f"- name: {group_name}")
+        yaml_lines.append("  last_db: 0")
+        yaml_lines.append("  type: group")
+        yaml_lines.append("  connections:")
+        
+        for conn_yaml in groups[group_name]:
+            yaml_lines.append(conn_yaml)
+        
+        yaml_lines.append("")
     
     return '\n'.join(yaml_lines)
 

BIN
rbw/.config/rbw/config.json