Skip to content

Commit 68ad4d3

Browse files
committed
github: Open release issue from draft-release workflow
1 parent 69b7083 commit 68ad4d3

File tree

2 files changed

+250
-15
lines changed

2 files changed

+250
-15
lines changed
Lines changed: 202 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,202 @@
1+
#!/usr/bin/env node
2+
3+
/*
4+
* Copyright 2025 The Kubernetes Authors
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
/**
20+
* Generate the release coordination issue body or release notes template
21+
* Usage:
22+
* node generate-release-issue-body.js issue <releaseName> <prevTag> <author>
23+
* node generate-release-issue-body.js release-notes
24+
*/
25+
26+
const mode = process.argv[2];
27+
28+
if (mode === 'release-notes') {
29+
const releaseNotesTemplate = `## ✨ Enhancements:
30+
* Feature 1
31+
* Feature 2
32+
33+
## 🐞 Bug fixes
34+
* Fix 1
35+
* Fix 2
36+
37+
## 💻 Development
38+
* Development experience related change 1
39+
* Development experience related change 2
40+
41+
## 📖 Documentation
42+
* Docs change 1
43+
* Docs change 2`;
44+
45+
console.log(releaseNotesTemplate);
46+
process.exit(0);
47+
}
48+
49+
if (mode !== 'issue') {
50+
console.error('Usage:');
51+
console.error(' node generate-release-issue-body.js issue <releaseName> <prevTag> <author>');
52+
console.error(' node generate-release-issue-body.js release-notes');
53+
process.exit(1);
54+
}
55+
56+
const releaseName = process.argv[3];
57+
const prevTag = process.argv[4];
58+
const author = process.argv[5];
59+
60+
if (!releaseName || !prevTag || !author) {
61+
console.error('Usage: node generate-release-issue-body.js issue <releaseName> <prevTag> <author>');
62+
process.exit(1);
63+
}
64+
65+
const testBattery = `# Release testing
66+
67+
NOTE: the release isn't frozen yet for testing.
68+
69+
Please write a comment if you're going to test an item and if you've completed testing an item.
70+
71+
- [ ] **Test web sockets**
72+
- Run the app in static server mode (\`./backend/headlamp-server -static-html-dir ./frontend/build...\`)
73+
- Open the pods list view
74+
- Delete a pod using kubectl
75+
- Verify that the list reflects the changes
76+
77+
- [ ] **App: Run with plugins**
78+
- Build app with plugins: \`make && make app\`
79+
- Run the app (UI should load in less than 1 minute)
80+
- Verify plugins are present: App Catalog, Prometheus, App Catalog
81+
82+
- [ ] **App: Test Prometheus plugin**
83+
- Run the app
84+
- Go to the Pods page and choose a pod
85+
- Verify the Prometheus plugin shows at the top and displays correctly
86+
87+
- [ ] **Image: Test Prometheus plugin**
88+
- Run headlamp from image
89+
- Go to the Pods page and choose a pod
90+
- Verify the Prometheus plugin shows at the top and displays correctly
91+
92+
- [ ] **App: Test Plugin Catalog**
93+
- Run the app
94+
- Verify the Plugin Catalog sidebar item is available and open it
95+
- Verify plugins appear from ArtifactHub
96+
- Install a plugin
97+
- Verify the plugin shows as installed
98+
- Delete the plugin
99+
- Verify the plugin shows as available to install
100+
101+
- [ ] **Test creating a resource through edit button**
102+
- Open Headlamp via app or image
103+
- Choose a cluster where you have admin rights
104+
- Click Create (bottom left), add a resource (e.g., ConfigMap), and apply
105+
- Verify the resource is created
106+
107+
- [ ] **Check Workloads page**
108+
- Open Headlamp via app or image
109+
- Go to the Workloads page of a cluster with diverse resource types
110+
- Verify resources and top charts display correctly
111+
112+
- [ ] **Check cluster renaming**
113+
- Open Headlamp via app or image
114+
- Open cluster settings
115+
- Rename the cluster
116+
- Verify the cluster name changed
117+
- Reload the app
118+
- Verify the new name persists
119+
120+
- [ ] **App: Check running on Mac**
121+
- Open app on Mac
122+
- Verify it loaded in less than 30 seconds
123+
124+
- [ ] **App: Check running on Windows**
125+
- Open app on Windows
126+
- Verify it loaded in less than 30 seconds
127+
128+
- [ ] **App: Check running on Linux**
129+
- Open app on Linux
130+
- Verify it loaded in less than 30 seconds
131+
132+
- [ ] **App: Load more than one cluster**
133+
- Open app
134+
- Add a new cluster from a kubeconfig file
135+
- Add another cluster from another kubeconfig file
136+
137+
- [ ] **Flatpak: Install a plugin**
138+
- Install a plugin from the app catalog
139+
- Verify it doesn't fail on cross-device linking
140+
141+
- [ ] **App: Load kubeconfig with context != cluster name**
142+
- Open app
143+
- Click Add Cluster
144+
- Choose a kubeconfig where a cluster name differs from the context name
145+
- Verify the cluster loads successfully
146+
147+
- [ ] **Allowed Namespaces**
148+
- Open Headlamp in any flavor
149+
- Configure allowed namespaces in cluster settings
150+
- Verify views honor allowed namespaces
151+
- Verify the map honors allowed namespaces
152+
153+
- [ ] **Create resources in the intended cluster**
154+
- Reproduce: "Create dialog doesn't update cluster when it's changed" (Issue #2441)
155+
- Verify resource creation targets the intended cluster
156+
157+
- [ ] **Check these plugins have settings**
158+
- Build a new app
159+
- Go to Settings > Plugins
160+
- Click each plugin to verify settings render
161+
- Plugins: Prometheus, App catalog, Plugin catalog
162+
`;
163+
164+
const releaseNotesTemplate = `## Release Notes
165+
166+
Please fill in the release notes below in the following format and then copy them to the release draft:
167+
168+
### ✨ Enhancements:
169+
* Feature 1
170+
* Feature 2
171+
172+
### 🐞 Bug fixes
173+
* Fix 1
174+
* Fix 2
175+
176+
### 💻 Development
177+
* Development experience related change 1
178+
* Development experience related change 2
179+
180+
### 📖 Documentation
181+
* Docs change 1
182+
* Docs change 2
183+
`;
184+
185+
const issueBody = `${testBattery}
186+
187+
---
188+
189+
## Changelog
190+
191+
@${author}, please run the following command to generate the changelog and paste it here:
192+
193+
\`\`\`bash
194+
git log --oneline --cherry --topo-order ${prevTag}..HEAD
195+
\`\`\`
196+
197+
---
198+
199+
${releaseNotesTemplate}
200+
`;
201+
202+
console.log(issueBody);

.github/workflows/draft-release.yml

Lines changed: 48 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,31 +15,64 @@ jobs:
1515
build:
1616
permissions:
1717
contents: write
18+
issues: write
1819
name: Create Release
1920
runs-on: ubuntu-latest
2021
steps:
22+
- name: Checkout code
23+
uses: actions/checkout@v4
24+
with:
25+
fetch-depth: 0
26+
27+
- name: Get previous release tag
28+
id: get_prev_tag
29+
run: |
30+
PREV_TAG=$(git tag -l 'v*' --sort=-version:refname | head -n 1)
31+
echo "prev_tag=$PREV_TAG" >> $GITHUB_OUTPUT
32+
echo "Previous tag: $PREV_TAG"
33+
34+
- name: Generate release issue body
35+
id: issue_body
36+
run: |
37+
ISSUE_BODY=$(node .github/scripts/generate-release-issue-body.js issue "${{ github.event.inputs.releaseName }}" "${{ steps.get_prev_tag.outputs.prev_tag }}" "${{ github.actor }}")
38+
echo "body<<EOF" >> $GITHUB_OUTPUT
39+
echo "$ISSUE_BODY" >> $GITHUB_OUTPUT
40+
echo "EOF" >> $GITHUB_OUTPUT
41+
42+
- name: Generate release notes template
43+
id: release_notes
44+
run: |
45+
RELEASE_NOTES=$(node .github/scripts/generate-release-issue-body.js release-notes)
46+
echo "template<<EOF" >> $GITHUB_OUTPUT
47+
echo "$RELEASE_NOTES" >> $GITHUB_OUTPUT
48+
echo "EOF" >> $GITHUB_OUTPUT
49+
50+
- name: Create Release Coordination Issue
51+
uses: actions/github-script@v7
52+
with:
53+
github-token: ${{ github.token }}
54+
script: |
55+
const releaseName = '${{ github.event.inputs.releaseName }}';
56+
const issueBody = `${{ steps.issue_body.outputs.body }}`;
57+
58+
const issue = await github.rest.issues.create({
59+
owner: context.repo.owner,
60+
repo: context.repo.repo,
61+
title: `Release ${releaseName} - Coordination`,
62+
body: issueBody,
63+
labels: ['release']
64+
});
65+
66+
console.log(`Created issue #${issue.data.number}`);
67+
2168
- name: Create Release Draft
2269
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # v1
2370
with:
2471
token: ${{ github.token }}
2572
draft: true
2673
name: ${{ github.event.inputs.releaseName }}
2774
body: |
28-
## ✨ Enhancements:
29-
* Feature 1
30-
* Feature 2
31-
32-
## 🐞 Bug fixes
33-
* Fix 1
34-
* Fix 2
35-
36-
## 💻 Development
37-
* Development experience related change 1
38-
* Development experience related change 2
39-
40-
## 📖 Documentation
41-
* Docs change 1
42-
* Docs change 2
75+
${{ steps.release_notes.outputs.template }}
4376
4477
<!-- end-release-notes -->
4578
**Container image:** :whale: [ghcr.io/headlamp-k8s/headlamp:v${{ github.event.inputs.releaseName }}](https://github.com/kubernetes-sigs/headlamp/pkgs/container/headlamp)

0 commit comments

Comments
 (0)