Skip to content

Commit

Permalink
refactor lookout/ui/ to lookoutui/ (#4199)
Browse files Browse the repository at this point in the history
* rename lookout/ui to lookoutui (#349)

---------

Co-authored-by: Eleanor Pratt <[email protected]>
  • Loading branch information
eleanorpratt and Eleanor Pratt authored Feb 11, 2025
1 parent 723cf64 commit 5c94cca
Show file tree
Hide file tree
Showing 173 changed files with 46 additions and 43 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ jobs:
with:
node-version: 22.12.0
cache: yarn
cache-dependency-path: ./internal/lookout/ui/yarn.lock
cache-dependency-path: ./internal/lookoutui/yarn.lock

- name: Install Dependencies
working-directory: ./internal/lookout/ui
working-directory: ./internal/lookoutui
run: |
yarn install --frozen-lockfile
- name: Generating TypeScript lint results as summary
working-directory: ./internal/lookout/ui
working-directory: ./internal/lookoutui
run: |
yarn lint &> lint_results.txt || true
lint_results=$(cat lint_results.txt)
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,18 @@ jobs:
with:
node-version: 22.12.0
cache: yarn
cache-dependency-path: ./internal/lookout/ui/yarn.lock
cache-dependency-path: ./internal/lookoutui/yarn.lock

- name: Install Dependencies And Run Unit Tests
run: |
yarn install --frozen-lockfile && yarn openapi && CI=true yarn test --reporter=junit
working-directory: ./internal/lookout/ui
working-directory: ./internal/lookoutui

- name: Publish JUnit Report
uses: mikepenz/action-junit-report@v4
if: always()
with:
report_paths: ./internal/lookout/ui/junit.xml
report_paths: ./internal/lookoutui/junit.xml
fail_on_failure: true
require_tests: true
detailed_summary: true
Expand All @@ -43,7 +43,7 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: ts-unit-test-reports
path: ./internal/lookout/ui/junit.xml
path: ./internal/lookoutui/junit.xml
if-no-files-found: error

go-unit-tests:
Expand Down
6 changes: 3 additions & 3 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ dockers:
- config/logging.yaml
- config/lookoutv2/config.yaml
- config/lookoutingesterv2/config.yaml
- internal/lookout/ui
- internal/lookoutui
- pkg/api/api.swagger.json
- pkg/api/binoculars/api.swagger.json
- pkg/api/schedulerobjects/api.swagger.json
Expand Down Expand Up @@ -256,7 +256,7 @@ dockers:
- config/scheduleringester/config.yaml
- config/lookoutv2/config.yaml
- config/lookoutingesterv2/config.yaml
- internal/lookout/ui
- internal/lookoutui
- pkg/api/api.swagger.json
- pkg/api/binoculars/api.swagger.json
- pkg/api/schedulerobjects/api.swagger.json
Expand Down Expand Up @@ -358,7 +358,7 @@ dockers:
- lookoutv2
- lookoutingesterv2
extra_files:
- internal/lookout/ui
- internal/lookoutui
- pkg/api/api.swagger.json
- pkg/api/binoculars/api.swagger.json
- pkg/api/schedulerobjects/api.swagger.json
Expand Down
6 changes: 3 additions & 3 deletions .run/LookoutV2 UI.run.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
<configuration default="false" name="LookoutV2 UI" type="ShConfigurationType">
<option name="SCRIPT_TEXT" value="" />
<option name="INDEPENDENT_SCRIPT_PATH" value="true" />
<option name="SCRIPT_PATH" value="$PROJECT_DIR$/internal/lookout/ui/development-setup-and-start.sh" />
<option name="SCRIPT_PATH" value="$PROJECT_DIR$/internal/lookoutui/development-setup-and-start.sh" />
<option name="SCRIPT_OPTIONS" value="$ARMADA_NPM_REGISTRY" />
<option name="INDEPENDENT_SCRIPT_WORKING_DIRECTORY" value="true" />
<option name="SCRIPT_WORKING_DIRECTORY" value="$PROJECT_DIR$/internal/lookout/ui/" />
<option name="SCRIPT_WORKING_DIRECTORY" value="$PROJECT_DIR$/internal/lookoutui/" />
<option name="INDEPENDENT_INTERPRETER_PATH" value="true" />
<option name="INTERPRETER_PATH" value="/bin/bash" />
<option name="INTERPRETER_OPTIONS" value="" />
Expand All @@ -14,4 +14,4 @@
<envs />
<method v="2" />
</configuration>
</component>
</component>
10 changes: 5 additions & 5 deletions build/bundles/full/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,22 @@ FROM ${OPENAPI_BUILD_IMAGE} AS OPENAPI
LABEL org.opencontainers.image.title=armada-full-bundle
LABEL org.opencontainers.image.description="Armada Full Bundle"
LABEL org.opencontainers.image.url=https://hub.docker.com/r/gresearch/armada-full-bundle
COPY internal/lookout/ui /project/internal/lookout/ui
COPY internal/lookoutui /project/internal/lookoutui
COPY pkg/api/*.swagger.json /project/pkg/api/
COPY pkg/api/binoculars/*.swagger.json /project/pkg/api/binoculars/
COPY pkg/api/schedulerobjects/*.swagger.json /project/pkg/api/schedulerobjects/
RUN ./project/internal/lookout/ui/openapi.sh
RUN ./project/internal/lookoutui/openapi.sh

FROM ${NODE_BUILD_IMAGE} AS NODE
COPY --from=OPENAPI /project/internal/lookout/ui /ui/
WORKDIR /ui
COPY --from=OPENAPI /project/internal/lookoutui /lookoutui/
WORKDIR /lookoutui
RUN yarn install --immutable
RUN yarn build

FROM ${BASE_IMAGE}
RUN addgroup -S -g 2000 armada && adduser -S -u 1000 armada -G armada
USER armada
COPY --from=NODE /ui/build/ /app/internal/lookout/ui/build
COPY --from=NODE /lookoutui/build/ /app/internal/lookoutui/build

COPY server executor binoculars eventingester lookoutingesterv2 lookoutv2 scheduler scheduleringester armadactl /app/
COPY config/ /app/config/
Expand Down
10 changes: 5 additions & 5 deletions build/lookoutv2/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ ARG BASE_IMAGE=alpine:3.21.0

FROM ${OPENAPI_BUILD_IMAGE} AS OPENAPI

COPY internal/lookout/ui /project/internal/lookout/ui
COPY internal/lookoutui /project/internal/lookoutui
COPY pkg/api/*.swagger.json /project/pkg/api/
COPY pkg/api/binoculars/*.swagger.json /project/pkg/api/binoculars/
COPY pkg/api/schedulerobjects/*.swagger.json /project/pkg/api/schedulerobjects/
RUN ./project/internal/lookout/ui/openapi.sh
RUN ./project/internal/lookoutui/openapi.sh

FROM ${NODE_BUILD_IMAGE} AS NODE
COPY --from=OPENAPI /project/internal/lookout/ui /ui/
WORKDIR /ui
COPY --from=OPENAPI /project/internal/lookoutui /lookoutui/
WORKDIR /lookoutui
RUN yarn install --immutable
RUN yarn build

Expand All @@ -22,7 +22,7 @@ LABEL org.opencontainers.image.title=lookoutv2
LABEL org.opencontainers.image.description="Lookout V2"
LABEL org.opencontainers.image.url=https://hub.docker.com/r/gresearch/lookoutv2
USER armada
COPY --from=NODE /ui/build/ /app/internal/lookout/ui/build
COPY --from=NODE /lookoutui/build/ /app/internal/lookoutui/build
COPY lookoutv2 /app/
COPY config/lookoutv2/config.yaml /app/config/lookoutv2/config.yaml
COPY lookoutingesterv2 /app/
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ services:
depends_on:
- lookoutingesterv2
volumes:
- "./internal/lookout/ui/build:/app/internal/lookout/ui/build"
- "./internal/lookoutui/build:/app/internal/lookoutui/build"
- "go-cache:/root/.cache/go-build:rw"
- "gomod-cache:/go/pkg/mod:rw"
env_file:
Expand Down
4 changes: 2 additions & 2 deletions docs/developer/ui.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ You can also re-build a production build of the UI by running `mage ui` in the r
To quickly get started developing on the UI locally without having to build, ensure you have Docker, Node and Yarn installed for your platform, then run:

```bash
cd ./internal/lookout/ui
cd ./internal/lookoutui
yarn
yarn openapi
yarn dev
Expand All @@ -38,4 +38,4 @@ Make sure you scroll at the bottom to see it.

Note that you can have both `fakeData` and `debug` query parameters enabled at the same time: [http://localhost:3000/v2?fakeData=&debug=](http://localhost:3000/v2?fakeData=&debug=)

See [the README for the Lookout UI](../../internal/lookout/ui/README.md) for more information about UI development.
See [the README for the Lookout UI](../../internal/lookoutui/README.md) for more information about UI development.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/usr/local/bin/docker-entrypoint.sh generate \
-g typescript-fetch \
-i /project/pkg/api/api.swagger.json \
-o /project/internal/lookout/ui/src/openapi/armada
-o /project/internal/lookoutui/src/openapi/armada
/usr/local/bin/docker-entrypoint.sh generate \
-g typescript-fetch \
-i /project/pkg/api/binoculars/api.swagger.json \
-o /project/internal/lookout/ui/src/openapi/binoculars
-o /project/internal/lookoutui/src/openapi/binoculars
/usr/local/bin/docker-entrypoint.sh generate \
-g typescript-fetch \
-i /project/pkg/api/schedulerobjects/api.swagger.json \
-o /project/internal/lookout/ui/src/openapi/schedulerobjects
-o /project/internal/lookoutui/src/openapi/schedulerobjects
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
"build": "vite build",
"serve": "vite preview",
"test": "vitest",
"openapi": "docker run --rm -u $(id -u ${USER}):$(id -g ${USER}) -v \"${PWD}/../../../:/project\" openapitools/openapi-generator-cli:v5.4.0 /project/internal/lookout/ui/openapi.sh",
"openapi:win": "powershell -Command \"$uid = (New-Object System.Security.Principal.WindowsPrincipal([System.Security.Principal.WindowsIdentity]::GetCurrent())).Identity.User.Value; $gid = (Get-WmiObject Win32_UserAccount | Where-Object { $_.SID -eq $uid }).SID.Value; docker run --rm -e USERID=$uid -e GROUPID=$gid -v \"%cd%/../../../:/project\" openapitools/openapi-generator-cli:v5.4.0 /project/internal/lookout/ui/openapi.sh\"",
"lint": "eslint './src/**/*.{js,ts,tsx}' --max-warnings 0",
"fmt": "eslint './src/**/*.{js,ts,tsx}' --max-warnings 0 --fix"
"openapi": "docker run --rm -u $(id -u ${USER}):$(id -g ${USER}) -v \"${PWD}/../../:/project\" openapitools/openapi-generator-cli:v5.4.0 /project/internal/lookoutui/openapi.sh",
"openapi:win": "powershell -Command \"$uid = (New-Object System.Security.Principal.WindowsPrincipal([System.Security.Principal.WindowsIdentity]::GetCurrent())).Identity.User.Value; $gid = (Get-WmiObject Win32_UserAccount | Where-Object { $_.SID -eq $uid }).SID.Value; docker run --rm -e USERID=$uid -e GROUPID=$gid -v \"%cd%/../../:/project\" openapitools/openapi-generator-cli:v5.4.0 /project/internal/lookoutui/openapi.sh\"",
"lint": "eslint 'src/**/*.{js,ts,tsx}' --max-warnings 0",
"fmt": "eslint 'src/**/*.{js,ts,tsx}' --max-warnings 0 --fix"
},
"dependencies": {
"@dnd-kit/core": "^6.3.1",
Expand Down
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import { ColumnConfigurationDialog } from "./ColumnConfigurationDialog"
import { CustomViewPicker } from "./CustomViewPicker"
import styles from "./JobsTableActionBar.module.css"
import { ReprioritiseDialog } from "./ReprioritiseDialog"
import AutoRefreshToggle from "../../components/AutoRefreshToggle"
import RefreshButton from "../../components/RefreshButton"
import GroupBySelect from "../../components/lookoutV2/GroupBySelect"
import AutoRefreshToggle from "../AutoRefreshToggle"
import RefreshButton from "../RefreshButton"
import GroupBySelect from "./GroupBySelect"
import { JobFilter } from "../../models/lookoutV2Models"
import { IGetJobsService } from "../../services/lookoutV2/GetJobsService"
import { UpdateJobsService } from "../../services/lookoutV2/UpdateJobsService"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import "./colors.css";
@import "colors.css";

* {
box-sizing: border-box;
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Job, JobFilter, JobKey, JobOrder } from "../../../models/lookoutV2Models"
import { GetJobsResponse, IGetJobsService } from "../../../services/lookoutV2/GetJobsService"
import { compareValues, getActiveJobSets, mergeFilters, simulateApiWait } from "../../../utils/fakeJobsUtils"
import { GetJobsResponse, IGetJobsService } from "../GetJobsService"

export default class FakeGetJobsService implements IGetJobsService {
constructor(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Job, JobFilter, JobGroup, JobKey, JobOrder } from "../../../models/lookoutV2Models"
import { GroupedField, GroupJobsResponse, IGroupJobsService } from "../../../services/lookoutV2/GroupJobsService"
import { compareValues, getActiveJobSets, mergeFilters, simulateApiWait } from "../../../utils/fakeJobsUtils"
import { GroupedField, GroupJobsResponse, IGroupJobsService } from "../GroupJobsService"

export default class FakeGroupJobsService implements IGroupJobsService {
constructor(
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,8 @@
"baseUrl": "src",
"types": ["vitest/globals"]
},
"include": ["types/workarounds.d.ts", "src"]
"include": [
"types/workarounds.d.ts",
"src"
]
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion internal/lookoutv2/gen/restapi/configure_lookout.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func setupGlobalMiddleware(apiHandler http.Handler) http.Handler {
func uiHandler(apiHandler http.Handler) http.Handler {
mux := http.NewServeMux()

mux.Handle("/", setCacheControl(http.FileServer(serve.CreateDirWithIndexFallback("./internal/lookout/ui/build"))))
mux.Handle("/", setCacheControl(http.FileServer(serve.CreateDirWithIndexFallback("./internal/lookoutui/build"))))

mux.HandleFunc("/config", func(w http.ResponseWriter, _ *http.Request) {
w.Header().Set("Content-Type", "application/json")
Expand Down
2 changes: 1 addition & 1 deletion magefiles/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ func LocalDevStop() {
mg.Deps(KindTeardown)
}

// Build the lookout UI from internal/lookout/ui
// Build the lookout UI from internal/lookoutui
func UI() error {
timeTaken := time.Now()
mg.Deps(yarnCheck)
Expand Down
2 changes: 1 addition & 1 deletion magefiles/yarn.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ func yarnBinary() string {
}

func yarnRun(args ...string) error {
if err := os.Chdir("internal/lookout/ui"); err != nil {
if err := os.Chdir("internal/lookoutui"); err != nil {
return err
}

Expand Down

0 comments on commit 5c94cca

Please sign in to comment.