File tree Expand file tree Collapse file tree 6 files changed +13
-6
lines changed
packages/libraries/router/src Expand file tree Collapse file tree 6 files changed +13
-6
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' hive-apollo-router-plugin ' : patch
3+ ---
4+
5+ Use the correct plugin version in the User-Agent header used for Console requests
Original file line number Diff line number Diff line change 1+ use crate :: consts:: PLUGIN_VERSION ;
2+
13use super :: graphql:: OperationProcessor ;
24use graphql_parser:: schema:: { parse_schema, Document } ;
35use reqwest:: Client ;
@@ -10,8 +12,6 @@ use std::{
1012use thiserror:: Error ;
1113use tokio:: sync:: Mutex as AsyncMutex ;
1214
13- static COMMIT : Option < & ' static str > = option_env ! ( "GITHUB_SHA" ) ;
14-
1515#[ derive( Serialize , Debug ) ]
1616pub struct Report {
1717 size : usize ,
@@ -299,7 +299,7 @@ impl UsageAgent {
299299 )
300300 . header (
301301 reqwest:: header:: USER_AGENT ,
302- format ! ( "hive-apollo-router/{}" , COMMIT . unwrap_or ( "local" ) ) ,
302+ format ! ( "hive-apollo-router/{}" , PLUGIN_VERSION ) ,
303303 )
304304 . json ( & report)
305305 . send ( )
Original file line number Diff line number Diff line change 1+ pub const PLUGIN_VERSION : & str = env ! ( "CARGO_PKG_VERSION" ) ;
Original file line number Diff line number Diff line change 11mod agent;
2+ pub mod consts;
23mod graphql;
34pub mod persisted_documents;
45pub mod registry;
Original file line number Diff line number Diff line change 11// Specify the modules our binary should include -- https://twitter.com/YassinEldeeb7/status/1468680104243077128
22mod agent;
3+ mod consts;
34mod graphql;
45mod persisted_documents;
56mod registry;
Original file line number Diff line number Diff line change 1+ use crate :: consts:: PLUGIN_VERSION ;
12use crate :: registry_logger:: Logger ;
23use anyhow:: { anyhow, Result } ;
34use sha2:: Digest ;
@@ -24,8 +25,6 @@ pub struct HiveRegistryConfig {
2425 schema_file_path : Option < String > ,
2526}
2627
27- static COMMIT : Option < & ' static str > = option_env ! ( "GITHUB_SHA" ) ;
28-
2928impl HiveRegistry {
3029 #[ allow( clippy:: new_ret_no_self) ]
3130 pub fn new ( user_config : Option < HiveRegistryConfig > ) -> Result < ( ) > {
@@ -171,7 +170,7 @@ impl HiveRegistry {
171170 headers. insert (
172171 reqwest:: header:: USER_AGENT ,
173172 reqwest:: header:: HeaderValue :: from_str (
174- format ! ( "hive-apollo-router/{}" , COMMIT . unwrap_or ( "local" ) ) . as_str ( ) ,
173+ format ! ( "hive-apollo-router/{}" , PLUGIN_VERSION ) . as_str ( ) ,
175174 )
176175 . unwrap ( ) ,
177176 ) ;
You can’t perform that action at this time.
0 commit comments