Skip to content

Commit

Permalink
chore: move proto to legacy (#1243)
Browse files Browse the repository at this point in the history
<!-- Please make sure there is an issue that this PR is correlated to. -->

## Changes

<!-- If there are frontend changes, please include screenshots. -->
  • Loading branch information
NathanFlurry committed Oct 24, 2024
1 parent a6ccd5e commit ed62de3
Show file tree
Hide file tree
Showing 356 changed files with 480 additions and 483 deletions.
1 change: 0 additions & 1 deletion .envrc

This file was deleted.

File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ syntax = "proto3";

package rivet.backend.build;

import "proto/common.proto";
import "legacy/proto/common.proto";

enum BuildKind {
DOCKER_IMAGE = 0;
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion proto/backend/cdn.proto → legacy/proto/backend/cdn.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ syntax = "proto3";

package rivet.backend.cdn;

import "proto/common.proto";
import "legacy/proto/common.proto";

// MARK: Game Namespace Config
message NamespaceConfig {
Expand Down
2 changes: 1 addition & 1 deletion proto/backend/cf.proto → legacy/proto/backend/cf.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ syntax = "proto3";

package rivet.backend.cf;

import "proto/common.proto";
import "legacy/proto/common.proto";

message CustomHostname {
enum Status {
Expand Down
10 changes: 5 additions & 5 deletions proto/backend/cloud.proto → legacy/proto/backend/cloud.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ syntax = "proto3";

package rivet.backend.cloud;

import "proto/common.proto";
import "proto/backend/matchmaker.proto";
import "proto/backend/cdn.proto";
import "proto/backend/kv.proto";
import "proto/backend/identity.proto";
import "legacy/proto/common.proto";
import "legacy/proto/backend/matchmaker.proto";
import "legacy/proto/backend/cdn.proto";
import "legacy/proto/backend/kv.proto";
import "legacy/proto/backend/identity.proto";

message Game {
rivet.common.Uuid game_id = 1;
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions proto/backend/ds.proto → legacy/proto/backend/ds.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ syntax = "proto3";

package rivet.backend.ds;

import "proto/common.proto";
import "proto/backend/captcha.proto";
import "proto/backend/region.proto";
import "legacy/proto/common.proto";
import "legacy/proto/backend/captcha.proto";
import "legacy/proto/backend/region.proto";

// TODO: Delete file after converting ds-log pkg to native ops

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ syntax = "proto3";

package rivet.backend.ds.log;

import "proto/common.proto";
import "legacy/proto/common.proto";

enum StreamType {
STD_OUT = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ syntax = "proto3";

package rivet.backend.faker;

import "proto/common.proto";
import "legacy/proto/common.proto";
import "google/protobuf/empty.proto";

enum Image {
Expand Down
4 changes: 2 additions & 2 deletions proto/backend/game.proto → legacy/proto/backend/game.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ syntax = "proto3";

package rivet.backend.game;

import "proto/common.proto";
import "proto/backend/upload.proto";
import "legacy/proto/common.proto";
import "legacy/proto/backend/upload.proto";

message Game {
rivet.common.Uuid game_id = 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ syntax = "proto3";

package rivet.backend.identity;

import "proto/common.proto";
import "legacy/proto/common.proto";

// MARK: Game Namespace Config
message NamespaceConfig {
Expand Down
2 changes: 1 addition & 1 deletion proto/backend/job.proto → legacy/proto/backend/job.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ syntax = "proto3";

package rivet.backend.job;

import "proto/common.proto";
import "legacy/proto/common.proto";

message Parameter {
string key = 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ syntax = "proto3";

package rivet.backend.job.log;

import "proto/common.proto";
import "legacy/proto/common.proto";

enum StreamType {
STD_OUT = 0;
Expand Down
2 changes: 1 addition & 1 deletion proto/backend/kv.proto → legacy/proto/backend/kv.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ syntax = "proto3";

package rivet.backend.kv;

import "proto/common.proto";
import "legacy/proto/common.proto";

// MARK: Game Namespace Config
message NamespaceConfig {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ syntax = "proto3";

package rivet.backend.matchmaker;

import "proto/common.proto";
import "proto/backend/captcha.proto";
import "proto/backend/region.proto";
import "legacy/proto/common.proto";
import "legacy/proto/backend/captcha.proto";
import "legacy/proto/backend/region.proto";

// MARK: Game Config
message GameConfig {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ syntax = "proto3";

package rivet.backend.matchmaker.query;

import "proto/common.proto";
import "legacy/proto/common.proto";

enum JoinKind {
NORMAL = 0;
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ syntax = "proto3";

package rivet.backend.region;

import "proto/common.proto";
import "proto/backend/net.proto";
import "proto/backend/cluster.proto";
import "legacy/proto/common.proto";
import "legacy/proto/backend/net.proto";
import "legacy/proto/backend/cluster.proto";

message Region {
reserved 6, 10, 11, 12, 13;
Expand Down
6 changes: 3 additions & 3 deletions proto/backend/team.proto → legacy/proto/backend/team.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ syntax = "proto3";

package rivet.backend.team;

import "proto/common.proto";
import "proto/backend/user.proto";
import "proto/backend/upload.proto";
import "legacy/proto/common.proto";
import "legacy/proto/backend/user.proto";
import "legacy/proto/backend/upload.proto";

enum DeactivateReason {
UNKNOWN = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ syntax = "proto3";

package rivet.backend.upload;

import "proto/common.proto";
import "legacy/proto/common.proto";

enum Provider {
MINIO = 0;
Expand Down
4 changes: 2 additions & 2 deletions proto/backend/user.proto → legacy/proto/backend/user.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ syntax = "proto3";

package rivet.backend.user;

import "proto/common.proto";
import "proto/backend/upload.proto";
import "legacy/proto/common.proto";
import "legacy/proto/backend/upload.proto";

message User {
reserved 5, 9;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ syntax = "proto3";

package rivet.backend.user.event;

import "proto/common.proto";
import "proto/backend/user.proto";
import "legacy/proto/common.proto";
import "legacy/proto/backend/user.proto";

message Event {
reserved 3, 6;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ syntax = "proto3";

package rivet.backend.user.update;

import "proto/common.proto";
import "proto/backend/user.proto";
import "legacy/proto/common.proto";
import "legacy/proto/backend/user.proto";

message Update {
reserved 2, 3;
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion proto/chirp.proto → legacy/proto/chirp.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ syntax = "proto3";

package rivet.chirp;

import "proto/common.proto";
import "legacy/proto/common.proto";

message Message {
reserved 1;
Expand Down
4 changes: 2 additions & 2 deletions proto/claims.proto → legacy/proto/claims.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ syntax = "proto3";

package rivet.claims;

import "proto/common.proto";
import "proto/backend/matchmaker.proto";
import "legacy/proto/common.proto";
import "legacy/proto/backend/matchmaker.proto";

message Entitlement {
// Can issue a new token for a given session.
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion proto/perf.proto → legacy/proto/perf.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ syntax = "proto3";

package rivet.perf;

import "proto/common.proto";
import "legacy/proto/common.proto";

message Span {
string label = 1;
Expand Down
2 changes: 1 addition & 1 deletion lib/schemac/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ mod tests {
fn build_all_proto() {
let current_dir = std::env::current_dir().unwrap();
let project_root = current_dir.parent().unwrap().parent().unwrap();
let proto_dir = project_root.join("proto");
let proto_dir = project_root.join("legacy").join("proto");

let output = compile(
CompileOpts::default()
Expand Down
48 changes: 23 additions & 25 deletions lib/types-proto/build/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,17 @@ where
{
let project_roots = seek_project_roots()?;
let main_project_root = &project_roots[0];
let proto_path = main_project_root.join("legacy").join("proto");
let out_dir = PathBuf::from(std::env::var("OUT_DIR").unwrap());

let mut input_paths = Vec::new();

// Add common proto from root of project
//
// This will be symlinked if there are multiple roots
println!(
"cargo:rerun-if-changed={}",
main_project_root.join("proto").display()
);
if main_project_root.join("proto").is_dir() {
let paths = find_all_proto(&main_project_root.join("proto"))?;
println!("cargo:rerun-if-changed={}", proto_path.display());
if proto_path.is_dir() {
let paths = find_all_proto(&proto_path)?;
input_paths.extend(paths);
};

Expand Down Expand Up @@ -101,25 +99,25 @@ fn update_compile_opts(mut base: schemac::CompileOpts) -> io::Result<schemac::Co
}

fn seek_project_roots() -> io::Result<Vec<PathBuf>> {
let mut current_dir = std::env::current_dir()?;
loop {
if current_dir.join("Cargo.toml").exists() {
// Check if this Cargo.toml is a workspace root
let cargo_toml = std::fs::read_to_string(current_dir.join("Cargo.toml"))?;
if cargo_toml.contains("[workspace]") {
return Ok(vec![current_dir]);
}
}
if let Some(parent) = current_dir.parent() {
current_dir = parent.to_owned();
} else {
return Err(io::Error::new(
io::ErrorKind::NotFound,
"Could not find workspace Cargo.toml",
));
}
}
let mut current_dir = std::env::current_dir()?;
loop {
if current_dir.join("Cargo.toml").exists() {
// Check if this Cargo.toml is a workspace root
let cargo_toml = std::fs::read_to_string(current_dir.join("Cargo.toml"))?;
if cargo_toml.contains("[workspace]") {
return Ok(vec![current_dir]);
}
}

if let Some(parent) = current_dir.parent() {
current_dir = parent.to_owned();
} else {
return Err(io::Error::new(
io::ErrorKind::NotFound,
"Could not find workspace Cargo.toml",
));
}
}
}

fn find_all_proto(path: &Path) -> io::Result<Vec<PathBuf>> {
Expand Down
2 changes: 1 addition & 1 deletion svc/pkg/analytics/proto/msg/event-create.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ syntax = "proto3";

package rivet.backend.pkg.analytics.msg.event_create;

import "proto/common.proto";
import "legacy/proto/common.proto";

/// name = "msg-analytics-event-create"
/// parameters = []
Expand Down
6 changes: 3 additions & 3 deletions svc/pkg/build/proto/create.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ syntax = "proto3";

package rivet.backend.pkg.build.create;

import "proto/common.proto";
import "proto/backend/upload.proto";
import "proto/backend/build.proto";
import "legacy/proto/common.proto";
import "legacy/proto/backend/upload.proto";
import "legacy/proto/backend/build.proto";

message Request {
optional rivet.common.Uuid game_id = 1;
Expand Down
4 changes: 2 additions & 2 deletions svc/pkg/build/proto/get.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ syntax = "proto3";

package rivet.backend.pkg.build.get;

import "proto/common.proto";
import "proto/backend/build.proto";
import "legacy/proto/common.proto";
import "legacy/proto/backend/build.proto";

message Request {
repeated rivet.common.Uuid build_ids = 1;
Expand Down
2 changes: 1 addition & 1 deletion svc/pkg/build/proto/list-for-env.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ syntax = "proto3";

package rivet.backend.pkg.build.list_for_env;

import "proto/common.proto";
import "legacy/proto/common.proto";

message Request {
rivet.common.Uuid env_id = 1;
Expand Down
2 changes: 1 addition & 1 deletion svc/pkg/build/proto/list-for-game.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ syntax = "proto3";

package rivet.backend.pkg.build.list_for_game;

import "proto/common.proto";
import "legacy/proto/common.proto";

message Request {
rivet.common.Uuid game_id = 1;
Expand Down
4 changes: 2 additions & 2 deletions svc/pkg/captcha/proto/hcaptcha-config-get.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ syntax = "proto3";

package rivet.backend.pkg.captcha.hcaptcha_config_get;

import "proto/common.proto";
import "proto/backend/captcha.proto";
import "legacy/proto/common.proto";
import "legacy/proto/backend/captcha.proto";

message Request {
rivet.backend.captcha.CaptchaConfig.Hcaptcha config = 1;
Expand Down
2 changes: 1 addition & 1 deletion svc/pkg/captcha/proto/hcaptcha-verify.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ syntax = "proto3";

package rivet.backend.pkg.captcha.hcaptcha_verify;

import "proto/common.proto";
import "legacy/proto/common.proto";

message Request {
string client_response = 1;
Expand Down
Loading

0 comments on commit ed62de3

Please sign in to comment.