Skip to content

Commit 67cf6ad

Browse files
refactor(spaces): no more spaces (#9961)
### Description Deletes spaces code ### Testing Instructions <!-- Give a quick description of steps to test your changes. -->
1 parent 7c991a0 commit 67cf6ad

File tree

30 files changed

+211
-1549
lines changed

30 files changed

+211
-1549
lines changed

crates/turborepo-api-client/src/lib.rs

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ use serde::Deserialize;
1313
use turborepo_ci::{is_ci, Vendor};
1414
use turborepo_vercel_api::{
1515
token::ResponseTokenMetadata, APIError, CachingStatus, CachingStatusResponse,
16-
PreflightResponse, SpacesResponse, Team, TeamsResponse, UserResponse, VerificationResponse,
17-
VerifiedSsoUser,
16+
PreflightResponse, Team, TeamsResponse, UserResponse, VerificationResponse, VerifiedSsoUser,
1817
};
1918
use url::Url;
2019

@@ -23,7 +22,6 @@ pub use crate::error::{Error, Result};
2322
pub mod analytics;
2423
mod error;
2524
mod retry;
26-
pub mod spaces;
2725
pub mod telemetry;
2826

2927
pub use bytes::Bytes;
@@ -43,11 +41,6 @@ pub trait Client {
4341
team_id: &str,
4442
) -> impl Future<Output = Result<Option<Team>>> + Send;
4543
fn add_ci_header(request_builder: RequestBuilder) -> RequestBuilder;
46-
fn get_spaces(
47-
&self,
48-
token: &str,
49-
team_id: Option<&str>,
50-
) -> impl Future<Output = Result<SpacesResponse>> + Send;
5144
fn verify_sso_token(
5245
&self,
5346
token: &str,
@@ -199,29 +192,6 @@ impl Client for APIClient {
199192
request_builder
200193
}
201194

202-
async fn get_spaces(&self, token: &str, team_id: Option<&str>) -> Result<SpacesResponse> {
203-
// create url with teamId if provided
204-
let endpoint = match team_id {
205-
Some(team_id) => format!("/v0/spaces?limit=100&teamId={}", team_id),
206-
None => "/v0/spaces?limit=100".to_string(),
207-
};
208-
209-
let request_builder = self
210-
.client
211-
.get(self.make_url(endpoint.as_str())?)
212-
.header("User-Agent", self.user_agent.clone())
213-
.header("Content-Type", "application/json")
214-
.header("Authorization", format!("Bearer {}", token));
215-
216-
let response =
217-
retry::make_retryable_request(request_builder, retry::RetryStrategy::Timeout)
218-
.await?
219-
.into_response()
220-
.error_for_status()?;
221-
222-
Ok(response.json().await?)
223-
}
224-
225195
async fn verify_sso_token(&self, token: &str, token_name: &str) -> Result<VerifiedSsoUser> {
226196
let request_builder = self
227197
.client

crates/turborepo-api-client/src/spaces.rs

Lines changed: 0 additions & 264 deletions
This file was deleted.

crates/turborepo-auth/src/auth/login.rs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,8 @@ mod tests {
147147
use async_trait::async_trait;
148148
use reqwest::{Method, RequestBuilder, Response};
149149
use turborepo_vercel_api::{
150-
CachingStatus, CachingStatusResponse, Membership, Role, SpacesResponse, Team,
151-
TeamsResponse, User, UserResponse, VerifiedSsoUser,
150+
CachingStatus, CachingStatusResponse, Membership, Role, Team, TeamsResponse, User,
151+
UserResponse, VerifiedSsoUser,
152152
};
153153
use turborepo_vercel_api_mock::start_test_server;
154154

@@ -247,13 +247,6 @@ mod tests {
247247
fn add_ci_header(_request_builder: RequestBuilder) -> RequestBuilder {
248248
unimplemented!("add_ci_header")
249249
}
250-
async fn get_spaces(
251-
&self,
252-
_token: &str,
253-
_team_id: Option<&str>,
254-
) -> turborepo_api_client::Result<SpacesResponse> {
255-
unimplemented!("get_spaces")
256-
}
257250
async fn verify_sso_token(
258251
&self,
259252
token: &str,

crates/turborepo-auth/src/auth/logout.rs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,7 @@ mod tests {
8888
use turborepo_api_client::Client;
8989
use turborepo_ui::ColorConfig;
9090
use turborepo_vercel_api::{
91-
token::ResponseTokenMetadata, SpacesResponse, Team, TeamsResponse, UserResponse,
92-
VerifiedSsoUser,
91+
token::ResponseTokenMetadata, Team, TeamsResponse, UserResponse, VerifiedSsoUser,
9392
};
9493
use url::Url;
9594

@@ -116,13 +115,6 @@ mod tests {
116115
fn add_ci_header(_request_builder: RequestBuilder) -> RequestBuilder {
117116
unimplemented!("add_ci_header")
118117
}
119-
async fn get_spaces(
120-
&self,
121-
_token: &str,
122-
_team_id: Option<&str>,
123-
) -> turborepo_api_client::Result<SpacesResponse> {
124-
unimplemented!("get_spaces")
125-
}
126118
async fn verify_sso_token(
127119
&self,
128120
token: &str,

crates/turborepo-auth/src/auth/sso.rs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,8 @@ mod tests {
148148
use reqwest::{Method, RequestBuilder, Response};
149149
use turborepo_vercel_api::{
150150
token::{ResponseTokenMetadata, Scope},
151-
CachingStatus, CachingStatusResponse, Membership, Role, SpacesResponse, Team,
152-
TeamsResponse, User, UserResponse, VerifiedSsoUser,
151+
CachingStatus, CachingStatusResponse, Membership, Role, Team, TeamsResponse, User,
152+
UserResponse, VerifiedSsoUser,
153153
};
154154
use turborepo_vercel_api_mock::start_test_server;
155155

@@ -244,13 +244,6 @@ mod tests {
244244
fn add_ci_header(_request_builder: RequestBuilder) -> RequestBuilder {
245245
unimplemented!("add_ci_header")
246246
}
247-
async fn get_spaces(
248-
&self,
249-
_token: &str,
250-
_team_id: Option<&str>,
251-
) -> turborepo_api_client::Result<SpacesResponse> {
252-
unimplemented!("get_spaces")
253-
}
254247
async fn verify_sso_token(
255248
&self,
256249
token: &str,

0 commit comments

Comments
 (0)