Skip to content

Commit 64d4a36

Browse files
kirkrodriguesjunhaoliao
authored andcommitted
build(deps): Migrate yscope-log-viewer dependency from submodule to task-based source download. (y-scope#835)
Co-authored-by: Junhao Liao <[email protected]>
1 parent 639fd39 commit 64d4a36

File tree

4 files changed

+20
-46
lines changed

4 files changed

+20
-46
lines changed

.gitmodules

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@
2626
[submodule "components/core/submodules/outcome"]
2727
path = components/core/submodules/outcome
2828
url = https://github.com/ned14/outcome.git
29-
[submodule "components/log-viewer-webui/yscope-log-viewer"]
30-
path = components/log-viewer-webui/yscope-log-viewer
31-
url = https://github.com/y-scope/yscope-log-viewer.git
3229
[submodule "components/core/submodules/utfcpp"]
3330
path = components/core/submodules/utfcpp
3431
url = https://github.com/nemtrif/utfcpp.git
Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/src/dev-guide/components-log-viewer-webui.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ currently consists of a [React] client and a [Fastify] server.
99

1010
## Setup
1111

12+
Download the log-viewer's source code:
13+
14+
```bash
15+
task deps:log-viewer
16+
```
17+
1218
Install the app's dependencies:
1319

1420
```shell

taskfiles/deps.yaml

Lines changed: 14 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
version: "3"
2+
3+
includes:
4+
yscope-dev-utils: "../tools/yscope-dev-utils/exports/taskfiles/utils/utils.yaml"
5+
26
vars:
37
# Utility script path
48
G_DEP_DOWNLOAD_SCRIPT: "{{.ROOT_DIR}}/tools/scripts/deps-download/download-dep.py"
@@ -24,9 +28,9 @@ vars:
2428

2529
tasks:
2630
default:
27-
cmds:
28-
- task: "core"
29-
- task: "log-viewer"
31+
deps:
32+
- "core"
33+
- "log-viewer"
3034

3135
core:
3236
vars:
@@ -63,15 +67,14 @@ tasks:
6367
>> "{{.G_DEPS_CORE_CHECKSUM_FILE}}"
6468
6569
log-viewer:
66-
sources:
67-
- "{{.G_YSCOPE_LOG_VIEWER_CHECKSUM_FILE}}"
68-
generates: ["{{.G_DEPS_LOG_VIEWER_CHECKSUM_FILE}}"]
69-
deps: ["all-internal-deps"]
7070
cmds:
71-
- >-
72-
cat
73-
"{{.G_YSCOPE_LOG_VIEWER_CHECKSUM_FILE}}"
74-
>> "{{.G_DEPS_LOG_VIEWER_CHECKSUM_FILE}}"
71+
- task: "yscope-dev-utils:remote:download-and-extract-tar"
72+
vars:
73+
CHECKSUM_FILE: "{{.G_DEPS_LOG_VIEWER_CHECKSUM_FILE}}"
74+
FILE_SHA256: "de0600b505545f1bceb7ff5725941035f7c1dc875d08249d9b6d679e3ba77f26"
75+
OUTPUT_DIR: "{{.G_LOG_VIEWER_WEBUI_SRC_DIR}}/yscope-log-viewer"
76+
TAR_FILE: "{{.G_BUILD_DIR}}/yscope-log-viewer.tar.gz"
77+
URL: "https://github.com/y-scope/yscope-log-viewer/archive/969ff35.tar.gz"
7578

7679
# NOTE: `git submodule update` doesn't support parallel invocations, so we can't use it to
7780
# download submodules in parallel. This means:
@@ -101,7 +104,6 @@ tasks:
101104
- task: "sqlite3"
102105
- task: "utfcpp"
103106
- task: "yaml-cpp"
104-
- task: "yscope-log-viewer"
105107
- task: "ystdlib-cpp"
106108

107109
abseil-cpp:
@@ -437,36 +439,6 @@ tasks:
437439
CHECKSUM_FILE: "{{.CHECKSUM_FILE}}"
438440
INCLUDE_PATTERNS: ["{{.DEST}}"]
439441

440-
yscope-log-viewer:
441-
internal: true
442-
vars:
443-
CHECKSUM_FILE: "{{.G_YSCOPE_LOG_VIEWER_CHECKSUM_FILE}}"
444-
DEST: "{{.G_LOG_VIEWER_WEBUI_SRC_DIR}}/yscope-log-viewer"
445-
sources:
446-
- "{{.G_DEP_DOWNLOAD_SCRIPT}}"
447-
- "{{.G_UTILS_TASKFILE}}"
448-
- "{{.ROOT_DIR}}/taskfile.yaml"
449-
- "{{.TASKFILE}}"
450-
generates: ["{{.CHECKSUM_FILE}}"]
451-
deps:
452-
- ":init"
453-
- task: ":utils:checksum:validate"
454-
vars:
455-
CHECKSUM_FILE: "{{.CHECKSUM_FILE}}"
456-
INCLUDE_PATTERNS: ["{{.DEST}}"]
457-
cmds:
458-
- task: "download-dependency"
459-
vars:
460-
DEST: "{{.DEST}}"
461-
FLAGS: "--extract"
462-
SRC_NAME: "yscope-log-viewer-969ff35b2387bcdc3580b441907e3656640ce16d"
463-
SRC_URL: "https://github.com/y-scope/yscope-log-viewer/archive/969ff35.zip"
464-
# This command must be last
465-
- task: ":utils:checksum:compute"
466-
vars:
467-
CHECKSUM_FILE: "{{.CHECKSUM_FILE}}"
468-
INCLUDE_PATTERNS: ["{{.DEST}}"]
469-
470442
ystdlib-cpp:
471443
internal: true
472444
vars:

0 commit comments

Comments
 (0)