From b92e729cd491e8b7f486009560f761e436e09f05 Mon Sep 17 00:00:00 2001 From: Alexander Wang Date: Sat, 16 Dec 2023 15:15:18 -0800 Subject: [PATCH 1/3] Update next.md --- ci/release/changelogs/next.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/ci/release/changelogs/next.md b/ci/release/changelogs/next.md index 22610801f..542e47f97 100644 --- a/ci/release/changelogs/next.md +++ b/ci/release/changelogs/next.md @@ -1,10 +1,19 @@ +D2 0.6.3 allows you to make your own and customize existing D2 themes. Here's an example with some random color codes. + +Screen Shot 2023-12-16 at 3 13 04 PM + +> See [docs](https://d2lang.com/tour/themes/#special-themes) + +> [Playground link](https://play.d2lang.com/?script=rJLNjqM6EIX3fopS7joo4S8KVxqJBHiNkYVrwIpjW7aTTNTi3UcGDEn3SL2ZBQt_Ltepc4o7NbaADwLA4m2r5C_eTUcA1-MVt-qOxnCGNmCA076AzX9xfaiSeBNY7Fmen055ubDEszKr8vKwsNSzc1bvy2xhmWd1XtfH88Jyz5qmyY7VhsywLEeVXZUeyv1mgWPLNC6zJlvh2PO4O5fNcX0_qTdpmiT5UjrJN825qmY7A_HfQCS6hzKXyXmLQoBTDzQhCUsdCsHdaza2pxoLsE4ZZD8ZdTRcuKfA6HoTjmuBBThzw1lsSttQaa_cOTTkU3fY_ni9LsCiZP-wZpxAScElglbGURH83HgBH7OlHn_TTskhPPDeQBvVorVqzcQpQzv8Ekj7FFwyNN-nMbdf445eZvYW3oWjRVH3SiII1VkyEHKzYVHzBBqNVZIAPDhzfQH7ZBfqfNd519Hrmq_0gtBSIb5UvaUV-Zho6-eZBEdz1hl1wS2jti8g8VJUc7Bo7t-1YtxqQZ-f6r2xyQW3jkynsBtNO_z_r6EOJPzF0XtuvuUqQP4EAAD__w%3D%3D&layout=elk&theme=1&) + #### Features ๐Ÿš€ - Themes can be customized via `d2-config` vars. [#1777](https://github.com/terrastruct/d2/pull/1777) -- Icons can be added for special objects (sql_table, class, code, markdown, latex). [#1774](https://github.com/terrastruct/d2/pull/1774) #### Improvements ๐Ÿงน +- Icons can be added for special objects (sql_table, class, code, markdown, latex). [#1774](https://github.com/terrastruct/d2/pull/1774) + #### Bugfixes โ›‘๏ธ - Fix importing files that override an existing value with an array. [#1762](https://github.com/terrastruct/d2/pull/1762) From 241987605b893f4dc030abd17ae6fbc45aa2ad65 Mon Sep 17 00:00:00 2001 From: Alexander Wang Date: Sat, 16 Dec 2023 15:16:17 -0800 Subject: [PATCH 2/3] v0.6.3 --- ci/release/changelogs/next.md | 18 ------------------ ci/release/changelogs/v0.6.3.md | 23 +++++++++++++++++++++++ 2 files changed, 23 insertions(+), 18 deletions(-) create mode 100644 ci/release/changelogs/v0.6.3.md diff --git a/ci/release/changelogs/next.md b/ci/release/changelogs/next.md index 542e47f97..f3c0d2a77 100644 --- a/ci/release/changelogs/next.md +++ b/ci/release/changelogs/next.md @@ -1,23 +1,5 @@ -D2 0.6.3 allows you to make your own and customize existing D2 themes. Here's an example with some random color codes. - -Screen Shot 2023-12-16 at 3 13 04 PM - -> See [docs](https://d2lang.com/tour/themes/#special-themes) - -> [Playground link](https://play.d2lang.com/?script=rJLNjqM6EIX3fopS7joo4S8KVxqJBHiNkYVrwIpjW7aTTNTi3UcGDEn3SL2ZBQt_Ltepc4o7NbaADwLA4m2r5C_eTUcA1-MVt-qOxnCGNmCA076AzX9xfaiSeBNY7Fmen055ubDEszKr8vKwsNSzc1bvy2xhmWd1XtfH88Jyz5qmyY7VhsywLEeVXZUeyv1mgWPLNC6zJlvh2PO4O5fNcX0_qTdpmiT5UjrJN825qmY7A_HfQCS6hzKXyXmLQoBTDzQhCUsdCsHdaza2pxoLsE4ZZD8ZdTRcuKfA6HoTjmuBBThzw1lsSttQaa_cOTTkU3fY_ni9LsCiZP-wZpxAScElglbGURH83HgBH7OlHn_TTskhPPDeQBvVorVqzcQpQzv8Ekj7FFwyNN-nMbdf445eZvYW3oWjRVH3SiII1VkyEHKzYVHzBBqNVZIAPDhzfQH7ZBfqfNd519Hrmq_0gtBSIb5UvaUV-Zho6-eZBEdz1hl1wS2jti8g8VJUc7Bo7t-1YtxqQZ-f6r2xyQW3jkynsBtNO_z_r6EOJPzF0XtuvuUqQP4EAAD__w%3D%3D&layout=elk&theme=1&) - #### Features ๐Ÿš€ -- Themes can be customized via `d2-config` vars. [#1777](https://github.com/terrastruct/d2/pull/1777) - #### Improvements ๐Ÿงน -- Icons can be added for special objects (sql_table, class, code, markdown, latex). [#1774](https://github.com/terrastruct/d2/pull/1774) - #### Bugfixes โ›‘๏ธ - -- Fix importing files that override an existing value with an array. [#1762](https://github.com/terrastruct/d2/pull/1762) -- Fixes missing unfilled triangle arrowheads when sketch flag is on. [#1763](https://github.com/terrastruct/d2/pull/1763) -- Fixes a bug where the render target could be incorrect if the target path contains "index". [#1764](https://github.com/terrastruct/d2/pull/1764) -- Fixes ELK layout with outside labels/icons. [#1776](https://github.com/terrastruct/d2/pull/1776) -- Fixes a bug where an edge could become disconnected with dagre layout and direction right. [#1778](https://github.com/terrastruct/d2/pull/1778) diff --git a/ci/release/changelogs/v0.6.3.md b/ci/release/changelogs/v0.6.3.md new file mode 100644 index 000000000..542e47f97 --- /dev/null +++ b/ci/release/changelogs/v0.6.3.md @@ -0,0 +1,23 @@ +D2 0.6.3 allows you to make your own and customize existing D2 themes. Here's an example with some random color codes. + +Screen Shot 2023-12-16 at 3 13 04 PM + +> See [docs](https://d2lang.com/tour/themes/#special-themes) + +> [Playground link](https://play.d2lang.com/?script=rJLNjqM6EIX3fopS7joo4S8KVxqJBHiNkYVrwIpjW7aTTNTi3UcGDEn3SL2ZBQt_Ltepc4o7NbaADwLA4m2r5C_eTUcA1-MVt-qOxnCGNmCA076AzX9xfaiSeBNY7Fmen055ubDEszKr8vKwsNSzc1bvy2xhmWd1XtfH88Jyz5qmyY7VhsywLEeVXZUeyv1mgWPLNC6zJlvh2PO4O5fNcX0_qTdpmiT5UjrJN825qmY7A_HfQCS6hzKXyXmLQoBTDzQhCUsdCsHdaza2pxoLsE4ZZD8ZdTRcuKfA6HoTjmuBBThzw1lsSttQaa_cOTTkU3fY_ni9LsCiZP-wZpxAScElglbGURH83HgBH7OlHn_TTskhPPDeQBvVorVqzcQpQzv8Ekj7FFwyNN-nMbdf445eZvYW3oWjRVH3SiII1VkyEHKzYVHzBBqNVZIAPDhzfQH7ZBfqfNd519Hrmq_0gtBSIb5UvaUV-Zho6-eZBEdz1hl1wS2jti8g8VJUc7Bo7t-1YtxqQZ-f6r2xyQW3jkynsBtNO_z_r6EOJPzF0XtuvuUqQP4EAAD__w%3D%3D&layout=elk&theme=1&) + +#### Features ๐Ÿš€ + +- Themes can be customized via `d2-config` vars. [#1777](https://github.com/terrastruct/d2/pull/1777) + +#### Improvements ๐Ÿงน + +- Icons can be added for special objects (sql_table, class, code, markdown, latex). [#1774](https://github.com/terrastruct/d2/pull/1774) + +#### Bugfixes โ›‘๏ธ + +- Fix importing files that override an existing value with an array. [#1762](https://github.com/terrastruct/d2/pull/1762) +- Fixes missing unfilled triangle arrowheads when sketch flag is on. [#1763](https://github.com/terrastruct/d2/pull/1763) +- Fixes a bug where the render target could be incorrect if the target path contains "index". [#1764](https://github.com/terrastruct/d2/pull/1764) +- Fixes ELK layout with outside labels/icons. [#1776](https://github.com/terrastruct/d2/pull/1776) +- Fixes a bug where an edge could become disconnected with dagre layout and direction right. [#1778](https://github.com/terrastruct/d2/pull/1778) From e711b9754b6c25633db6fd67ebc004c3a4573359 Mon Sep 17 00:00:00 2001 From: Alexander Wang Date: Mon, 18 Dec 2023 14:46:56 -0800 Subject: [PATCH 3/3] fix 1 race --- e2etests-cli/concurrent_buf.go | 26 ++++++++++++++++++ e2etests-cli/main_test.go | 18 ++++++------ .../TestCLI_E2E/internal_linked_pdf.exp.pdf | Bin 66069 -> 66069 bytes .../testdata/TestCLI_E2E/no-nav-pdf.exp.pdf | Bin 96035 -> 96035 bytes .../testdata/TestCLI_E2E/no-nav-pptx.exp.pptx | Bin 122134 -> 122135 bytes .../TestCLI_E2E/renamed-board.exp.pdf | Bin 109973 -> 109973 bytes 6 files changed, 35 insertions(+), 9 deletions(-) create mode 100644 e2etests-cli/concurrent_buf.go diff --git a/e2etests-cli/concurrent_buf.go b/e2etests-cli/concurrent_buf.go new file mode 100644 index 000000000..7474e9d5e --- /dev/null +++ b/e2etests-cli/concurrent_buf.go @@ -0,0 +1,26 @@ +package e2etests_cli + +import "sync" + +// stderrWrapper lets stderr be read/write concurrently +type stderrWrapper struct { + msg string + m sync.Mutex +} + +func (e *stderrWrapper) Write(p []byte) (n int, err error) { + e.m.Lock() + defer e.m.Unlock() + e.msg += string(p) + return len(p), nil +} + +func (e *stderrWrapper) Reset() { + e.msg = "" +} + +func (e *stderrWrapper) Read() string { + e.m.Lock() + defer e.m.Unlock() + return e.msg +} diff --git a/e2etests-cli/main_test.go b/e2etests-cli/main_test.go index 8da9444b2..a47f2f819 100644 --- a/e2etests-cli/main_test.go +++ b/e2etests-cli/main_test.go @@ -881,7 +881,7 @@ layers: { c -> b } }`) - stderr := &bytes.Buffer{} + stderr := &stderrWrapper{} tms := testMain(dir, env, "--watch", "--browser=0", "index.d2") tms.Stderr = stderr @@ -935,7 +935,7 @@ layers: { c -> b } }`) - stderr := &bytes.Buffer{} + stderr := &stderrWrapper{} tms := testMain(dir, env, "--watch", "--browser=0", "index.d2") tms.Stderr = stderr @@ -988,7 +988,7 @@ layers: { c -> b } }`) - stderr := &bytes.Buffer{} + stderr := &stderrWrapper{} tms := testMain(dir, env, "--watch", "--browser=0", "index.d2") tms.Stderr = stderr @@ -1036,7 +1036,7 @@ layers: { writeFile(t, dir, "b.d2", ` x `) - stderr := &bytes.Buffer{} + stderr := &stderrWrapper{} tms := testMain(dir, env, "--watch", "--browser=0", "a.d2") tms.Stderr = stderr @@ -1202,26 +1202,26 @@ func getNumBoards(svg string) int { var errRE = regexp.MustCompile(`err:`) -func waitLogs(ctx context.Context, buf *bytes.Buffer, pattern *regexp.Regexp) (string, error) { +func waitLogs(ctx context.Context, stream *stderrWrapper, pattern *regexp.Regexp) (string, error) { ticker := time.NewTicker(10 * time.Millisecond) defer ticker.Stop() var match string for i := 0; i < 1000 && match == ""; i++ { select { case <-ticker.C: - out := buf.String() + out := stream.Read() match = pattern.FindString(out) errMatch := errRE.FindString(out) if errMatch != "" { - return "", errors.New(buf.String()) + return "", errors.New(out) } case <-ctx.Done(): ticker.Stop() - return "", fmt.Errorf("could not match pattern in log. logs: %s", buf.String()) + return "", fmt.Errorf("could not match pattern in log. logs: %s", stream.Read()) } } if match == "" { - return "", errors.New(buf.String()) + return "", errors.New(stream.Read()) } return match, nil diff --git a/e2etests-cli/testdata/TestCLI_E2E/internal_linked_pdf.exp.pdf b/e2etests-cli/testdata/TestCLI_E2E/internal_linked_pdf.exp.pdf index a0e3775ea0dc24f8e134c6524cf32b466d3bd151..4cf0f8d375cf10f549fc44c635014860e5eaa480 100644 GIT binary patch delta 62 zcmbQ*!ZNjmWy8b2lZE~nOuqluaI(|CtI8IJCMG7P#+qFEzWFIGi6yBD8ZK5w21dq) OMut$i%~t4G_G=7)BFfum1Tu;!PVHqhn4G^xW$FXQ z!pUo-_!&($?~!VrINddn(O`4_8o7|^Yl;}}Ga66tDP}ZeG@QP#m@!@1!qCLT#MDTW zOW!v?#U-&MRYAkW%E-XT*wDxjD!1LEgwd2q*T~$+(nP@k1QhZVxWEi!QwtMQG%<5y MV*|_StI8NF0jB*oLjV8( delta 180 zcmZ4dj&<=n)(zrP)BEHYRVGLEG)&$p#kcuIPuaxD^Ro=L14ZRRCbRVzOg^8bJlRUB ze)6pzzRky_Zun1+lVdd4d_K!uar&Af#`}zh(|d{;4H=E6?<;0ZS2i&;Gcq+b(d5$i z%};SjEJ;<+aIrEnFfukYGK9))_b6dBWzsbu#!3JV6gWiy diff --git a/e2etests-cli/testdata/TestCLI_E2E/no-nav-pptx.exp.pptx b/e2etests-cli/testdata/TestCLI_E2E/no-nav-pptx.exp.pptx index b84b1fd4367b68abda1e6ca10f3feba889af6b87..0d0f5f7cc2b57084d8e9d765205b9e6a30a5b645 100644 GIT binary patch delta 472 zcmV;}0Vn>Jx(AoK2Y|Ez7RP_jZreN%#P4|uf_I6M?C*m?*b2}FIW<6lx@fN~xsloM zAINniy?r6NV&XKn9v3t7;|?k9ZzpTW3&fzd|&W&wo~DA)q6LZQ+(SS1TKoTJGQB^em7;4rbaZW%3JglN-;fvm7=veh^T z_|U$JSBWX^GL$M5G00&VZ zC^Bk1k-LsmWNDW;W2!U44Yl+(AM}<{4l^R*gID@VgZebTU+-^22}XF)%cs}3*;dAN z<@{Eca-hhRG{3yls(jykzB}I2zH7Qo)pk|8JGNWC-SYpMs@W~^rdf8rg1kf9KTG`^ zd!@V(gh)eOxC!>W!TXJV&IG=c>pU??E|>UnkRoBt-w_KIItk( zvlxJNO>@mGpilw@TcA}aRQd+1WWk1GG#R2K0|OQuCf3$1qs5C5ZTc{f6?RUx8s`8X z+E?)`F(qBh<2csiCfmEFY1yxbZ{Kt6O1tIiB+x!bw@PxS#~~yyhGc6OMQ;L zQeKNmfiUxBRS diff --git a/e2etests-cli/testdata/TestCLI_E2E/renamed-board.exp.pdf b/e2etests-cli/testdata/TestCLI_E2E/renamed-board.exp.pdf index bc31d49cd3d863358f9f23a3a54cb66991b2cd10..fc1d6dc01eb1c900b05be9628efdeb77299e58c4 100644 GIT binary patch delta 68 zcmbPwn{DcCwuUW?msU<^S;c5D{lZE{qvz>% delta 68 zcmbPwn{DcCwuUW?msU<^S;c5D{lZE{qvz>%