Skip to content

Commit

Permalink
Merge branch 'main' into feat/replace-macaron-css-with-uno-css
Browse files Browse the repository at this point in the history
  • Loading branch information
cp-20 committed Aug 25, 2024
2 parents 55eb165 + 7b7de61 commit f0cd191
Show file tree
Hide file tree
Showing 108 changed files with 10,159 additions and 5,647 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/dashboard-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,18 @@ jobs:
- run: corepack enable
- run: yarn install --immutable
- run: yarn typecheck
test:
name: Test
runs-on: ubuntu-latest
needs: [packages]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
- run: corepack enable
- run: yarn install --immutable
- run: yarn test
build:
name: Build
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ init-protoc:
init-protoc-tools:
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
go install connectrpc.com/connect/cmd/protoc-gen-connect-go@latest
npm i -g @connectrpc/protoc-gen-connect-es @bufbuild/protoc-gen-es
npm i -g @connectrpc/protoc-gen-connect-es @bufbuild/protoc-gen-es@1

.PHONY: init
init: init-k3d init-kustomize init-protoc init-protoc-tools ## Install / update required tools
Expand Down
9 changes: 8 additions & 1 deletion api/proto/neoshowcase/protobuf/controller.proto
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
syntax = "proto3";
package neoshowcase.protobuf;
option go_package = "github.com/traPtitech/neoshowcase/pkg/infrastructure/grpc/pb";

import "google/protobuf/empty.proto";
import "neoshowcase/protobuf/gateway.proto";

option go_package = "github.com/traPtitech/neoshowcase/pkg/infrastructure/grpc/pb";

message ImageConfig {
message RegistryConfig {
string scheme = 1;
Expand Down Expand Up @@ -37,6 +38,11 @@ message SaveBuildLogRequest {
bytes log = 2;
}

message SaveRuntimeImageRequest {
string build_id = 1;
int64 size = 2;
}

message RepositoryPrivate {
Repository repo = 1;
string username = 2;
Expand Down Expand Up @@ -143,6 +149,7 @@ service ControllerBuilderService {
rpc StreamBuildLog(stream BuildLogPortion) returns (google.protobuf.Empty);
rpc SaveArtifact(SaveArtifactRequest) returns (google.protobuf.Empty);
rpc SaveBuildLog(SaveBuildLogRequest) returns (google.protobuf.Empty);
rpc SaveRuntimeImage(SaveRuntimeImageRequest) returns (google.protobuf.Empty);
rpc ConnectBuilder(stream BuilderResponse) returns (stream BuilderRequest);
}

Expand Down
59 changes: 34 additions & 25 deletions api/proto/neoshowcase/protobuf/gateway.proto
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
syntax = "proto3";
package neoshowcase.protobuf;
option go_package = "github.com/traPtitech/neoshowcase/pkg/infrastructure/grpc/pb";

import "google/protobuf/empty.proto";
import "google/protobuf/timestamp.proto";
import "neoshowcase/protobuf/null.proto";

option go_package = "github.com/traPtitech/neoshowcase/pkg/infrastructure/grpc/pb";

// ---- Basic structs ----

// -- System
Expand Down Expand Up @@ -238,6 +239,13 @@ message ArtifactContent {
bytes content = 2;
}

message RuntimeImage {
string id = 1;
string build_id = 2;
int64 size = 3;
google.protobuf.Timestamp created_at = 4;
}

message AvailableMetrics {
repeated string metrics_names = 1;
}
Expand Down Expand Up @@ -280,6 +288,7 @@ message Build {
neoshowcase.protobuf.NullTimestamp finished_at = 8;
bool retriable = 9;
repeated Artifact artifacts = 10;
optional RuntimeImage runtime_image = 11;
}

message BuildLog {
Expand Down Expand Up @@ -500,7 +509,7 @@ service APIService {
// GetSystemInfo システム固有情報を取得します
rpc GetSystemInfo(google.protobuf.Empty) returns (SystemInfo) {
option idempotency_level = NO_SIDE_EFFECTS;
};
}
// GenerateKeyPair リポジトリ登録で使用する鍵ペアを一時的に生成します
rpc GenerateKeyPair(google.protobuf.Empty) returns (GenerateKeyPairResponse);

Expand All @@ -509,17 +518,17 @@ service APIService {
// GetMe 自身の情報を取得します プロキシ認証のため常に成功します
rpc GetMe(google.protobuf.Empty) returns (User) {
option idempotency_level = NO_SIDE_EFFECTS;
};
}
// GetUsers 全てのユーザーの情報を取得します
rpc GetUsers(google.protobuf.Empty) returns (GetUsersResponse) {
option idempotency_level = NO_SIDE_EFFECTS;
};
}
// CreateUserKey アプリコンテナSSH用の公開鍵を登録します
rpc CreateUserKey(CreateUserKeyRequest) returns (UserKey);
// GetUserKeys 登録した公開鍵一覧を取得します
rpc GetUserKeys(google.protobuf.Empty) returns (GetUserKeysResponse) {
option idempotency_level = NO_SIDE_EFFECTS;
};
}
// DeleteUserKey 登録した公開鍵を削除します
rpc DeleteUserKey(DeleteUserKeyRequest) returns (google.protobuf.Empty);

Expand All @@ -528,21 +537,21 @@ service APIService {
// CreateRepository リポジトリを登録します
rpc CreateRepository(CreateRepositoryRequest) returns (Repository);
// GetRepositories リポジトリ一覧を取得します
rpc GetRepositories(GetRepositoriesRequest) returns (GetRepositoriesResponse) {
rpc GetRepositories(GetRepositoriesRequest) returns (GetRepositoriesResponse) {
option idempotency_level = NO_SIDE_EFFECTS;
};
}
// GetRepositoryCommits コミットのメタ情報を取得します
rpc GetRepositoryCommits(GetRepositoryCommitsRequest) returns (GetRepositoryCommitsResponse) {
option idempotency_level = NO_SIDE_EFFECTS;
}
// GetRepository リポジトリを取得します
rpc GetRepository(RepositoryIdRequest) returns (Repository) {
rpc GetRepository(RepositoryIdRequest) returns (Repository) {
option idempotency_level = NO_SIDE_EFFECTS;
}
// GetRepositoryRefs リポジトリの現在の有効なref一覧を取得します
rpc GetRepositoryRefs(RepositoryIdRequest) returns (GetRepositoryRefsResponse) {
rpc GetRepositoryRefs(RepositoryIdRequest) returns (GetRepositoryRefsResponse) {
option idempotency_level = NO_SIDE_EFFECTS;
};
}
// UpdateRepository リポジトリ情報を更新します
rpc UpdateRepository(UpdateRepositoryRequest) returns (google.protobuf.Empty);
// RefreshRepository 自動更新間隔を待たず、手動でリモートリポジトリの最新情報に追従させます
Expand All @@ -555,13 +564,13 @@ service APIService {
// CreateApplication アプリを作成します
rpc CreateApplication(CreateApplicationRequest) returns (Application);
// GetApplications アプリ一覧を取得します
rpc GetApplications(GetApplicationsRequest) returns (GetApplicationsResponse) {
rpc GetApplications(GetApplicationsRequest) returns (GetApplicationsResponse) {
option idempotency_level = NO_SIDE_EFFECTS;
};
}
// GetApplication アプリを取得します
rpc GetApplication(ApplicationIdRequest) returns (Application) {
rpc GetApplication(ApplicationIdRequest) returns (Application) {
option idempotency_level = NO_SIDE_EFFECTS;
};
}
// UpdateApplication アプリ情報を更新します
rpc UpdateApplication(UpdateApplicationRequest) returns (google.protobuf.Empty);
// DeleteApplication アプリを削除します 先にアプリのシャットダウンが必要です
Expand All @@ -570,17 +579,17 @@ service APIService {
// Application info

// GetAvailableMetrics 取得可能メトリクス一覧を取得します
rpc GetAvailableMetrics(google.protobuf.Empty) returns (AvailableMetrics) {
rpc GetAvailableMetrics(google.protobuf.Empty) returns (AvailableMetrics) {
option idempotency_level = NO_SIDE_EFFECTS;
};
}
// GetApplicationMetrics アプリのメトリクスを取得します
rpc GetApplicationMetrics(GetApplicationMetricsRequest) returns (ApplicationMetrics) {
rpc GetApplicationMetrics(GetApplicationMetricsRequest) returns (ApplicationMetrics) {
option idempotency_level = NO_SIDE_EFFECTS;
};
}
// GetOutput アプリの出力を取得します
rpc GetOutput(GetOutputRequest) returns (ApplicationOutputs) {
option idempotency_level = NO_SIDE_EFFECTS;
};
}
// GetOutputStream アプリの出力をストリーム形式で取得します
rpc GetOutputStream(GetOutputStreamRequest) returns (stream ApplicationOutput);

Expand All @@ -589,7 +598,7 @@ service APIService {
// GetEnvVars アプリの環境変数を取得します
rpc GetEnvVars(ApplicationIdRequest) returns (ApplicationEnvVars) {
option idempotency_level = NO_SIDE_EFFECTS;
};
}
// SetEnvVar アプリの環境変数をセットします システムによって設定された環境変数は上書きできません
rpc SetEnvVar(SetApplicationEnvVarRequest) returns (google.protobuf.Empty);
// DeleteEnvVar アプリの環境変数を削除します システムによって設定された環境変数は削除できません
Expand All @@ -604,27 +613,27 @@ service APIService {
// GetAllBuilds すべてのアプリケーションのビルドキューを取得します
rpc GetAllBuilds(GetAllBuildsRequest) returns (GetBuildsResponse) {
option idempotency_level = NO_SIDE_EFFECTS;
};
}
// GetBuilds アプリのビルド一覧を取得します
rpc GetBuilds(ApplicationIdRequest) returns (GetBuildsResponse) {
option idempotency_level = NO_SIDE_EFFECTS;
};
}
// GetBuild アプリのビルド情報を取得します
rpc GetBuild(BuildIdRequest) returns (Build) {
option idempotency_level = NO_SIDE_EFFECTS;
};
}
// RetryCommitBuild アプリの該当コミットのビルドをやり直します
rpc RetryCommitBuild(RetryCommitBuildRequest) returns (google.protobuf.Empty);
// CancelBuild 該当ビルドが進行中の場合キャンセルします
rpc CancelBuild(BuildIdRequest) returns (google.protobuf.Empty);
// GetBuildLog 終了したビルドのログを取得します
rpc GetBuildLog(BuildIdRequest) returns (BuildLog) {
option idempotency_level = NO_SIDE_EFFECTS;
};
}
// GetBuildLogStream ビルド中のログをストリーム形式で取得します
rpc GetBuildLogStream(BuildIdRequest) returns (stream BuildLog);
// GetBuildArtifact 静的サイトアプリの場合ビルド成果物(静的ファイルのtar)を取得します
rpc GetBuildArtifact(ArtifactIdRequest) returns (ArtifactContent) {
option idempotency_level = NO_SIDE_EFFECTS;
};
}
}
4 changes: 3 additions & 1 deletion cmd/providers.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ package main
import (
"context"
"fmt"
"github.com/traPtitech/neoshowcase/pkg/usecase/systeminfo"
"net/http"
"os"
"strings"
"time"

"github.com/traPtitech/neoshowcase/pkg/usecase/systeminfo"

"connectrpc.com/connect"
certmanagerv1 "github.com/cert-manager/cert-manager/pkg/client/clientset/versioned"
"github.com/friendsofgo/errors"
Expand Down Expand Up @@ -85,6 +86,7 @@ var providers = wire.NewSet(
repository.New,
repository.NewApplicationRepository,
repository.NewArtifactRepository,
repository.NewRuntimeImageRepository,
repository.NewBuildRepository,
repository.NewEnvironmentRepository,
repository.NewGitRepositoryRepository,
Expand Down
6 changes: 4 additions & 2 deletions cmd/wire_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ services:
labels:
- "traefik.enable=true"
- "traefik.http.routers.adminer.rule=Host(`adminer.local.trapti.tech`)"
- "traefik.http.services.adminer.loadbalancer.server.port=80"
- "traefik.http.services.adminer.loadbalancer.server.port=8080"
networks:
- default

Expand Down
11 changes: 8 additions & 3 deletions dashboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"fix": "yarn fmt:apply && yarn lint:apply",
"typecheck": "tsc --noEmit",
"ci": "biome ci src",
"analyze": "vite build --mode analyze"
"analyze": "vite build --mode analyze",
"test": "vitest"
},
"license": "MIT",
"devDependencies": {
Expand All @@ -25,14 +26,16 @@
"@macaron-css/vite": "1.5.1",
"@tanstack/virtual-core": "3.8.4",
"@types/node": "22.1.0",
"jsdom": "24.1.1",
"rollup-plugin-visualizer": "5.12.0",
"typescript": "5.5.4",
"unocss": "^0.62.2",
"unplugin-fonts": "1.1.1",
"vite": "5.3.5",
"vite-plugin-compression": "0.5.1",
"vite-plugin-solid": "2.10.2",
"vite-plugin-solid-svg": "0.8.1"
"vite-plugin-solid-svg": "0.8.1",
"vitest": "2.0.3"
},
"dependencies": {
"@bufbuild/protobuf": "1.10.0",
Expand All @@ -55,7 +58,9 @@
"solid-js": "1.8.19",
"solid-tippy": "0.2.1",
"solid-toast": "0.5.0",
"tippy.js": "6.3.7"
"tippy.js": "6.3.7",
"ts-pattern": "5.2.0",
"valibot": "0.36.0"
},
"packageManager": "[email protected]+sha512.ec40d0639bb307441b945d9467139cbb88d14394baac760b52eca038b330d16542d66fef61574271534ace5a200518dabf3b53a85f1f9e4bfa37141b538a9590"
}
Loading

0 comments on commit f0cd191

Please sign in to comment.