Skip to content

Commit a1358ef

Browse files
yjp20cjquines
andauthored
feat: improve comment contents-again (#75)
* feat: improve comment contents-again * lint and test --------- Co-authored-by: CJ Quines <cj@cjquines.com>
1 parent f20e222 commit a1358ef

4 files changed

Lines changed: 418 additions & 482 deletions

File tree

src/__snapshots__/comment.test.ts.snap

Lines changed: 47 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -3,52 +3,59 @@
33
exports[`printComment > should print comment 1`] = `
44
"<h3>✱ Stainless SDK previews</h3>
55
6-
<i>Last updated: 2000-01-01 00:00:00 UTC</i>
6+
This PR will update the <code>test-project</code> SDKs with the following commit message.
77
8-
💬 This PR updates <code>test-project</code> SDKs with this commit message. To change the commit message, edit this comment.
9-
10-
<!-- Replace the contents of this code block with your commit message. Use a commit message in the conventional commits format: https://www.conventionalcommits.org/en/v1.0.0/ -->
118
\`\`\`
129
Update API endpoints
1310
\`\`\`
1411
15-
❗ <b>Failures.</b> See the <a href="https://app.stainless.com/test-org/test-project/studio?branch=feature-branch">Stainless Studio</a> for details.
12+
Edit this comment to update it.
1613
17-
<ul>
18-
<li>test-project-python: Fatal error.</li>
19-
</ul>
14+
<details open>
15+
<summary>❗ <b>test-project-python</b> <a href="https://app.stainless.com/test-org/test-project/studio?language=python&branch=feature-branch">studio</a></summary>
2016
21-
⚡ <b>Merge conflicts.</b> You can resolve conflicts now; if you do, <a href="https://github.com/test-org/test-sdk/actions/runs/200">re-run this GitHub action</a> to get diffs. If you merge before resolving conflicts, new conflict PRs will be created after merging.
17+
<blockquote>
2218
23-
<ul>
24-
<li>test-project-go: <a href="https://github.com/test-org/test-sdk/pull/1">Link to conflict.</a></li>
25-
</ul>
19+
<i>Code was not generated because there was a fatal error.</i>
20+
<code>generate ❗</code> → <code>lint ⏳</code> → <code>test ⏳</code>
2621
27-
⚠️ <b>Regressions.</b>
22+
</blockquote>
23+
24+
</details>
2825
2926
<details open>
30-
<summary>test-project-typescript: <a href="https://app.stainless.com/test-org/test-project/studio?language=typescript&branch=feature-branch">studio</a> · <a href="https://github.com/test-org/test-sdk/tree/feature-branch">code</a> · <a href="https://github.com/test-org/test-sdk/compare/base-branch..feature-branch">diff</a></summary>
27+
<summary>⚠️ <b>test-project-go</b> <a href="https://app.stainless.com/test-org/test-project/studio?language=go&branch=feature-branch">studio</a> · <a href="#">conflict</a></summary>
3128
3229
<blockquote>
3330
34-
Build: <a href="https://github.com/test-org/test-sdk/actions/runs/200">✅ success</a> → <a href="https://github.com/test-org/test-sdk/actions/runs/211">❗ failure</a>
31+
<i>There was a conflict between your custom code and your generated changes.</i>
32+
<i>You don't need to resolve this conflict right now, but you will need to resolve it for your changes to be released to your users. Read more about why this happened <a href="https://www.stainless.com/docs/guides/add-custom-code">here</a>.</i>
33+
<code>generate ⚠️</code> → <code>lint ⏳</code> → <code>test ⏳</code>
3534
36-
<details>
37-
<summary>New diagnostics (1 error, 1 warning)</summary>
35+
</blockquote>
3836
39-
<blockquote>
37+
</details>
4038
41-
See the Stainless Studio for more details.
39+
<details open>
40+
<summary>⚠️ <b>test-project-typescript</b> <a href="https://app.stainless.com/test-org/test-project/studio?language=typescript&branch=feature-branch">studio</a> · <a href="https://github.com/test-org/test-sdk/tree/feature-branch">code</a> · <a href="https://github.com/test-org/test-sdk/compare/base-branch..feature-branch">diff</a></summary>
4241
43-
<ul>
44-
<li>❗ <b>Error</b>: Error</li>
45-
<li>⚠️ <b>Warning</b>: Other warning</li>
46-
</ul>
42+
<blockquote>
4743
48-
</blockquote>
44+
<i>There was a regression in your SDK.</i>
45+
<a href="https://github.com/test-org/test-sdk/actions/runs/210"><code>generate ✅</code></a> → <a href="https://github.com/test-org/test-sdk/actions/runs/212"><code>lint ✅</code></a> → <a href="https://github.com/test-org/test-sdk/actions/runs/213"><code>test ✅</code></a> → <a href="https://github.com/test-org/test-sdk/actions/runs/211"><code>build ❗</code></a>
46+
<details>
47+
<summary>New diagnostics (1 error, 1 warning)</summary>
4948
50-
</details>
49+
<table>
50+
<tr>
51+
<td>❗ <b>Error</b>: Error</td>
52+
</tr>
53+
<tr>
54+
<td>⚠️ <b>Warning</b>: Other warning</td>
55+
</tr>
56+
</table>
5157
58+
</details>
5259
<details>
5360
<summary>Installation</summary>
5461
@@ -62,9 +69,21 @@ npm install https://github.com/test-org/test-sdk.git#feature-branch
6269
6370
</details>
6471
65-
✅ <b>Successes.</b>
72+
<details>
73+
<summary>✅ <b>test-project-kotlin</b> <a href="https://app.stainless.com/test-org/test-project/studio?language=kotlin&branch=feature-branch">studio</a> · <a href="https://github.com/test-org/test-sdk/tree/feature-branch">code</a></summary>
74+
75+
<blockquote>
76+
77+
<i>Your SDK built successfully.</i>
78+
<code>generate ✅</code> → <a href="https://github.com/test-org/test-sdk/actions/runs/213"><code>lint ✅</code></a> → <a href="https://github.com/test-org/test-sdk/actions/runs/214"><code>test ✅</code></a>
79+
80+
</blockquote>
81+
82+
</details>
83+
84+
⏳ These are partial results; builds are still running.
6685
67-
- test-project-kotlin: <a href="https://app.stainless.com/test-org/test-project/studio?language=kotlin&branch=feature-branch">studio</a> · <a href="https://github.com/test-org/test-sdk/tree/feature-branch">code</a>
86+
<hr />
6887
69-
⏳ These are partial results; builds are still running."
88+
<i>This comment is auto-generated by GitHub Actions and is automatically kept up to date as you push.<br/>Last updated: 2000-01-01 00:00:00 UTC</i>"
7089
`;

src/comment.test.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,11 @@ describe("printComment", () => {
3030
expect(printComment({ noChanges: true })).toMatchInlineSnapshot(`
3131
"<h3>✱ Stainless SDK previews</h3>
3232
33-
<i>Last updated: 2000-01-01 00:00:00 UTC</i>
33+
No changes were made to the SDKs.
3434
35-
No changes were made to the SDKs."
35+
<hr />
36+
37+
<i>This comment is auto-generated by GitHub Actions and is automatically kept up to date as you push.<br/>Last updated: 2000-01-01 00:00:00 UTC</i>"
3638
`);
3739
});
3840

0 commit comments

Comments
 (0)