diff --git a/.gitattributes b/.gitattributes index 4acdf4f..265a9dc 100644 --- a/.gitattributes +++ b/.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: diff --git a/local-bin/.local/bin/generate_tinyrdm_connections.py b/local-bin/.local/bin/generate_tinyrdm_connections.py index d785008..e499eda 100755 --- a/local-bin/.local/bin/generate_tinyrdm_connections.py +++ b/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'] + # 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 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("") + 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) diff --git a/rbw/.config/rbw/config.json b/rbw/.config/rbw/config.json index 67037d7..4747481 100644 Binary files a/rbw/.config/rbw/config.json and b/rbw/.config/rbw/config.json differ