|
| 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); |
0 commit comments