Skip to content

Commit d16d4c8

Browse files
adamanciniclaude
andcommitted
feat: enhance channel management with unique ID support
- Update tasks to use channel IDs alongside channel names for unique identification - Add RELEASE_CHANNEL_ID parameter support to channel-create, channel-delete, customer-create - Update GitHub Actions workflows to propagate channel IDs between jobs - Enhance customer-helm-install to accept both CHANNEL_ID and CHANNEL_SLUG parameters - Update task dependency graph with variable inputs/outputs and channel ID enhancements - Fix markdownlint formatting issues in documentation 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 9a40955 commit d16d4c8

File tree

6 files changed

+404
-136
lines changed

6 files changed

+404
-136
lines changed

.github/actions/replicated-release/action.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,35 @@ inputs:
77
channel-name:
88
description: 'Release channel name'
99
required: true
10+
channel-id:
11+
description: 'Release channel ID (optional, takes precedence over channel-name)'
12+
required: false
1013
release-version:
1114
description: 'Release version'
1215
default: '0.0.1'
1316
release-notes:
1417
description: 'Release notes'
1518
default: 'Release created via GitHub Actions'
1619

20+
outputs:
21+
channel-id:
22+
description: 'Channel ID created or found'
23+
value: ${{ steps.channel.outputs.channel-id }}
24+
1725
runs:
1826
using: 'composite'
1927
steps:
2028
- name: Setup tools
2129
uses: ./.github/actions/setup-tools
2230

2331
- name: Create channel
32+
id: channel
2433
shell: bash
2534
working-directory: ${{ inputs.app-dir }}
26-
run: task channel-create RELEASE_CHANNEL="${{ inputs.channel-name }}"
35+
run: |
36+
CHANNEL_ID=$(task channel-create RELEASE_CHANNEL="${{ inputs.channel-name }}" --silent | tail -1)
37+
echo "channel-id=$CHANNEL_ID" >> $GITHUB_OUTPUT
38+
echo "Created/found channel with ID: $CHANNEL_ID"
2739
2840
- name: Create release
2941
shell: bash

.github/actions/test-deployment/action.yml

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ inputs:
1212
required: true
1313
channel-name:
1414
description: 'Channel name for testing'
15-
required: true
15+
required: false
16+
channel-id:
17+
description: 'Channel ID for testing (optional, takes precedence over channel-name)'
18+
required: false
1619
helm-version:
1720
description: 'Helm version to use'
1821
default: '3.17.3'
@@ -38,9 +41,15 @@ runs:
3841
shell: bash
3942
working-directory: ${{ inputs.app-dir }}
4043
run: |
41-
task customer-create \
42-
CUSTOMER_NAME="${{ inputs.customer-name }}" \
43-
RELEASE_CHANNEL="${{ inputs.channel-name }}"
44+
if [ -n "${{ inputs.channel-id }}" ]; then
45+
task customer-create \
46+
CUSTOMER_NAME="${{ inputs.customer-name }}" \
47+
RELEASE_CHANNEL_ID="${{ inputs.channel-id }}"
48+
else
49+
task customer-create \
50+
CUSTOMER_NAME="${{ inputs.customer-name }}" \
51+
RELEASE_CHANNEL="${{ inputs.channel-name }}"
52+
fi
4453
4554
- name: Get customer license
4655
id: license
@@ -72,11 +81,19 @@ runs:
7281
shell: bash
7382
working-directory: ${{ inputs.app-dir }}
7483
run: |
75-
task customer-helm-install \
76-
CUSTOMER_NAME="${{ inputs.customer-name }}" \
77-
CLUSTER_NAME="${{ inputs.cluster-name }}" \
78-
CHANNEL_SLUG="${{ inputs.channel-name }}" \
79-
REPLICATED_LICENSE_ID="${{ steps.license.outputs.license-id }}"
84+
if [ -n "${{ inputs.channel-id }}" ]; then
85+
task customer-helm-install \
86+
CUSTOMER_NAME="${{ inputs.customer-name }}" \
87+
CLUSTER_NAME="${{ inputs.cluster-name }}" \
88+
CHANNEL_ID="${{ inputs.channel-id }}" \
89+
REPLICATED_LICENSE_ID="${{ steps.license.outputs.license-id }}"
90+
else
91+
task customer-helm-install \
92+
CUSTOMER_NAME="${{ inputs.customer-name }}" \
93+
CLUSTER_NAME="${{ inputs.cluster-name }}" \
94+
CHANNEL_SLUG="${{ inputs.channel-name }}" \
95+
REPLICATED_LICENSE_ID="${{ steps.license.outputs.license-id }}"
96+
fi
8097
8198
- name: Run tests
8299
shell: bash

.github/workflows/wg-easy-pr-validation.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ jobs:
8686
create-release:
8787
runs-on: ubuntu-22.04
8888
needs: [setup, build-and-package]
89+
outputs:
90+
channel-id: ${{ steps.release.outputs.channel-id }}
8991
steps:
9092
- name: Checkout code
9193
uses: actions/checkout@v4
@@ -97,6 +99,7 @@ jobs:
9799
path: ${{ env.APP_DIR }}/release
98100

99101
- name: Create Replicated release
102+
id: release
100103
uses: ./.github/actions/replicated-release
101104
with:
102105
app-dir: ${{ env.APP_DIR }}
@@ -116,7 +119,7 @@ jobs:
116119
app-dir: ${{ env.APP_DIR }}
117120
customer-name: ${{ needs.setup.outputs.channel-name }}
118121
cluster-name: ${{ needs.setup.outputs.channel-name }}
119-
channel-name: ${{ needs.setup.outputs.channel-name }}
122+
channel-id: ${{ needs.create-release.outputs.channel-id }}
120123
helm-version: ${{ env.HELM_VERSION }}
121124
cleanup: 'false'
122125

applications/wg-easy/CLAUDE.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ This file contains common commands and workflows for working with the WG-Easy He
3030
- **Optimized GitHub Actions workflows** with Task-based operations and reusable actions
3131
- **Added chart validation tasks** for consistent linting and templating across environments
3232
- **Implemented PR validation cycle** with automated cleanup and better error handling
33+
- **Enhanced channel management** with unique channel ID support to avoid ambiguous channel names
3334

3435
## Core Principles
3536

@@ -173,7 +174,8 @@ task helm-install
173174
# Install charts for a specific customer (requires pre-setup)
174175
# By default, use current git branch name for customer, cluster, and channel names
175176
# Note: names are automatically normalized (/, _, . replaced with -) by the tasks
176-
task customer-helm-install CUSTOMER_NAME=$(git branch --show-current) CLUSTER_NAME=$(git branch --show-current) REPLICATED_LICENSE_ID=xxx CHANNEL_SLUG=$(git branch --show-current)
177+
# Use CHANNEL_ID for precise channel targeting or CHANNEL_SLUG for channel name
178+
task customer-helm-install CUSTOMER_NAME=$(git branch --show-current) CLUSTER_NAME=$(git branch --show-current) REPLICATED_LICENSE_ID=xxx CHANNEL_ID=your-channel-id
177179

178180
# Run tests
179181
task test
@@ -200,10 +202,15 @@ task release-prepare
200202
# Create and promote a release
201203
task release-create RELEASE_VERSION=x.y.z RELEASE_CHANNEL=Unstable
202204

205+
# Channel management (returns channel ID for unique identification)
206+
task channel-create RELEASE_CHANNEL=channel-name
207+
task channel-delete RELEASE_CHANNEL_ID=channel-id
208+
203209
# Customer management
204210
# By default, use current git branch name for customer name
205211
# Note: names are automatically normalized (/, _, . replaced with -) by the tasks
206-
task customer-create CUSTOMER_NAME=$(git branch --show-current)
212+
# Use RELEASE_CHANNEL_ID for precise channel targeting or RELEASE_CHANNEL for channel name
213+
task customer-create CUSTOMER_NAME=$(git branch --show-current) RELEASE_CHANNEL_ID=your-channel-id
207214
task customer-ls
208215
task customer-delete CUSTOMER_ID=your-customer-id
209216
```

0 commit comments

Comments
 (0)