From 6d38901ee2ffee5754bc6297b9aede0d813107bb Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Tue, 6 Jun 2023 17:41:09 +0200 Subject: [PATCH 1/3] Improve error message --- tools/automator/src/sponsors.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/automator/src/sponsors.rs b/tools/automator/src/sponsors.rs index 1f8ef0e87..402bda44a 100644 --- a/tools/automator/src/sponsors.rs +++ b/tools/automator/src/sponsors.rs @@ -1,5 +1,6 @@ use std::{cmp::Ordering, fmt::Write}; +use anyhow::Context; use chrono::{DateTime, Utc}; use octocrab::Octocrab; @@ -42,7 +43,8 @@ impl Sponsors { } }", ) - .await?; + .await + .context("GraphQL query failed")?; let mut sponsors = response .data From bc5c34615f76569ac459020335b411d8b8977b75 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Mon, 12 Jun 2023 17:36:25 +0200 Subject: [PATCH 2/3] Fix automator with latest Octocrab --- tools/automator/src/sponsors.rs | 56 ++++++++++++++++++--------------- 1 file changed, 30 insertions(+), 26 deletions(-) diff --git a/tools/automator/src/sponsors.rs b/tools/automator/src/sponsors.rs index 402bda44a..138e68832 100644 --- a/tools/automator/src/sponsors.rs +++ b/tools/automator/src/sponsors.rs @@ -1,4 +1,4 @@ -use std::{cmp::Ordering, fmt::Write}; +use std::{cmp::Ordering, collections::HashMap, fmt::Write}; use anyhow::Context; use chrono::{DateTime, Utc}; @@ -11,38 +11,42 @@ pub struct Sponsors { impl Sponsors { pub async fn query(octocrab: &Octocrab) -> anyhow::Result { - let response: QueryResult = octocrab - .graphql( - "query { - viewer { - sponsors(first: 100) { - nodes { - __typename - ... on User { - login - sponsorshipForViewerAsSponsorable { - createdAt - tier { - monthlyPriceInDollars - } - isOneTimePayment + let graphql_query = "\ + query { + viewer { + sponsors(first: 100) { + nodes { + __typename + ... on User { + login + sponsorshipForViewerAsSponsorable { + createdAt + tier { + monthlyPriceInDollars } + isOneTimePayment } - ... on Organization { - login - sponsorshipForViewerAsSponsorable { - createdAt - tier { - monthlyPriceInDollars - } - isOneTimePayment + } + ... on Organization { + login + sponsorshipForViewerAsSponsorable { + createdAt + tier { + monthlyPriceInDollars } + isOneTimePayment } } } } - }", - ) + } + }"; + + let mut json_object = HashMap::new(); + json_object.insert("query", graphql_query); + + let response: QueryResult = octocrab + .graphql(&json_object) .await .context("GraphQL query failed")?; From 84c390d959af49367bd084802ec505f0ece9793d Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Mon, 12 Jun 2023 17:36:46 +0200 Subject: [PATCH 3/3] Update sponsors in README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b70b9177c..554308954 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ For an introduction of what the project aims to achieve, [please check out the w ## Sponsors -Fornjot is supported by [**@webtrax-oz**](https://github.com/webtrax-oz), [**@reivilibre**](https://github.com/reivilibre), [**@lthiery**](https://github.com/lthiery), [**@ahdinosaur**](https://github.com/ahdinosaur), [**@martindederer**](https://github.com/martindederer), [**@bollian**](https://github.com/bollian), [**@rozgo**](https://github.com/rozgo), [**@nullstyle**](https://github.com/nullstyle), [**@tachiniererin**](https://github.com/tachiniererin), [**@sucaba**](https://github.com/sucaba), [**@Kethku**](https://github.com/Kethku), [**@jessebraham**](https://github.com/jessebraham), [**@seanjensengrey**](https://github.com/seanjensengrey), [**@MattOslin**](https://github.com/MattOslin), [**@benwis**](https://github.com/benwis), [**@happysalada**](https://github.com/happysalada), [**@jminer**](https://github.com/jminer), [**@jeevcat**](https://github.com/jeevcat), [**@voxpelli**](https://github.com/voxpelli), [**@U007D**](https://github.com/U007D), [**@guillaumechauvat**](https://github.com/guillaumechauvat), [**@MitchellHansen**](https://github.com/MitchellHansen), [**@mayfieldiv**](https://github.com/mayfieldiv), [**@ksindi**](https://github.com/ksindi), and [my other awesome sponsors](https://github.com/sponsors/hannobraun). Thank you! +Fornjot is supported by [**@MitchellHansen**](https://github.com/MitchellHansen), [**@webtrax-oz**](https://github.com/webtrax-oz), [**@reivilibre**](https://github.com/reivilibre), [**@lthiery**](https://github.com/lthiery), [**@ahdinosaur**](https://github.com/ahdinosaur), [**@martindederer**](https://github.com/martindederer), [**@bollian**](https://github.com/bollian), [**@nullstyle**](https://github.com/nullstyle), [**@tachiniererin**](https://github.com/tachiniererin), [**@HalfVoxel**](https://github.com/HalfVoxel), [**@sucaba**](https://github.com/sucaba), [**@Kethku**](https://github.com/Kethku), [**@jessebraham**](https://github.com/jessebraham), [**@seanjensengrey**](https://github.com/seanjensengrey), [**@MattOslin**](https://github.com/MattOslin), [**@benwis**](https://github.com/benwis), [**@happysalada**](https://github.com/happysalada), [**@jminer**](https://github.com/jminer), [**@jeevcat**](https://github.com/jeevcat), [**@voxpelli**](https://github.com/voxpelli), [**@U007D**](https://github.com/U007D), [**@guillaumechauvat**](https://github.com/guillaumechauvat), [**@mayfieldiv**](https://github.com/mayfieldiv), and [my other awesome sponsors](https://github.com/sponsors/hannobraun). Thank you! **Please consider [supporting me too](https://github.com/sponsors/hannobraun), to help make Fornjot sustainable long-term.**