Skip to content

Commit

Permalink
Merge branch 'refactor/frontend' into feat/MyModal
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthewHsu1 committed Feb 5, 2024
2 parents f42677a + aaf17b8 commit aa423a0
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 28 deletions.
17 changes: 15 additions & 2 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,23 @@ jobs:
name: Lint Backend
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v3
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: 1.19
- uses: actions/checkout@v3

- name: Checkout Repo
uses: actions/checkout@v2
with:
submodules: true
token: ${{ secrets.SSH_TOKEN }}

- name: Install dependencies
run: make install-dependencies

- name: Build Protos
run: make build-protos

- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,15 @@ jobs:
- name: Install dependencies
run: make install-dependencies

- name: Build Protos
run: make build-protos

- name: Test
run: |
go test -race ./...
# TODO: include protobuf installation and compilation steps here, once we actually start
# writing tests that need to run on the frontend.
Jest:
name: Test Frontend
runs-on: ubuntu-latest
Expand Down
15 changes: 9 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ all: build run

# Dependencies
# --------------------------------------------------------------------
.PHONY: install-linter
.PHONY: install-dependencies install-linter install-protos install-fmter

install-dependencies: install-linter install-protos install-fmter
cd houston && npm install

install-linter:
# TODO: might as well just move this all to an install-linter script
$(info Installing golangci-lint for $(OS))
Expand All @@ -18,17 +22,16 @@ install-linter:
fi;\

install-protos:
git submodule init && git submodule update
sudo apt install protobuf-compiler
go install google.golang.org/protobuf/cmd/[email protected]
echo "You will need to set your PATH variable to include go installations, if you have not already done so."

install-fmter:
go install golang.org/x/tools/cmd/goimports@latest

install-assets:
./scripts/pull-large-assets.sh

# Build
# --------------------------------------------------------------------
.PHONY: pre-build build install-dependencies configure-git build-go build-react build-docker build-protos build-backend-protos build-frontend-protos
.PHONY: pre-build build configure-git build-go build-react build-docker build-protos build-backend-protos build-frontend-protos
pre-build: configure-git

build: build-go build-react build-protos
Expand Down
14 changes: 7 additions & 7 deletions internal/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import (
"github.com/tritonuas/gcs/internal/influxdb"
mav "github.com/tritonuas/gcs/internal/mavlink"
"github.com/tritonuas/gcs/internal/obc"
"github.com/tritonuas/gcs/internal/obc/camera"
"github.com/tritonuas/gcs/internal/protos"
)

Expand All @@ -25,10 +24,11 @@ var Log = logrus.New()
Stores the server state and data that the server deals with.
*/
type Server struct {
influxDBClient *influxdb.Client
mavlinkClient *mav.Client
obcClient *obc.Client
newestRawImage camera.RawImage
influxDBClient *influxdb.Client
mavlinkClient *mav.Client
obcClient *obc.Client
// TODO: reintroduce once this is actually referenced in the code
// newestRawImage camera.RawImage
UnclassifiedTargets []cvs.UnclassifiedODLC `json:"unclassified_targets"`
MissionTime int64
ClassifiedTargets []cvs.ClassifiedODLC
Expand Down Expand Up @@ -415,8 +415,8 @@ func (server *Server) postMission() gin.HandlerFunc {

server.MissionConfig = &mission

resp_body, status := server.obcClient.PostMission(&mission)
c.Data(status, "text/plain", resp_body)
respBody, status := server.obcClient.PostMission(&mission)
c.Data(status, "text/plain", respBody)
}
}

Expand Down
13 changes: 0 additions & 13 deletions scripts/pull-large-assets.sh

This file was deleted.

0 comments on commit aa423a0

Please sign in to comment.