recce-nightly 1.10.0.20250629__py3-none-any.whl → 1.25.0.20251112a20664__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- recce/VERSION +1 -1
- recce/__init__.py +5 -0
- recce/adapter/dbt_adapter/__init__.py +116 -74
- recce/artifact.py +76 -3
- recce/cli.py +665 -69
- recce/config.py +2 -2
- recce/connect_to_cloud.py +1 -1
- recce/core.py +3 -3
- recce/data/404.html +1 -22
- recce/data/__next.__PAGE__.txt +10 -0
- recce/data/__next._full.txt +23 -0
- recce/data/__next._index.txt +8 -0
- recce/data/__next._tree.txt +12 -0
- recce/data/_next/static/JwV_pqetN5WamZZ7aGdfH/_buildManifest.js +11 -0
- recce/data/_next/static/JwV_pqetN5WamZZ7aGdfH/_clientMiddlewareManifest.json +1 -0
- recce/data/_next/static/chunks/0a2b2dd4b57049c2.js +1 -0
- recce/data/_next/static/chunks/19c10d219a6a21ff.js +1 -0
- recce/data/_next/static/chunks/24fd885c7180a612.js +1 -0
- recce/data/_next/static/chunks/27e66b2eab4adc32.js +19 -0
- recce/data/_next/static/chunks/67b1c6a62f19d429.js +110 -0
- recce/data/_next/static/chunks/71f88fcc615bf282.js +1 -0
- recce/data/_next/static/chunks/917619ab62a32388.js +1 -0
- recce/data/_next/static/chunks/93ba5a62932b704f.js +4 -0
- recce/data/_next/static/chunks/a43a2a5e06d5a92b.js +1 -0
- recce/data/_next/static/chunks/a6c78b24bd8b84fc.js +1 -0
- recce/data/_next/static/chunks/ba2d87265a68599d.css +2 -0
- recce/data/_next/static/chunks/c117fd1c1382dd83.js +11 -0
- recce/data/_next/static/chunks/c9425ca46eebdde9.js +1 -0
- recce/data/_next/static/chunks/cc8a9eadba012be0.css +6 -0
- recce/data/_next/static/chunks/e124bccf574a3361.css +1 -0
- recce/data/_next/static/chunks/e392ad92847c3e17.js +1 -0
- recce/data/_next/static/chunks/e4ce95efe88dae79.js +11 -0
- recce/data/_next/static/chunks/e69c777814fea6ed.js +2 -0
- recce/data/_next/static/chunks/turbopack-21cfd73037ff57ab.js +3 -0
- recce/data/_next/static/media/favicon.a8d38d84.ico +0 -0
- recce/data/_next/static/media/montserrat-cyrillic-800-normal.d80d830d.woff2 +0 -0
- recce/data/_next/static/media/{montserrat-cyrillic-800-normal.bd5c9f50.woff → montserrat-cyrillic-800-normal.f9d58125.woff} +0 -0
- recce/data/_next/static/media/montserrat-cyrillic-ext-800-normal.076c2a93.woff2 +0 -0
- recce/data/_next/static/media/montserrat-latin-800-normal.cde454cc.woff2 +0 -0
- recce/data/_next/static/media/{montserrat-latin-800-normal.fc315020.woff → montserrat-latin-800-normal.d5761935.woff} +0 -0
- recce/data/_next/static/media/montserrat-latin-ext-800-normal.40ec0659.woff2 +0 -0
- recce/data/_next/static/media/{montserrat-latin-ext-800-normal.2e5381b2.woff → montserrat-latin-ext-800-normal.b671449b.woff} +0 -0
- recce/data/_next/static/media/{montserrat-vietnamese-800-normal.20c545e6.woff → montserrat-vietnamese-800-normal.9f7b8541.woff} +0 -0
- recce/data/_next/static/media/montserrat-vietnamese-800-normal.f9eb854e.woff2 +0 -0
- recce/data/_not-found/__next._full.txt +17 -0
- recce/data/_not-found/__next._index.txt +8 -0
- recce/data/_not-found/__next._not-found.__PAGE__.txt +5 -0
- recce/data/_not-found/__next._not-found.txt +4 -0
- recce/data/_not-found/__next._tree.txt +10 -0
- recce/data/_not-found.html +1 -0
- recce/data/_not-found.txt +17 -0
- recce/data/auth_callback.html +1 -1
- recce/data/index.html +1 -27
- recce/data/index.txt +23 -8
- recce/event/__init__.py +9 -8
- recce/event/collector.py +6 -2
- recce/event/track.py +10 -0
- recce/github.py +1 -1
- recce/mcp_server.py +632 -0
- recce/models/types.py +23 -2
- recce/pull_request.py +1 -1
- recce/run.py +23 -16
- recce/server.py +165 -11
- recce/state/__init__.py +31 -0
- recce/state/cloud.py +632 -0
- recce/state/const.py +26 -0
- recce/state/local.py +56 -0
- recce/state/state.py +119 -0
- recce/state/state_loader.py +174 -0
- recce/summary.py +2 -1
- recce/tasks/dataframe.py +59 -2
- recce/tasks/rowcount.py +4 -1
- recce/tasks/schema.py +4 -1
- recce/tasks/valuediff.py +1 -1
- recce/util/api_token.py +11 -2
- recce/util/breaking.py +9 -0
- recce/util/cll.py +1 -2
- recce/util/io.py +2 -2
- recce/util/lineage.py +14 -18
- recce/util/perf_tracking.py +85 -0
- recce/util/recce_cloud.py +229 -5
- recce/yaml/__init__.py +2 -2
- recce_cloud/__init__.py +15 -0
- recce_cloud/api/__init__.py +17 -0
- recce_cloud/api/base.py +104 -0
- recce_cloud/api/client.py +150 -0
- recce_cloud/api/exceptions.py +26 -0
- recce_cloud/api/factory.py +63 -0
- recce_cloud/api/github.py +72 -0
- recce_cloud/api/gitlab.py +78 -0
- recce_cloud/artifact.py +57 -0
- recce_cloud/ci_providers/__init__.py +9 -0
- recce_cloud/ci_providers/base.py +82 -0
- recce_cloud/ci_providers/detector.py +147 -0
- recce_cloud/ci_providers/github_actions.py +136 -0
- recce_cloud/ci_providers/gitlab_ci.py +130 -0
- recce_cloud/cli.py +303 -0
- recce_cloud/upload.py +213 -0
- {recce_nightly-1.10.0.20250629.dist-info → recce_nightly-1.25.0.20251112a20664.dist-info}/METADATA +31 -27
- recce_nightly-1.25.0.20251112a20664.dist-info/RECORD +178 -0
- {recce_nightly-1.10.0.20250629.dist-info → recce_nightly-1.25.0.20251112a20664.dist-info}/top_level.txt +1 -0
- tests/adapter/dbt_adapter/test_dbt_cll.py +68 -17
- tests/recce_cloud/__init__.py +0 -0
- tests/recce_cloud/test_ci_providers.py +351 -0
- tests/recce_cloud/test_cli.py +372 -0
- tests/recce_cloud/test_client.py +273 -0
- tests/recce_cloud/test_platform_clients.py +279 -0
- tests/test_cli.py +106 -3
- tests/test_cli_mcp_optional.py +45 -0
- tests/test_cloud_listing_cli.py +324 -0
- tests/test_core.py +147 -0
- tests/test_mcp_server.py +332 -0
- tests/test_server.py +6 -6
- tests/test_summary.py +14 -6
- recce/data/_next/static/Mrb9CZ3toH6Q8xrzNzCrg/_buildManifest.js +0 -1
- recce/data/_next/static/chunks/181-acc61ddada3bc0ca.js +0 -43
- recce/data/_next/static/chunks/1bff33f1-1ef85cf5e658a751.js +0 -1
- recce/data/_next/static/chunks/217-879a84d70f7a907c.js +0 -2
- recce/data/_next/static/chunks/29e3cc0d-60045b2e47aa3916.js +0 -1
- recce/data/_next/static/chunks/36e1c10d-8e7be4a6c1f6ab2d.js +0 -1
- recce/data/_next/static/chunks/3998a672-03adacad07b346ac.js +0 -1
- recce/data/_next/static/chunks/3a92ee20-1081c360214f9602.js +0 -1
- recce/data/_next/static/chunks/41-f30276c289169376.js +0 -9
- recce/data/_next/static/chunks/450c323b-fd94e7ffaa4a5efa.js +0 -1
- recce/data/_next/static/chunks/47d8844f-929aed9b1c73a905.js +0 -1
- recce/data/_next/static/chunks/608-3b079b544e5d5f5e.js +0 -15
- recce/data/_next/static/chunks/6dc81886-adbfa45836061d79.js +0 -1
- recce/data/_next/static/chunks/7a8a3e83-edf6dc64b5d5f0a5.js +0 -1
- recce/data/_next/static/chunks/7f27ae6c-d5f0438edd5c2a5b.js +0 -1
- recce/data/_next/static/chunks/86730205-cfb14e3f051bab35.js +0 -1
- recce/data/_next/static/chunks/8d700b6a.8bb140898499c512.js +0 -1
- recce/data/_next/static/chunks/92-68460b15fe448f33.js +0 -1
- recce/data/_next/static/chunks/9746af58-a42b7d169cacadf0.js +0 -1
- recce/data/_next/static/chunks/a30376cd-de84559016d7e133.js +0 -1
- recce/data/_next/static/chunks/app/_not-found/page-01ed58b7f971d311.js +0 -1
- recce/data/_next/static/chunks/app/layout-292f035bb0d2a98e.js +0 -1
- recce/data/_next/static/chunks/app/page-598f8acc82179d01.js +0 -1
- recce/data/_next/static/chunks/b63b1b3f-4282bdcf459e075c.js +0 -1
- recce/data/_next/static/chunks/bbda5537-9ec25eb1dd62348a.js +0 -1
- recce/data/_next/static/chunks/c132bf7d-08cb668a789d6afd.js +0 -1
- recce/data/_next/static/chunks/ce84277d-2e5d1d46910cf052.js +0 -1
- recce/data/_next/static/chunks/febdd86e-c6b525341634b860.js +0 -54
- recce/data/_next/static/chunks/fee69bc6-2dbccaf9b90474e6.js +0 -1
- recce/data/_next/static/chunks/framework-ded83d71b51ce901.js +0 -1
- recce/data/_next/static/chunks/main-app-39061b0166c47f55.js +0 -1
- recce/data/_next/static/chunks/main-b5b3ae20a1405261.js +0 -1
- recce/data/_next/static/chunks/pages/_app-437c455677d62394.js +0 -1
- recce/data/_next/static/chunks/pages/_error-e7650df18ca04bde.js +0 -1
- recce/data/_next/static/chunks/webpack-7b49d5ba7e3a434d.js +0 -1
- recce/data/_next/static/css/17a96168e3a9db13.css +0 -1
- recce/data/_next/static/css/35c6679a098e1e34.css +0 -1
- recce/data/_next/static/css/951e2e0eea2d4a5b.css +0 -14
- recce/data/_next/static/css/a2b12b4ba4227f0a.css +0 -3
- recce/data/_next/static/media/montserrat-cyrillic-800-normal.22628180.woff2 +0 -0
- recce/data/_next/static/media/montserrat-cyrillic-ext-800-normal.94a63aea.woff2 +0 -0
- recce/data/_next/static/media/montserrat-latin-800-normal.6f8fa298.woff2 +0 -0
- recce/data/_next/static/media/montserrat-latin-ext-800-normal.013b84f9.woff2 +0 -0
- recce/data/_next/static/media/montserrat-vietnamese-800-normal.c0035377.woff2 +0 -0
- recce/state.py +0 -786
- recce_nightly-1.10.0.20250629.dist-info/RECORD +0 -154
- tests/test_state.py +0 -134
- /recce/data/_next/static/{Mrb9CZ3toH6Q8xrzNzCrg → JwV_pqetN5WamZZ7aGdfH}/_ssgManifest.js +0 -0
- /recce/data/_next/static/chunks/{polyfills-42372ed130431b0a.js → a6dad97d9634a72d.js} +0 -0
- /recce/data/_next/static/media/{montserrat-cyrillic-ext-800-normal.e6e0d8d0.woff → montserrat-cyrillic-ext-800-normal.a4fa76b5.woff} +0 -0
- /recce/data/_next/static/media/{reload-image.79aabb7d.svg → reload-image.7aa931c7.svg} +0 -0
- {recce_nightly-1.10.0.20250629.dist-info → recce_nightly-1.25.0.20251112a20664.dist-info}/WHEEL +0 -0
- {recce_nightly-1.10.0.20250629.dist-info → recce_nightly-1.25.0.20251112a20664.dist-info}/entry_points.txt +0 -0
- {recce_nightly-1.10.0.20250629.dist-info → recce_nightly-1.25.0.20251112a20664.dist-info}/licenses/LICENSE +0 -0
recce/data/index.txt
CHANGED
|
@@ -1,8 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
7:[
|
|
8
|
-
|
|
1
|
+
1:"$Sreact.fragment"
|
|
2
|
+
2:I[62638,["/_next/static/chunks/e4ce95efe88dae79.js","/_next/static/chunks/c117fd1c1382dd83.js"],"GoogleTagManager"]
|
|
3
|
+
3:I[84654,["/_next/static/chunks/e4ce95efe88dae79.js","/_next/static/chunks/c117fd1c1382dd83.js"],"default"]
|
|
4
|
+
4:I[2176,["/_next/static/chunks/c9425ca46eebdde9.js","/_next/static/chunks/a6c78b24bd8b84fc.js"],"default"]
|
|
5
|
+
5:I[22791,["/_next/static/chunks/c9425ca46eebdde9.js","/_next/static/chunks/a6c78b24bd8b84fc.js"],"default"]
|
|
6
|
+
6:I[83354,["/_next/static/chunks/c9425ca46eebdde9.js","/_next/static/chunks/a6c78b24bd8b84fc.js"],"ClientPageRoot"]
|
|
7
|
+
7:I[31713,["/_next/static/chunks/e4ce95efe88dae79.js","/_next/static/chunks/c117fd1c1382dd83.js","/_next/static/chunks/19c10d219a6a21ff.js","/_next/static/chunks/67b1c6a62f19d429.js"],"default"]
|
|
8
|
+
a:I[17436,["/_next/static/chunks/c9425ca46eebdde9.js","/_next/static/chunks/a6c78b24bd8b84fc.js"],"OutletBoundary"]
|
|
9
|
+
b:"$Sreact.suspense"
|
|
10
|
+
d:I[17436,["/_next/static/chunks/c9425ca46eebdde9.js","/_next/static/chunks/a6c78b24bd8b84fc.js"],"ViewportBoundary"]
|
|
11
|
+
f:I[17436,["/_next/static/chunks/c9425ca46eebdde9.js","/_next/static/chunks/a6c78b24bd8b84fc.js"],"MetadataBoundary"]
|
|
12
|
+
11:I[97102,[],"default"]
|
|
13
|
+
:HL["/_next/static/chunks/e124bccf574a3361.css","style"]
|
|
14
|
+
:HL["/_next/static/chunks/ba2d87265a68599d.css","style"]
|
|
15
|
+
:HC["/",""]
|
|
16
|
+
:HL["/_next/static/chunks/cc8a9eadba012be0.css","style"]
|
|
17
|
+
0:{"P":null,"b":"JwV_pqetN5WamZZ7aGdfH","c":["",""],"q":"","i":false,"f":[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/chunks/e124bccf574a3361.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","link","1",{"rel":"stylesheet","href":"/_next/static/chunks/ba2d87265a68599d.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/_next/static/chunks/e4ce95efe88dae79.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/_next/static/chunks/c117fd1c1382dd83.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","suppressHydrationWarning":true,"children":[["$","$L2",null,{"gtmId":"GTM-M2HVJQFD"}],["$","body",null,{"children":["$","$L3",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]]}]]}],{"children":[["$","$1","c",{"children":[["$","$L6",null,{"Component":"$7","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@8","$@9"]}}],[["$","link","0",{"rel":"stylesheet","href":"/_next/static/chunks/cc8a9eadba012be0.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/_next/static/chunks/19c10d219a6a21ff.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/_next/static/chunks/67b1c6a62f19d429.js","async":true,"nonce":"$undefined"}]],["$","$La",null,{"children":["$","$b",null,{"name":"Next.MetadataOutlet","children":"$@c"}]}]]}],{},null,false,false]},null,false,false],["$","$1","h",{"children":[null,["$","$Ld",null,{"children":"$@e"}],["$","div",null,{"hidden":true,"children":["$","$Lf",null,{"children":["$","$b",null,{"name":"Next.Metadata","children":"$@10"}]}]}],null]}],false]],"m":"$undefined","G":["$11",[]],"s":false,"S":true}
|
|
18
|
+
8:{}
|
|
19
|
+
9:"$0:f:0:1:1:children:0:props:children:0:props:serverProvidedParams:params"
|
|
20
|
+
e:[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]]
|
|
21
|
+
12:I[73523,["/_next/static/chunks/c9425ca46eebdde9.js","/_next/static/chunks/a6c78b24bd8b84fc.js"],"IconMark"]
|
|
22
|
+
10:[["$","title","0",{"children":"recce"}],["$","meta","1",{"name":"description","content":"Recce: Data validation toolkit for comprehensive PR review"}],["$","link","2",{"rel":"icon","href":"/favicon.ico?favicon.a8d38d84.ico","sizes":"32x32","type":"image/x-icon"}],["$","$L12","3",{}]]
|
|
23
|
+
c:null
|
recce/event/__init__.py
CHANGED
|
@@ -10,7 +10,7 @@ from typing import Dict
|
|
|
10
10
|
|
|
11
11
|
import sentry_sdk
|
|
12
12
|
|
|
13
|
-
from recce import get_runner, get_version, is_ci_env
|
|
13
|
+
from recce import get_runner, get_version, is_ci_env, is_recce_cloud_instance
|
|
14
14
|
from recce import yaml as pyml
|
|
15
15
|
from recce.event.collector import Collector
|
|
16
16
|
from recce.git import current_branch, hosting_repo
|
|
@@ -57,6 +57,7 @@ def init():
|
|
|
57
57
|
sentry_sdk.set_tag("platform", sys.platform)
|
|
58
58
|
sentry_sdk.set_tag("is_ci_env", is_ci_env())
|
|
59
59
|
sentry_sdk.set_tag("is_github_codespace", is_github_codespace())
|
|
60
|
+
sentry_sdk.set_tag("is_recce_cloud_instance", is_recce_cloud_instance())
|
|
60
61
|
sentry_sdk.set_tag("system_timezone", get_system_timezone())
|
|
61
62
|
|
|
62
63
|
|
|
@@ -78,7 +79,7 @@ def is_anonymous_tracking():
|
|
|
78
79
|
|
|
79
80
|
def _get_sentry_dns():
|
|
80
81
|
dns_file = os.path.normpath(os.path.join(os.path.dirname(__file__), "SENTRY_DNS"))
|
|
81
|
-
with open(dns_file) as f:
|
|
82
|
+
with open(dns_file, encoding="utf-8") as f:
|
|
82
83
|
dns = f.read().strip()
|
|
83
84
|
return dns
|
|
84
85
|
|
|
@@ -104,7 +105,7 @@ def _get_api_key():
|
|
|
104
105
|
|
|
105
106
|
config_file = os.path.abspath(os.path.join(os.path.dirname(__file__), "CONFIG"))
|
|
106
107
|
try:
|
|
107
|
-
with open(config_file) as fh:
|
|
108
|
+
with open(config_file, encoding="utf-8") as fh:
|
|
108
109
|
config = pyml.load(fh)
|
|
109
110
|
return config.get("event_api_key")
|
|
110
111
|
except Exception:
|
|
@@ -123,7 +124,7 @@ def _generate_user_profile():
|
|
|
123
124
|
user_id = hashlib.sha256(salted_name.encode()).hexdigest()
|
|
124
125
|
else:
|
|
125
126
|
user_id = uuid.uuid4().hex
|
|
126
|
-
with open(RECCE_USER_PROFILE, "w+") as f:
|
|
127
|
+
with open(RECCE_USER_PROFILE, "w+", encoding="utf-8") as f:
|
|
127
128
|
pyml.dump({"user_id": user_id, "anonymous_tracking": True}, f)
|
|
128
129
|
return dict(user_id=user_id, anonymous_tracking=True)
|
|
129
130
|
|
|
@@ -133,9 +134,9 @@ def load_user_profile():
|
|
|
133
134
|
if not os.path.exists(RECCE_USER_PROFILE):
|
|
134
135
|
user_profile = _generate_user_profile()
|
|
135
136
|
else:
|
|
136
|
-
with open(RECCE_USER_PROFILE, "r") as f:
|
|
137
|
+
with open(RECCE_USER_PROFILE, "r", encoding="utf-8") as f:
|
|
137
138
|
user_profile = pyml.load(f)
|
|
138
|
-
if user_profile.get("user_id") is None:
|
|
139
|
+
if user_profile is None or user_profile.get("user_id") is None:
|
|
139
140
|
user_profile = _generate_user_profile()
|
|
140
141
|
|
|
141
142
|
return user_profile
|
|
@@ -144,7 +145,7 @@ def load_user_profile():
|
|
|
144
145
|
def update_user_profile(update_values):
|
|
145
146
|
original = load_user_profile()
|
|
146
147
|
original.update(update_values)
|
|
147
|
-
with open(RECCE_USER_PROFILE, "w+") as f:
|
|
148
|
+
with open(RECCE_USER_PROFILE, "w+", encoding="utf-8") as f:
|
|
148
149
|
pyml.dump(original, f)
|
|
149
150
|
return original
|
|
150
151
|
|
|
@@ -154,7 +155,7 @@ def flush_events(command=None):
|
|
|
154
155
|
|
|
155
156
|
|
|
156
157
|
def should_log_event():
|
|
157
|
-
with open(RECCE_USER_PROFILE, "r") as f:
|
|
158
|
+
with open(RECCE_USER_PROFILE, "r", encoding="utf-8") as f:
|
|
158
159
|
user_profile = pyml.load(f)
|
|
159
160
|
# TODO: default anonymous_tracking to false if field is not present
|
|
160
161
|
tracking = user_profile.get("anonymous_tracking", False)
|
recce/event/collector.py
CHANGED
|
@@ -10,7 +10,7 @@ from json import JSONDecodeError
|
|
|
10
10
|
import portalocker
|
|
11
11
|
import requests
|
|
12
12
|
|
|
13
|
-
from recce import __version__, is_ci_env
|
|
13
|
+
from recce import __version__, is_ci_env, is_recce_cloud_instance
|
|
14
14
|
from recce.github import is_github_codespace
|
|
15
15
|
|
|
16
16
|
|
|
@@ -25,6 +25,7 @@ class Collector:
|
|
|
25
25
|
self._upload_threshold = 10
|
|
26
26
|
self._is_ci: bool = is_ci_env()
|
|
27
27
|
self._is_github_codespace: bool = is_github_codespace()
|
|
28
|
+
self._is_recce_cloud_instance: bool = is_recce_cloud_instance()
|
|
28
29
|
self._flush_timer = None
|
|
29
30
|
|
|
30
31
|
def schedule_flush(self):
|
|
@@ -109,6 +110,7 @@ class Collector:
|
|
|
109
110
|
python_version=python_version,
|
|
110
111
|
is_ci=self._is_ci,
|
|
111
112
|
is_github_codespace=self._is_github_codespace,
|
|
113
|
+
is_recce_cloud_instance=self._is_recce_cloud_instance,
|
|
112
114
|
)
|
|
113
115
|
|
|
114
116
|
if user_properties is not None:
|
|
@@ -138,6 +140,7 @@ class Collector:
|
|
|
138
140
|
@contextmanager
|
|
139
141
|
def load_json(self):
|
|
140
142
|
with portalocker.Lock(self._unsend_events_file, "r+", timeout=5) as f:
|
|
143
|
+
o = None
|
|
141
144
|
try:
|
|
142
145
|
o = json.loads(f.read())
|
|
143
146
|
yield o
|
|
@@ -147,7 +150,8 @@ class Collector:
|
|
|
147
150
|
finally:
|
|
148
151
|
f.seek(0)
|
|
149
152
|
f.truncate()
|
|
150
|
-
|
|
153
|
+
if o is not None:
|
|
154
|
+
f.write(json.dumps(o))
|
|
151
155
|
|
|
152
156
|
def send_events(self):
|
|
153
157
|
with self.load_json() as o:
|
recce/event/track.py
CHANGED
|
@@ -141,6 +141,16 @@ class TrackCommand(Command):
|
|
|
141
141
|
if recce_context is not None:
|
|
142
142
|
if recce_context.adapter_type == "dbt":
|
|
143
143
|
props["adapter_type"] = "DBT"
|
|
144
|
+
# Add dbt warehouse type only for dbt adapter
|
|
145
|
+
try:
|
|
146
|
+
from recce.adapter.dbt_adapter import DbtAdapter
|
|
147
|
+
|
|
148
|
+
dbt_adapter: DbtAdapter = recce_context.adapter
|
|
149
|
+
warehouse_type = dbt_adapter.adapter.type()
|
|
150
|
+
props["warehouse_type"] = warehouse_type
|
|
151
|
+
except Exception:
|
|
152
|
+
# If we can't get the warehouse type, skip it
|
|
153
|
+
pass
|
|
144
154
|
elif recce_context.adapter_type == "sqlmesh":
|
|
145
155
|
props["adapter_type"] = "SQLMesh"
|
|
146
156
|
|
recce/github.py
CHANGED
|
@@ -198,7 +198,7 @@ def get_github_codespace_available_at(codespace):
|
|
|
198
198
|
return None
|
|
199
199
|
|
|
200
200
|
def search_in_file(file_path, search_string):
|
|
201
|
-
with open(file_path, "r") as f:
|
|
201
|
+
with open(file_path, "r", encoding="utf-8") as f:
|
|
202
202
|
for _, line in enumerate(f, 1):
|
|
203
203
|
if search_string in line:
|
|
204
204
|
return line
|