dev: automated commit - 2025-10-21 09:19:45
This commit is contained in:
parent
e7f0b5feec
commit
aa0e46a87d
3 changed files with 32 additions and 22 deletions
1
.gitattributes
vendored
1
.gitattributes
vendored
|
|
@ -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/sdm-ui.yaml filter=git-crypt diff=git-crypt
|
||||||
config/.config/ngrok/ngrok.yml 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
|
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
|
# Add any new paths for sensitive files in your new modules
|
||||||
# For example, if you have API tokens in new locations:
|
# For example, if you have API tokens in new locations:
|
||||||
|
|
|
||||||
|
|
@ -108,22 +108,28 @@ def group_connections(connections):
|
||||||
groups = defaultdict(list)
|
groups = defaultdict(list)
|
||||||
|
|
||||||
for conn in connections:
|
for conn in connections:
|
||||||
if conn['customer'] == 'internal':
|
# Mirror DBeaver grouping: internal/features -> 'internal', otherwise by customer, else 'other'
|
||||||
group_name = 'Internal'
|
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'
|
conn_stage = 'internal'
|
||||||
elif conn['stage'] in ['stage']:
|
elif conn['stage'] == 'stage':
|
||||||
group_name = 'Stage'
|
|
||||||
conn_stage = 'stage'
|
conn_stage = 'stage'
|
||||||
elif conn['stage'] in ['production']:
|
elif conn['stage'] == 'production':
|
||||||
group_name = 'Production'
|
|
||||||
conn_stage = 'production'
|
conn_stage = 'production'
|
||||||
else:
|
else:
|
||||||
continue
|
conn_stage = 'unknown'
|
||||||
|
|
||||||
conn_yaml = create_connection_yaml(
|
conn_yaml = create_connection_yaml(
|
||||||
conn['name'],
|
conn['name'],
|
||||||
conn['addr'],
|
conn['addr'],
|
||||||
conn['port'],
|
conn['port'],
|
||||||
conn_stage
|
conn_stage
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -133,19 +139,22 @@ def group_connections(connections):
|
||||||
|
|
||||||
def generate_yaml_content(groups):
|
def generate_yaml_content(groups):
|
||||||
yaml_lines = []
|
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:
|
for group_name in ordered_groups:
|
||||||
if group_name in groups:
|
yaml_lines.append(f"- name: {group_name}")
|
||||||
yaml_lines.append(f"- name: {group_name}")
|
yaml_lines.append(" last_db: 0")
|
||||||
yaml_lines.append(" last_db: 0")
|
yaml_lines.append(" type: group")
|
||||||
yaml_lines.append(" type: group")
|
yaml_lines.append(" connections:")
|
||||||
yaml_lines.append(" connections:")
|
|
||||||
|
for conn_yaml in groups[group_name]:
|
||||||
for conn_yaml in groups[group_name]:
|
yaml_lines.append(conn_yaml)
|
||||||
yaml_lines.append(conn_yaml)
|
|
||||||
|
yaml_lines.append("")
|
||||||
yaml_lines.append("")
|
|
||||||
|
|
||||||
return '\n'.join(yaml_lines)
|
return '\n'.join(yaml_lines)
|
||||||
|
|
||||||
|
|
|
||||||
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue