diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 4513b3ab..7317fc01 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -10,7 +10,8 @@ jobs: test: strategy: matrix: - component: [common, orchestrator, fuzzer, program-model, seed-gen, patcher] + component: + [common, orchestrator, fuzzer, program-model, seed-gen, patcher] python: - "3.12" # TODO: Add integration tests back in @@ -49,8 +50,8 @@ jobs: - name: Install dependencies run: | sudo apt-get update - sudo apt-get install -y codequery just ripgrep git-lfs - just install-cscope + sudo apt-get install -y codequery ripgrep git-lfs + make install-cscope - name: Prepare environment run: | diff --git a/CLAUDE.md b/CLAUDE.md index e819400a..e2c43754 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -12,11 +12,11 @@ Buttercup is a Cyber Reasoning System (CRS) developed by Trail of Bits for the A ```bash # Build specific component (from project root) -just lint-python # Format, lint, and type-check a component -just lint-python-all # Format, lint, and type-check all components +make lint-component COMPONENT= # Format, lint, and type-check a component +make lint # Format, lint, and type-check all components # Example: lint the patcher component -just lint-python patcher +make lint-component COMPONENT=patcher ``` ### Testing diff --git a/Makefile b/Makefile index 916beaa7..b47605b7 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ # Makefile for Trail of Bits AIxCC Finals CRS -.PHONY: help setup-local setup-azure validate deploy deploy-local deploy-azure test undeploy +.PHONY: help setup-local setup-azure validate deploy deploy-local deploy-azure test undeploy install-cscope lint lint-component clean-local wait-crs check-crs crs-instance-id status send-integration-task # Default target help: @@ -23,6 +23,7 @@ help: @echo " send-integration-task - Run integration-test task" @echo "" @echo "Development:" + @echo " install-cscope - Install cscope tool" @echo " lint - Lint all Python code" @echo " lint-component - Lint specific component (e.g., make lint-component COMPONENT=orchestrator)" @echo "" @@ -156,3 +157,8 @@ clean-local: @echo "Cleaning up local environment..." minikube delete || true rm -f deployment/env + +# Additional targets migrated from justfile +install-cscope: + cd external/aixcc-cscope/ && autoreconf -i -s && ./configure && make && sudo make install + diff --git a/QUICK_REFERENCE.md b/QUICK_REFERENCE.md index c2481abf..3052fdad 100644 --- a/QUICK_REFERENCE.md +++ b/QUICK_REFERENCE.md @@ -63,8 +63,8 @@ kubectl exec -it -n crs -- /bin/bash ### Development ```bash # Lint Python code -just lint-python-all -just lint-python +make lint +make lint-component COMPONENT= # Docker development docker-compose up -d diff --git a/README.md b/README.md index 2dae4188..cd2bffe1 100644 --- a/README.md +++ b/README.md @@ -292,10 +292,10 @@ make send-integration-task ```bash # Lint Python code -just lint-python-all +make lint # Run specific component tests -just lint-python orchestrator +make lint-component COMPONENT=orchestrator # Test manually ./orchestrator/scripts/task_upstream_libpng.sh diff --git a/justfile b/justfile deleted file mode 100644 index ba0a3318..00000000 --- a/justfile +++ /dev/null @@ -1,13 +0,0 @@ -install-cscope: - cd external/aixcc-cscope/ && autoreconf -i -s && ./configure && make && sudo make install - -lint-python COMPONENT: - cd {{ COMPONENT }} && uv sync --all-extras && uv run ruff format && uv run ruff check --fix && uv run mypy - -lint-python-all: - just lint-python common - just lint-python fuzzer - just lint-python orchestrator - just lint-python patcher - just lint-python program-model - just lint-python seed-gen diff --git a/program-model/Makefile b/program-model/Makefile new file mode 100644 index 00000000..b0864ab3 --- /dev/null +++ b/program-model/Makefile @@ -0,0 +1,37 @@ +# Makefile for program-model component + +.PHONY: help all sync reformat lint test + +# Default target +help: + @echo "program-model component - Available Commands:" + @echo "" + @echo " all - Run sync, reformat, lint, and test" + @echo " sync - Install dependencies with uv" + @echo " reformat - Format code with ruff" + @echo " lint - Check code formatting, linting, and types" + @echo " test - Run pytest with integration tests" + +all: sync reformat lint test + +sync: + uv sync --all-extras + +reformat: + uv run ruff format + uv run ruff check --fix + +lint: + uv run ruff format --check + uv run ruff check + uv run mypy + +test: + # To debug + # uv run pytest -svv --log-cli-level=DEBUG --runintegration + + # To save unit test results + # PYTEST_DEBUG_TEMPROOT="/crs_scratch/" uv run pytest -svv --runintegration + + # To run tests + uv run pytest -svv --runintegration \ No newline at end of file diff --git a/program-model/README.md b/program-model/README.md index b892a196..e8641e1b 100644 --- a/program-model/README.md +++ b/program-model/README.md @@ -10,5 +10,5 @@ Indexes a program's source code to be queried by `seed-gen` and `patcher`. Sync, reformat, lint, and test before committing changes to this directory. ```shell -just all +make all ``` diff --git a/program-model/justfile b/program-model/justfile deleted file mode 100644 index c678085c..00000000 --- a/program-model/justfile +++ /dev/null @@ -1,23 +0,0 @@ -all: && sync reformat lint test - -sync: - uv sync --all-extras - -reformat: - uv run ruff format - uv run ruff check --fix - -lint: - uv run ruff format --check - uv run ruff check - uv run mypy - -test: - # To debug - # uv run pytest -svv --log-cli-level=DEBUG --runintegration - - # To save unit test results - # PYTEST_DEBUG_TEMPROOT="/crs_scratch/" uv run pytest -svv --runintegration - - # To run tests - uv run pytest -svv --runintegration diff --git a/scripts/common.sh b/scripts/common.sh index 3fa2ca6d..b4b4b974 100755 --- a/scripts/common.sh +++ b/scripts/common.sh @@ -111,26 +111,6 @@ install_git_lfs() { fi } -# Function to install Just -install_just() { - print_status "Installing Just..." - if ! command_exists just; then - if command_exists apt-get; then - sudo apt-get update - sudo apt-get install -y just - elif command_exists yum; then - sudo yum install -y just - elif command_exists brew; then - brew install just - else - print_error "Could not install Just. Please install it manually." - return 1 - fi - print_success "Just installed successfully" - else - print_success "Just is already installed" - fi -} # Function to check Docker check_docker() { @@ -209,16 +189,6 @@ check_terraform() { fi } -# Function to check Just -check_just() { - print_status "Checking Just..." - if command_exists just; then - print_success "Just is installed" - else - print_error "Just is not installed" - return 1 - fi -} # Function to setup configuration file setup_config_file() { diff --git a/scripts/setup-azure.sh b/scripts/setup-azure.sh index a8b7b953..1b9414a1 100755 --- a/scripts/setup-azure.sh +++ b/scripts/setup-azure.sh @@ -159,7 +159,6 @@ main() { check_azure_cli check_terraform - install_just setup_service_principal setup_config setup_remote_state diff --git a/scripts/setup-local.sh b/scripts/setup-local.sh index 7eeac53b..25e77298 100755 --- a/scripts/setup-local.sh +++ b/scripts/setup-local.sh @@ -53,7 +53,6 @@ main() { install_helm install_minikube install_git_lfs - install_just setup_config verify_setup