Skip to content

Commit

Permalink
chore: remove the Zarf Web UI and update references to the new repo (#…
Browse files Browse the repository at this point in the history
…2079)

## Description

This performs the full removal of the Zarf UI from the Zarf CLI and
updates documentation to point to the new repository.

https://github.com/defenseunicorns/zarf-ui

## Related Issue

Fixes #1814

## Type of change

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [X] Other (security config, docs update, etc)

## Checklist before merging

- [X] Test, docs, adr added or updated as needed
- [X] [Contributor Guide
Steps](https://github.com/defenseunicorns/zarf/blob/main/CONTRIBUTING.md#developer-workflow)
followed

---------

Signed-off-by: razzle <[email protected]>
Co-authored-by: razzle <[email protected]>
  • Loading branch information
Racer159 and Noxsios authored Oct 17, 2023
1 parent 7801b7c commit 7cc1201
Show file tree
Hide file tree
Showing 127 changed files with 361 additions and 13,197 deletions.
2 changes: 1 addition & 1 deletion .github/actions/cleanup-files/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ runs:
- run: |
lsblk -f
sudo rm -rf zarf-sbom /tmp/zarf-* src/ui/node_modules
sudo rm -rf zarf-sbom /tmp/zarf-*
sudo env "PATH=$PATH" CI=true make delete-packages
sudo build/zarf tools clear-cache
sudo docker system prune --all --force
Expand Down
11 changes: 0 additions & 11 deletions .github/actions/node/action.yaml

This file was deleted.

3 changes: 0 additions & 3 deletions .github/workflows/nightly-ecr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ jobs:
- name: Setup golang
uses: ./.github/actions/golang

- name: Setup NodeJS
uses: ./.github/actions/node

- name: Build the Zarf binary
run: make build-cli-linux-amd

Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/nightly-eks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@ jobs:
- name: Setup golang
uses: ./.github/actions/golang

- name: Setup NodeJS
uses: ./.github/actions/node

- name: Build binary and zarf packages
uses: ./.github/actions/packages

Expand Down
6 changes: 0 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ jobs:
- name: Setup golang
uses: ./.github/actions/golang

- name: Setup NodeJS
uses: ./.github/actions/node

- name: Install tools
uses: ./.github/actions/install-tools

Expand Down Expand Up @@ -131,9 +128,6 @@ jobs:
- name: Setup golang
uses: ./.github/actions/golang

- name: Setup NodeJS
uses: ./.github/actions/node

- name: Install tools
uses: ./.github/actions/install-tools

Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/scan-codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
strategy:
fail-fast: false
matrix:
language: ["go", "javascript"]
language: ["go"]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

Expand All @@ -41,9 +41,6 @@ jobs:
- name: Setup golang
uses: ./.github/actions/golang

- name: Setup NodeJS
uses: ./.github/actions/node

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@04daf014b50eaf774287bf3f0f1869d4b4c4b913 # v2.21.7
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/scan-cves.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ on:
paths:
- "go.mod"
- "go.sum"
- "src/ui/package.json"
- "src/ui/package-lock.json"
- "cargo.toml"
- "cargo.lock"

Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/test-bigbang.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ jobs:
- name: Setup golang
uses: ./.github/actions/golang

- name: Setup NodeJS
uses: ./.github/actions/node

- name: Build Zarf binary
uses: ./.github/actions/packages
with:
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/test-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ jobs:
- name: Setup golang
uses: ./.github/actions/golang

- name: Setup NodeJS
uses: ./.github/actions/node

- name: Build binary and zarf packages
uses: ./.github/actions/packages
with:
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/test-external.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ jobs:
- name: Setup golang
uses: ./.github/actions/golang

- name: Setup NodeJS
uses: ./.github/actions/node

- name: Build binary and zarf packages
uses: ./.github/actions/packages
with:
Expand Down
64 changes: 0 additions & 64 deletions .github/workflows/test-ui.yml

This file was deleted.

3 changes: 0 additions & 3 deletions .github/workflows/test-upgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ jobs:
- name: Setup golang
uses: ./.github/actions/golang

- name: Setup NodeJS
uses: ./.github/actions/node

- name: Build PR binary and zarf init package
uses: ./.github/actions/packages
with:
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/test-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@ jobs:
- name: Setup golang
uses: ./.github/actions/golang

- name: Setup NodeJS
uses: ./.github/actions/node

- name: Build windows binary
run: make build-cli-windows-amd
shell: pwsh
Expand Down
Binary file removed .images/get-started/dosbox.png
Binary file not shown.
Binary file removed .images/get-started/not-private-verify.png
Binary file not shown.
Binary file removed .images/get-started/not-private.png
Binary file not shown.
Binary file removed .images/get-started/plg.png
Binary file not shown.
Binary file removed .images/harbor-credentials.png
Binary file not shown.
Binary file removed .images/zarf-dod.jpg
Binary file not shown.
9 changes: 1 addition & 8 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,7 @@ main.go @jeff-mccoy @Racer159 @Noxsios
/packages/ @jeff-mccoy @Racer159 @Noxsios
/zarf.yaml @jeff-mccoy @Racer159 @Noxsios

# Web UI-specific
/package*.json @mike-winberry @Racer159 @Noxsios @jeff-mccoy
/src/internal/api @mike-winberry @Racer159 @Noxsios @jeff-mccoy
/src/ui/ @mike-winberry @Racer159 @Noxsios @jeff-mccoy
/playwright.config.ts @mike-winberry @Racer159 @Noxsios @jeff-mccoy
/svelte.config.js @mike-winberry @Racer159 @Noxsios @jeff-mccoy
/tsconfig.json @mike-winberry @Racer159 @Noxsios @jeff-mccoy
/vite.config.ts @mike-winberry @Racer159 @Noxsios @jeff-mccoy
# Docs Website
/docs-website/ @mike-winberry @Racer159 @Noxsios @jeff-mccoy

# Privileged pipeline files
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ You can learn more about the testing of Zarf [here](docs/12-contribute-to-zarf/2

### Updating Our Documentation

Our documentation is auto-generated from the `src/types` and `src/cmd` go packages. This includes the [Zarf package jsonschema](https://github.com/defenseunicorns/zarf/blob/main/zarf.schema.json), the [Zarf schema docs](https://docs.zarf.dev/docs/create-a-zarf-package/zarf-schema), the [Zarf CLI docs](https://docs.zarf.dev/docs/the-zarf-cli/), and our [front-end API types](https://github.com/defenseunicorns/zarf/blob/main/src/ui/lib/api-types.ts). When an update to types or the CLI commands is made you will need to run `make docs-and-schema` locally to regenerate the schema and documentation. CI checks if this was ran, and will fail if it wasn't.
Our documentation is auto-generated from the `src/types` and `src/cmd` go packages. This includes the [Zarf package jsonschema](https://github.com/defenseunicorns/zarf/blob/main/zarf.schema.json), the [Zarf schema docs](https://docs.zarf.dev/docs/create-a-zarf-package/zarf-schema), and the [Zarf CLI docs](https://docs.zarf.dev/docs/the-zarf-cli/). When an update to types or the CLI commands is made you will need to run `make docs-and-schema` locally to regenerate the schema and documentation. CI checks if this was ran, and will fail if it wasn't.

We do this so that there is a git commit signature from a person on the commit for better traceability, rather than a non-person entity (e.g. GitHub CI token).

Expand Down
66 changes: 10 additions & 56 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,59 +48,34 @@ destroy: ## Run `zarf destroy` on the current cluster
delete-packages: ## Delete all Zarf package tarballs in the project recursively
find . -type f -name 'zarf-package-*' -delete

# INTERNAL: used to ensure the ui directory exists
ensure-ui-build-dir:
mkdir -p build/ui
touch build/ui/index.html

# INTERNAL: used to build the UI only if necessary
check-ui:
@ if [ ! -z "$(shell command -v shasum)" ]; then\
if test "$(shell ./hack/print-ui-diff.sh | shasum)" != "$(shell cat build/ui/git-info.txt | shasum)" ; then\
$(MAKE) build-ui;\
./hack/print-ui-diff.sh > build/ui/git-info.txt;\
fi;\
else\
$(MAKE) build-ui;\
fi

build-ui: ## Build the Zarf UI
npm --prefix src/ui ci
npm --prefix src/ui run build

# Note: the path to the main.go file is not used due to https://github.com/golang/go/issues/51831#issuecomment-1074188363

build-cli-linux-amd: check-ui ## Build the Zarf CLI for Linux on AMD64
build-cli-linux-amd: ## Build the Zarf CLI for Linux on AMD64
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="$(BUILD_ARGS)" -o build/zarf .

build-cli-linux-arm: check-ui ## Build the Zarf CLI for Linux on ARM
build-cli-linux-arm: ## Build the Zarf CLI for Linux on ARM
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -ldflags="$(BUILD_ARGS)" -o build/zarf-arm .

build-cli-mac-intel: check-ui ## Build the Zarf CLI for macOS on AMD64
build-cli-mac-intel: ## Build the Zarf CLI for macOS on AMD64
GOOS=darwin GOARCH=amd64 go build -ldflags="$(BUILD_ARGS)" -o build/zarf-mac-intel .

build-cli-mac-apple: check-ui ## Build the Zarf CLI for macOS on ARM
build-cli-mac-apple: ## Build the Zarf CLI for macOS on ARM
GOOS=darwin GOARCH=arm64 go build -ldflags="$(BUILD_ARGS)" -o build/zarf-mac-apple .

build-cli-windows-amd: check-ui ## Build the Zarf CLI for Windows on AMD64
build-cli-windows-amd: ## Build the Zarf CLI for Windows on AMD64
GOOS=windows GOARCH=amd64 go build -ldflags="$(BUILD_ARGS)" -o build/zarf.exe . ## Build the Zarf CLI for Windows on AMD64

build-cli-windows-arm: check-ui ## Build the Zarf CLI for Windows on ARM
build-cli-windows-arm: ## Build the Zarf CLI for Windows on ARM
GOOS=windows GOARCH=arm64 go build -ldflags="$(BUILD_ARGS)" -o build/zarf-arm.exe . ## Build the Zarf CLI for Windows on ARM

build-cli-linux: build-cli-linux-amd build-cli-linux-arm ## Build the Zarf CLI for Linux on AMD64 and ARM

build-cli: build-cli-linux-amd build-cli-linux-arm build-cli-mac-intel build-cli-mac-apple build-cli-windows-amd build-cli-windows-arm ## Build the CLI

docs-and-schema: ensure-ui-build-dir ## Generate the Zarf Documentation and Schema
docs-and-schema: ## Generate the Zarf Documentation and Schema
hack/gen-cli-docs.sh
ZARF_CONFIG=hack/empty-config.toml hack/create-zarf-schema.sh

dev: ensure-ui-build-dir ## Start a Dev Server for the Zarf UI
go mod download
npm --prefix src/ui ci
npm --prefix src/ui run dev

# INTERNAL: a shim used to build the agent image only if needed on Windows using the `test` command
init-package-local-agent:
@test "$(AGENT_IMAGE_TAG)" != "local" || $(MAKE) build-local-agent-image
Expand Down Expand Up @@ -190,42 +165,21 @@ test-upgrade: ## Run the Zarf CLI E2E tests for an external registry and cluster
cd src/test/upgrade && go test -failfast -v -timeout 30m

.PHONY: test-unit
test-unit: ensure-ui-build-dir ## Run unit tests
test-unit: ## Run unit tests
cd src/pkg && go test ./... -failfast -v -timeout 30m
cd src/internal && go test ./... -failfast -v timeout 30m
cd src/extensions/bigbang && go test ./. -failfast -v timeout 30m

.PHONY: test-ui
test-ui: ## Run the Zarf UI E2E tests (requires `make build-ui` first) (run with env CI=true to use build/zarf)
export NODE_PATH=$(CURDIR)/src/ui/node_modules && \
npm --prefix src/ui run test:pre-init && \
npm --prefix src/ui run test:init && \
npm --prefix src/ui run test:post-init && \
npm --prefix src/ui run test:connect

.PHONY: test-ui-dev-server
# INTERNAL: used to start a dev version of the API server for the Zarf Web UI tests (locally)
test-ui-dev-server:
API_DEV_PORT=5173 \
API_PORT=3333 \
API_TOKEN=insecure \
go run -ldflags="$(BUILD_ARGS)" main.go dev ui -l=trace

.PHONY: test-ui-build-server
# INTERNAL: used to start the built version of the API server for the Zarf Web UI (in CI)
test-ui-build-server:
API_PORT=3333 API_TOKEN=insecure $(ZARF_BIN) dev ui

# INTERNAL: used to test that a dev has ran `make docs-and-schema` in their PR
test-docs-and-schema:
$(MAKE) docs-and-schema
hack/check-zarf-docs-and-schema.sh

# INTERNAL: used to test for new CVEs that may have been introduced
test-cves: ensure-ui-build-dir
test-cves:
go run main.go tools sbom packages . -o json --exclude './docs-website' --exclude './examples' | grype --fail-on low

cve-report: ensure-ui-build-dir ## Create a CVE report for the current project (must `brew install grype` first)
cve-report: ## Create a CVE report for the current project (must `brew install grype` first)
go run main.go tools sbom packages . -o json --exclude './docs-website' --exclude './examples' | grype -o template -t hack/.templates/grype.tmpl > build/zarf-known-cves.csv

lint-go: ## Run revive to lint the go code (must `brew install revive` first)
Expand Down
Loading

0 comments on commit 7cc1201

Please sign in to comment.