about summary refs log tree commit diff
path: root/third_party/lieer/default.nix
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2020-07-06T21·30+0100
committertazjin <mail@tazj.in>2020-07-06T21·35+0000
commit8b5859319347a0da80e9d7fd4dd1a7b5dec84e52 (patch)
tree88c611e22d0b4fb61feb73b54b0786dcd51b4471 /third_party/lieer/default.nix
parenta0f9ae996d33a82b3cf057f92d5560f7f730a44d (diff)
fix(3p/lieer): Work around issues in Google Mail API r/1226
There is a temporary issue affecting the retrieval of discovery
documents in the Google Mail API:
https://issuetracker.google.com/issues/160441983

It's possible to work around this by hardcoding the document instead
of retrieving it over the network, as all other API calls still work
as they should.

This does exactly that by generating a patch to apply to lieer, from
the file checked in to the depot with this commit.

This workaround should be reverted once Google has fixed the issue
upstream.

Change-Id: I0063d0bc67753ffa5261c2aa059c7bfd09136ba0
Reviewed-on: https://cl.tvl.fyi/c/depot/+/945
Tested-by: BuildkiteCI
Reviewed-by: isomer <isomer@tvl.fyi>
Diffstat (limited to 'third_party/lieer/default.nix')
-rw-r--r--third_party/lieer/default.nix5
1 files changed, 5 insertions, 0 deletions
diff --git a/third_party/lieer/default.nix b/third_party/lieer/default.nix
index 6dd4cecd1d3f..0ab40f752faa 100644
--- a/third_party/lieer/default.nix
+++ b/third_party/lieer/default.nix
@@ -26,6 +26,10 @@ let
     export PROJECT_ID='${project}'
     cat ${./api_client.patch} | ${gettext}/bin/envsubst > $out
   '';
+  discoveryPatch = runCommand "discovery_doc.patch" {} ''
+    export DISCOVERY_DOC='${./gmail-api.json}'
+    cat ${./discovery_doc.patch} | ${gettext}/bin/envsubst > $out
+  '';
 in python3Packages.buildPythonApplication rec {
   name = "lieer-${version}";
   version = "1.0";
@@ -39,6 +43,7 @@ in python3Packages.buildPythonApplication rec {
 
   patches = [
     authPatch
+    discoveryPatch
     ./send_scope.patch
   ];