Commit 9842f70
committed
refactor: improve code quality and performance in release scripts
### Code Quality Improvements
- Define PR status constants (PR_STATUS_*) across all scripts to replace literal strings
- Add default (*) cases to all case statements for safety
- Add explicit return statements to all functions
- Redirect all error messages to stderr (>&2)
- Resolve all SonarCloud issues in scripts 04, 05, 06, and cut-release.sh
### Performance Optimizations
- Implement repository reuse pattern in all scripts (01, 03, 04, 05, 06)
- Use git fetch + reset instead of full clone on subsequent runs
- 10-20x faster execution and ~90% less bandwidth usage after first run
### Documentation
- Update README with performance optimization details
- Add code quality standards section
- Document repository reuse behavior
### Scripts Updated
- 01-multicluster-global-hub.sh: Repository reuse
- 03-bundle.sh: Repository reuse
- 04-catalog.sh: Constants, default cases, repository reuse
- 05-grafana.sh: Constants, default cases, repository reuse
- 06-postgres-exporter.sh: Constants, default cases, repository reuse
- cut-release.sh: Default cases, return statements, stderr redirection
Fixes SonarCloud issues in PR #2082
Signed-off-by: myan <[email protected]>1 parent e6e6335 commit 9842f70
File tree
7 files changed
+318
-179
lines changed- .claude/skills/new-release
- scripts
7 files changed
+318
-179
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
218 | 218 | | |
219 | 219 | | |
220 | 220 | | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
221 | 239 | | |
222 | 240 | | |
223 | 241 | | |
| |||
Lines changed: 40 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
74 | | - | |
| 74 | + | |
75 | 75 | | |
76 | | - | |
| 76 | + | |
77 | 77 | | |
78 | | - | |
| 78 | + | |
79 | 79 | | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | 80 | | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
89 | 104 | | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
| 105 | + | |
| 106 | + | |
94 | 107 | | |
95 | | - | |
96 | | - | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
97 | 118 | | |
98 | 119 | | |
99 | 120 | | |
100 | 121 | | |
101 | | - | |
| 122 | + | |
102 | 123 | | |
103 | 124 | | |
104 | | - | |
| 125 | + | |
105 | 126 | | |
106 | 127 | | |
107 | 128 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
68 | 79 | | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | 80 | | |
73 | | - | |
| 81 | + | |
74 | 82 | | |
75 | | - | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
76 | 86 | | |
77 | 87 | | |
78 | 88 | | |
| |||
0 commit comments