From 989e9a73b8cb2f7df82091710d91998b935ed4c1 Mon Sep 17 00:00:00 2001 From: Marco Salazar Date: Fri, 3 Nov 2023 16:24:32 -0400 Subject: [PATCH 1/2] patch dagre --- js_modules/dagster-ui/package.json | 8 +- .../dagster-ui/packages/ui-core/package.json | 2 +- .../dagster-ui/patches/dagre+0.8.5.patch | 15 +++ js_modules/dagster-ui/yarn.lock | 122 +++++++++++++++++- 4 files changed, 139 insertions(+), 8 deletions(-) create mode 100644 js_modules/dagster-ui/patches/dagre+0.8.5.patch diff --git a/js_modules/dagster-ui/package.json b/js_modules/dagster-ui/package.json index 23e865e3e0111..96e3e6a518977 100644 --- a/js_modules/dagster-ui/package.json +++ b/js_modules/dagster-ui/package.json @@ -9,7 +9,8 @@ "post-build": "cd ../../python_modules/dagster-webserver/dagster_webserver && rm -rf webapp && mkdir -p webapp && cp -r ../../../js_modules/dagster-ui/packages/app-oss/build ./webapp/ && mkdir -p webapp/build/vendor && cp -r graphql-playground ./webapp/build/vendor && cp ../../../js_modules/dagster-ui/packages/app-oss/csp-header.txt ./webapp/build", "lint": "yarn workspace @dagster-io/app-oss lint && yarn workspace @dagster-io/ui-core lint && yarn workspace @dagster-io/ui-components lint", "start": "yarn workspace @dagster-io/app-oss start", - "ts": "yarn workspace @dagster-io/app-oss ts && yarn workspace @dagster-io/ui-components ts" + "ts": "yarn workspace @dagster-io/app-oss ts && yarn workspace @dagster-io/ui-components ts", + "postinstall": "patch-package" }, "workspaces": { "packages": [ @@ -18,9 +19,12 @@ }, "packageManager": "yarn@3.6.4", "dependencies": { - "graphql.macro": "^1.4.2" + "graphql.macro": "^1.4.2", + "patch-package": "^8.0.0", + "postinstall-postinstall": "^2.1.0" }, "devDependencies": { + "@types/dagre": "^0", "file-loader": "^6.2.0" } } diff --git a/js_modules/dagster-ui/packages/ui-core/package.json b/js_modules/dagster-ui/packages/ui-core/package.json index 39e951d56a55a..0f3a855fdd2b8 100644 --- a/js_modules/dagster-ui/packages/ui-core/package.json +++ b/js_modules/dagster-ui/packages/ui-core/package.json @@ -45,7 +45,7 @@ "codemirror": "^5.65.2", "color": "^3.0.0", "cronstrue": "^1.84.0", - "dagre": "^0.8.2", + "dagre": "^0.8.5", "date-fns": "^2.28.0", "dayjs": "^1.11.7", "deepmerge": "^4.2.2", diff --git a/js_modules/dagster-ui/patches/dagre+0.8.5.patch b/js_modules/dagster-ui/patches/dagre+0.8.5.patch new file mode 100644 index 0000000000000..fab38165260b3 --- /dev/null +++ b/js_modules/dagster-ui/patches/dagre+0.8.5.patch @@ -0,0 +1,15 @@ +diff --git a/node_modules/dagre/lib/order/index.js b/node_modules/dagre/lib/order/index.js +index 4ac2d9f..a2182fe 100644 +--- a/node_modules/dagre/lib/order/index.js ++++ b/node_modules/dagre/lib/order/index.js +@@ -73,7 +73,9 @@ function sweepLayerGraphs(layerGraphs, biasRight) { + function assignOrder(g, layering) { + _.forEach(layering, function(layer) { + _.forEach(layer, function(v, i) { +- g.node(v).order = i; ++ try { ++ g.node(v).order = i; ++ } catch (e) {} + }); + }); + } diff --git a/js_modules/dagster-ui/yarn.lock b/js_modules/dagster-ui/yarn.lock index 1d233a8b5c869..bc65dedc776ef 100644 --- a/js_modules/dagster-ui/yarn.lock +++ b/js_modules/dagster-ui/yarn.lock @@ -2265,8 +2265,11 @@ __metadata: version: 0.0.0-use.local resolution: "@dagster-io/dagster-ui-workspace@workspace:." dependencies: + "@types/dagre": ^0 file-loader: ^6.2.0 graphql.macro: ^1.4.2 + patch-package: ^8.0.0 + postinstall-postinstall: ^2.1.0 languageName: unknown linkType: soft @@ -2454,7 +2457,7 @@ __metadata: codemirror: ^5.65.2 color: ^3.0.0 cronstrue: ^1.84.0 - dagre: ^0.8.2 + dagre: ^0.8.5 date-fns: ^2.28.0 dayjs: ^1.11.7 deepmerge: ^4.2.2 @@ -2478,6 +2481,8 @@ __metadata: lru-cache: ^6.0.0 moment: ^2.29.4 moment-timezone: ^0.5.42 + patch-package: ^8.0.0 + postinstall-postinstall: ^2.1.0 prettier: ^3.0.3 qs: ^6.10.3 react: ^18.2.0 @@ -6694,6 +6699,13 @@ __metadata: languageName: node linkType: hard +"@types/dagre@npm:^0": + version: 0.7.51 + resolution: "@types/dagre@npm:0.7.51" + checksum: 6a23cc406082fe867dc0be0a117ae0c493bcfb6e08b83ea55a09b4f43e6eb5efc34a102d1a039fa82d2df700d55ee5481c0c3febdf710b972bb345c8a7f6c316 + languageName: node + linkType: hard + "@types/dagre@npm:^0.7.42": version: 0.7.49 resolution: "@types/dagre@npm:0.7.49" @@ -8020,6 +8032,13 @@ __metadata: languageName: node linkType: hard +"@yarnpkg/lockfile@npm:^1.1.0": + version: 1.1.0 + resolution: "@yarnpkg/lockfile@npm:1.1.0" + checksum: 05b881b4866a3546861fee756e6d3812776ea47fa6eb7098f983d6d0eefa02e12b66c3fff931574120f196286a7ad4879ce02743c8bb2be36c6a576c7852083a + languageName: node + linkType: hard + "abab@npm:^2.0.6": version: 2.0.6 resolution: "abab@npm:2.0.6" @@ -8760,6 +8779,13 @@ __metadata: languageName: node linkType: hard +"at-least-node@npm:^1.0.0": + version: 1.0.0 + resolution: "at-least-node@npm:1.0.0" + checksum: 463e2f8e43384f1afb54bc68485c436d7622acec08b6fad269b421cb1d29cebb5af751426793d0961ed243146fe4dc983402f6d5a51b720b277818dbf6f2e49e + languageName: node + linkType: hard + "atob@npm:^2.1.2": version: 2.1.2 resolution: "atob@npm:2.1.2" @@ -10045,6 +10071,13 @@ __metadata: languageName: node linkType: hard +"ci-info@npm:^3.7.0": + version: 3.9.0 + resolution: "ci-info@npm:3.9.0" + checksum: 6b19dc9b2966d1f8c2041a838217299718f15d6c4b63ae36e4674edd2bee48f780e94761286a56aa59eb305a85fbea4ddffb7630ec063e7ec7e7e5ad42549a87 + languageName: node + linkType: hard + "cipher-base@npm:^1.0.0, cipher-base@npm:^1.0.1, cipher-base@npm:^1.0.3": version: 1.0.4 resolution: "cipher-base@npm:1.0.4" @@ -10980,7 +11013,7 @@ __metadata: languageName: node linkType: hard -"dagre@npm:^0.8.2": +"dagre@npm:^0.8.5": version: 0.8.5 resolution: "dagre@npm:0.8.5" dependencies: @@ -13238,6 +13271,15 @@ __metadata: languageName: node linkType: hard +"find-yarn-workspace-root@npm:^2.0.0": + version: 2.0.0 + resolution: "find-yarn-workspace-root@npm:2.0.0" + dependencies: + micromatch: ^4.0.2 + checksum: fa5ca8f9d08fe7a54ce7c0a5931ff9b7e36f9ee7b9475fb13752bcea80ec6b5f180fa5102d60b376d5526ce924ea3fc6b19301262efa0a5d248dd710f3644242 + languageName: node + linkType: hard + "flat-cache@npm:^3.0.4": version: 3.0.4 resolution: "flat-cache@npm:3.0.4" @@ -13402,6 +13444,18 @@ __metadata: languageName: node linkType: hard +"fs-extra@npm:^9.0.0": + version: 9.1.0 + resolution: "fs-extra@npm:9.1.0" + dependencies: + at-least-node: ^1.0.0 + graceful-fs: ^4.2.0 + jsonfile: ^6.0.1 + universalify: ^2.0.0 + checksum: ba71ba32e0faa74ab931b7a0031d1523c66a73e225de7426e275e238e312d07313d2da2d33e34a52aa406c8763ade5712eb3ec9ba4d9edce652bcacdc29e6b20 + languageName: node + linkType: hard + "fs-minipass@npm:^2.0.0": version: 2.1.0 resolution: "fs-minipass@npm:2.1.0" @@ -15222,7 +15276,7 @@ __metadata: languageName: node linkType: hard -"is-wsl@npm:^2.2.0": +"is-wsl@npm:^2.1.1, is-wsl@npm:^2.2.0": version: 2.2.0 resolution: "is-wsl@npm:2.2.0" dependencies: @@ -16647,7 +16701,7 @@ __metadata: languageName: node linkType: hard -"json-stable-stringify@npm:^1.0.1": +"json-stable-stringify@npm:^1.0.1, json-stable-stringify@npm:^1.0.2": version: 1.0.2 resolution: "json-stable-stringify@npm:1.0.2" dependencies: @@ -16750,6 +16804,15 @@ __metadata: languageName: node linkType: hard +"klaw-sync@npm:^6.0.0": + version: 6.0.0 + resolution: "klaw-sync@npm:6.0.0" + dependencies: + graceful-fs: ^4.1.11 + checksum: 0da397f8961313c3ef8f79fb63af9002cde5a8fb2aeb1a37351feff0dd6006129c790400c3f5c3b4e757bedcabb13d21ec0a5eaef5a593d59515d4f2c291e475 + languageName: node + linkType: hard + "kleur@npm:^3.0.3": version: 3.0.3 resolution: "kleur@npm:3.0.3" @@ -18673,6 +18736,16 @@ __metadata: languageName: node linkType: hard +"open@npm:^7.4.2": + version: 7.4.2 + resolution: "open@npm:7.4.2" + dependencies: + is-docker: ^2.0.0 + is-wsl: ^2.1.1 + checksum: 3333900ec0e420d64c23b831bc3467e57031461d843c801f569b2204a1acc3cd7b3ec3c7897afc9dde86491dfa289708eb92bba164093d8bd88fb2c231843c91 + languageName: node + linkType: hard + "open@npm:^8.0.4, open@npm:^8.4.0": version: 8.4.2 resolution: "open@npm:8.4.2" @@ -18967,6 +19040,31 @@ __metadata: languageName: node linkType: hard +"patch-package@npm:^8.0.0": + version: 8.0.0 + resolution: "patch-package@npm:8.0.0" + dependencies: + "@yarnpkg/lockfile": ^1.1.0 + chalk: ^4.1.2 + ci-info: ^3.7.0 + cross-spawn: ^7.0.3 + find-yarn-workspace-root: ^2.0.0 + fs-extra: ^9.0.0 + json-stable-stringify: ^1.0.2 + klaw-sync: ^6.0.0 + minimist: ^1.2.6 + open: ^7.4.2 + rimraf: ^2.6.3 + semver: ^7.5.3 + slash: ^2.0.0 + tmp: ^0.0.33 + yaml: ^2.2.2 + bin: + patch-package: index.js + checksum: d23cddc4d1622e2d8c7ca31b145c6eddb24bd271f69905e766de5e1f199f0b9a5479a6a6939ea857288399d4ed249285639d539a2c00fbddb7daa39934b007a2 + languageName: node + linkType: hard + "path-browserify@npm:^1.0.1": version: 1.0.1 resolution: "path-browserify@npm:1.0.1" @@ -19621,6 +19719,13 @@ __metadata: languageName: node linkType: hard +"postinstall-postinstall@npm:^2.1.0": + version: 2.1.0 + resolution: "postinstall-postinstall@npm:2.1.0" + checksum: e1d34252cf8d2c5641c7d2db7426ec96e3d7a975f01c174c68f09ef5b8327bc8d5a9aa2001a45e693db2cdbf69577094d3fe6597b564ad2d2202b65fba76134b + languageName: node + linkType: hard + "prelude-ls@npm:^1.2.1": version: 1.2.1 resolution: "prelude-ls@npm:1.2.1" @@ -21191,7 +21296,7 @@ __metadata: languageName: node linkType: hard -"rimraf@npm:^2.6.1": +"rimraf@npm:^2.6.1, rimraf@npm:^2.6.3": version: 2.7.1 resolution: "rimraf@npm:2.7.1" dependencies: @@ -24508,6 +24613,13 @@ __metadata: languageName: node linkType: hard +"yaml@npm:^2.2.2": + version: 2.3.4 + resolution: "yaml@npm:2.3.4" + checksum: e6d1dae1c6383bcc8ba11796eef3b8c02d5082911c6723efeeb5ba50fc8e881df18d645e64de68e421b577296000bea9c75d6d9097c2f6699da3ae0406c030d8 + languageName: node + linkType: hard + "yargs-parser@npm:^18.1.2": version: 18.1.3 resolution: "yargs-parser@npm:18.1.3" From 995db1aa48b0985441bd395bbf7797c3811032cb Mon Sep 17 00:00:00 2001 From: Marco Salazar Date: Fri, 3 Nov 2023 17:14:18 -0400 Subject: [PATCH 2/2] yarn lock --- js_modules/dagster-ui/yarn.lock | 2 -- 1 file changed, 2 deletions(-) diff --git a/js_modules/dagster-ui/yarn.lock b/js_modules/dagster-ui/yarn.lock index bc65dedc776ef..88e6d8d8793ec 100644 --- a/js_modules/dagster-ui/yarn.lock +++ b/js_modules/dagster-ui/yarn.lock @@ -2481,8 +2481,6 @@ __metadata: lru-cache: ^6.0.0 moment: ^2.29.4 moment-timezone: ^0.5.42 - patch-package: ^8.0.0 - postinstall-postinstall: ^2.1.0 prettier: ^3.0.3 qs: ^6.10.3 react: ^18.2.0