@@ -59,6 +59,18 @@ function getUploadAssetsWorkflowId() {
59
59
] )
60
60
}
61
61
62
+ /**
63
+ * These lines get printed in an Omicron PR, so any references to commits or
64
+ * issues need to be qualified.
65
+ */
66
+ function linkifyGitLog ( line : string ) : string {
67
+ const sha = line . slice ( 2 , 10 )
68
+ const rest = line . slice ( 11 ) . replace ( / # \d + / g, ( s ) => 'oxidecomputer/console' + s )
69
+ const shaLink = `[${ sha } ](https://github.com/oxidecomputer/console/commit/${ sha } )`
70
+
71
+ return `* ${ shaLink } ${ rest } `
72
+ }
73
+
62
74
// script starts here
63
75
64
76
const args = flags . parse ( Deno . args , {
@@ -108,9 +120,18 @@ if (oldCommit === newCommit) {
108
120
109
121
const commitRange = `${ oldCommit . slice ( 0 , 8 ) } ...${ newCommit . slice ( 0 , 8 ) } `
110
122
123
+ const commits = run ( 'git' , [ 'log' , '--graph' , '--oneline' , commitRange ] )
124
+ // commits are console commits, so they won't auto-link in omicron
125
+ const commitsMarkdown = commits . split ( '\n' ) . map ( linkifyGitLog ) . join ( '\n' )
126
+
127
+ const changesLine = `https://github.com/oxidecomputer/console/compare/${ commitRange } `
128
+
111
129
const branchName = 'bump-console-' + newCommit . slice ( 0 , 8 )
112
130
const prTitle = 'Bump web console' + ( args . message ? ` (${ args . message } )` : '' )
113
- const prBody = `Changes: https://github.com/oxidecomputer/console/compare/${ commitRange } `
131
+ const prBody = `${ changesLine } \n\n${ commitsMarkdown } `
132
+
133
+ // markdown links make the inline preview unreadable, so leave them out
134
+ const prBodyPreview = `${ changesLine } \n\n${ commits } `
114
135
115
136
console . log ( `
116
137
New contents of <omicron>/tools/console_version:
@@ -119,11 +140,12 @@ ${newVersionFile}
119
140
120
141
Branch: ${ branchName }
121
142
PR title: ${ prTitle }
122
- PR body: ${ prBody }
123
-
124
- Console commits since current pinned version:
125
143
126
- ${ run ( 'git' , [ 'log' , '--graph' , '--oneline' , '--color=always' , commitRange ] ) } `)
144
+ --------
145
+ PR body
146
+ --------
147
+
148
+ ${ prBodyPreview } `)
127
149
128
150
if ( args . dryRun || ! confirm ( '\nMake Omicron PR with these changes?' ) ) {
129
151
Deno . exit ( )
0 commit comments