Skip to content

Commit

Permalink
Revert xtask
Browse files Browse the repository at this point in the history
  • Loading branch information
dotdat committed Sep 6, 2024
1 parent 949ad45 commit a12fe25
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 24 deletions.
2 changes: 0 additions & 2 deletions Cargo.lock

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

4 changes: 1 addition & 3 deletions xtask/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@ http = { workspace = true }
flate2 = { workspace = true }
futures = { workspace = true }
lazy_static = { workspace = true }
rover-client = { workspace = true }
rover-http = { workspace = true }
rover-std = { workspace = true }
rover-client = { workspace = true }
serde_yaml = { workspace = true }
serde_json = { workspace = true }
tar = { workspace = true }
Expand All @@ -34,7 +33,6 @@ shell-candy = { workspace = true }
tempfile = { workspace = true }
tokio = { workspace = true, features = ["rt", "rt-multi-thread", "macros"] }
tokio-stream = { workspace = true }
url = { workspace = true }
uuid = { workspace = true, features = ["v4"] }
which = { workspace = true }
zip = { workspace = true }
Expand Down
40 changes: 21 additions & 19 deletions xtask/src/commands/prep/templates_schema.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
use std::process::Command;
use std::time::Duration;
use std::{collections::HashMap, time::Duration};

use anyhow::{anyhow, Result};
use camino::Utf8PathBuf;
use url::Url;
use reqwest::Client;

use rover_client::{operations::graph::introspect, IntrospectionConfig};
use rover_http::{HttpServiceConfig, ReqwestService};
use rover_client::{
blocking::GraphQLClient,
operations::graph::introspect::{self, GraphIntrospectInput},
};
use rover_std::Fs;

const SCHEMA_PATH: &str = "./src/command/template/schema.graphql";
Expand All @@ -32,21 +34,21 @@ async fn introspect() -> Result<String> {
"fetching the latest templates schema by introspecting {}...",
&graphql_endpoint
);
let config = IntrospectionConfig::builder()
.endpoint(Url::parse(graphql_endpoint)?)
.should_retry(false)
.build()?;
let http_service = ReqwestService::builder()
.config(
HttpServiceConfig::builder()
.timeout(Duration::from_secs(10))
.build(),
)
.build()?;
introspect::run(config, http_service.into())
.await
.map(|response| response.schema_sdl)
.map_err(|err| err.into())
let graphql_client = GraphQLClient::new(
graphql_endpoint,
Client::new(),
Some(Duration::from_secs(10)),
);
introspect::run(
GraphIntrospectInput {
headers: HashMap::new(),
},
&graphql_client,
false,
)
.await
.map(|response| response.schema_sdl)
.map_err(|err| err.into())
}

fn regenerate_queries() -> Result<()> {
Expand Down

0 comments on commit a12fe25

Please sign in to comment.