Skip to content
Snippets Groups Projects
Unverified Commit d3357c95 authored by Cam Saul's avatar Cam Saul Committed by GitHub
Browse files

Merge `:google` driver into `:googleanalytics` (#21002)

* Remove :google driver

* Remove unneeded stuff

* Remove another reference to :google driver

* Remove another reference to :google
parent 054e3738
Branches
Tags
No related merge requests found
......@@ -260,7 +260,6 @@
["modules/drivers/bigquery/test"
"modules/drivers/bigquery-cloud-sdk/test"
"modules/drivers/druid/test"
"modules/drivers/google/test"
"modules/drivers/googleanalytics/test"
"modules/drivers/mongo/test"
"modules/drivers/oracle/test"
......@@ -298,7 +297,6 @@
"modules/drivers/bigquery/src"
"modules/drivers/bigquery-cloud-sdk/src"
"modules/drivers/druid/src"
"modules/drivers/google/src"
"modules/drivers/googleanalytics/src"
"modules/drivers/mongo/src"
"modules/drivers/oracle/src"
......
{:deps
{metabase/bigquery-cloud-sdk {:local/root "bigquery-cloud-sdk"}
metabase/druid {:local/root "druid"}
metabase/google {:local/root "google"}
metabase/googleanalytics {:local/root "googleanalytics"}
metabase/mongo {:local/root "mongo"}
metabase/oracle {:local/root "oracle"}
......
{:paths
["src" "resources"]
:deps
;; ensure the version of google-http-client transitively depended on here matches that of bigquery-cloud-sdk
;; (which, at the moment, is 1.39.2)
{com.google.api-client/google-api-client {:mvn/version "1.32.1"}
;; for some reason, Google stopped depending on google-http-client-jackson2 from google-api-client somewhere between
;; 1.30.7 and 1.32.1, so we must explicitly bring it in because the google driver uses it directly
;; this version is closest to depending on Jackson 2.12.3, which is the version transitively depended on by
;; bigquery-cloud-sdk
com.google.http-client/google-http-client-jackson2 {:mvn/version "1.39.2-sp.1"}}}
info:
name: Metabase Google Drivers Shared Dependencies
version: 1.0.0-SNAPSHOT-1.30.7
description: Shared dependencies for BigQuery, Google Analytics, and other Google drivers.
driver:
name: google
abstract: true
lazy-load: true
init:
- step: load-namespace
namespace: metabase.driver.google
{:paths ["src" "resources"]
:deps
;; ensure the version of google-http-client transitively depended on here matches that of bigquery-cloud-sdk
;; (which, at the moment, is 1.39.2)
{com.google.apis/google-api-services-analytics {:mvn/version "v3-rev20190807-1.32.1"}}
:metabase.driver/parents #{:google}}
{com.google.apis/google-api-services-analytics {:mvn/version "v3-rev20190807-1.32.1"}
;; for some reason, Google stopped depending on google-http-client-jackson2 from google-api-client somewhere between
;; 1.30.7 and 1.32.1, so we must explicitly bring it in because the google driver uses it directly
com.google.http-client/google-http-client-jackson2 {:mvn/version "1.39.2-sp.1"}}}
......@@ -2,13 +2,10 @@ info:
name: Metabase Google Analytics Driver
version: 1.0.0-SNAPSHOT-1.27.0
description: Allows Metabase to connect to Google Analytics accounts.
dependencies:
- plugin: Metabase Google Drivers Shared Dependencies
driver:
name: googleanalytics
display-name: Google Analytics
lazy-load: true
parent: google
connection-properties:
- name: account-id
display-name: Google Analytics Account ID
......@@ -23,7 +20,5 @@ driver:
- advanced-options-start
- default-advanced-options
init:
- step: load-namespace
namespace: metabase.driver.google
- step: load-namespace
namespace: metabase.driver.googleanalytics
......@@ -2,7 +2,6 @@
"Shared logic for various Google drivers, including BigQuery and Google Analytics."
(:require [clojure.tools.logging :as log]
[metabase.config :as config]
[metabase.driver :as driver]
[metabase.models.database :refer [Database]]
[metabase.query-processor.error-type :as error-type]
[metabase.util :as u]
......@@ -18,8 +17,6 @@
com.google.api.client.json.JsonFactory
java.io.ByteArrayInputStream))
(driver/register! :google, :abstract? true)
(def ^HttpTransport http-transport
"`HttpTransport` for use with Google drivers."
(GoogleNetHttpTransport/newTrustedTransport))
......
......@@ -11,10 +11,9 @@
[metabase.util :as u]
[metabase.util.i18n :refer [tru]])
(:import [com.google.api.services.analytics Analytics Analytics$Data$Ga$Get]
[com.google.api.services.analytics.model Column Profile Profiles Webproperties Webproperty]
java.util.Date))
[com.google.api.services.analytics.model Column Profile Profiles Webproperties Webproperty]))
(driver/register! :googleanalytics, :parent :google)
(driver/register! :googleanalytics)
(defmethod driver/supports? [:googleanalytics :basic-aggregations] [_ _] false)
......
......@@ -2,10 +2,10 @@
(:require [clojure.test :refer :all]
[metabase.driver.google :as google]))
(deftest create-application-name-test
(deftest ^:parallel create-application-name-test
(testing "Typical scenario, all config information included"
(is (= "Metabase/v0.30.0-snapshot (GPN:Metabase; NWNjNWY0Mw== master)"
(#'google/create-application-name {:tag "v0.30.0-snapshot", :hash "5cc5f43", :branch "master", :date "2018-08-21"}))))
(#'google/create-application-name {:tag "v0.30.0-snapshot", :hash "5cc5f43", :branch "master", :date "2018-08-21"}))))
(testing (str "It's possible to have two hashes come back from our script. Sending a string with a newline in it "
"for the application name will cause Google connections to fail")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment