Skip to content

Commit 5183c5d

Browse files
authored
feat(vercel): Remove get_env_var_map helper (#104068)
Now that getsentry/getsentry#18932 and #103986 has merged, we can remove the `get_env_var_map` as you should now just use the `VercelEnvVarMapBuilder` class instead.
1 parent 13d530a commit 5183c5d

File tree

1 file changed

+0
-47
lines changed

1 file changed

+0
-47
lines changed

src/sentry/integrations/vercel/integration.py

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -108,53 +108,6 @@ class VercelEnvVarDefinition(TypedDict):
108108
target: list[str]
109109

110110

111-
# TODO: Remove this function and use the new VercelEnvVarMapBuilder class instead
112-
def get_env_var_map(
113-
organization: RpcOrganization,
114-
project: RpcProject,
115-
project_dsn: str,
116-
auth_token: str | None,
117-
framework: str,
118-
) -> dict[str, VercelEnvVarDefinition]:
119-
"""
120-
Returns a dictionary of environment variables to be set in Vercel for a given project.
121-
"""
122-
123-
is_next_js = framework == "nextjs"
124-
dsn_env_name = "NEXT_PUBLIC_SENTRY_DSN" if is_next_js else "SENTRY_DSN"
125-
return {
126-
"SENTRY_ORG": {
127-
"type": "encrypted",
128-
"value": organization.slug,
129-
"target": ["production", "preview"],
130-
},
131-
"SENTRY_PROJECT": {
132-
"type": "encrypted",
133-
"value": project.slug,
134-
"target": ["production", "preview"],
135-
},
136-
dsn_env_name: {
137-
"type": "encrypted",
138-
"value": project_dsn,
139-
"target": [
140-
"production",
141-
"preview",
142-
"development", # The DSN is the only value that makes sense to have available locally via Vercel CLI's `vercel dev` command
143-
],
144-
},
145-
"SENTRY_AUTH_TOKEN": {
146-
"type": "encrypted",
147-
"value": auth_token,
148-
"target": ["production", "preview"],
149-
},
150-
"VERCEL_GIT_COMMIT_SHA": {
151-
"type": "system",
152-
"value": "VERCEL_GIT_COMMIT_SHA",
153-
"target": ["production", "preview"],
154-
},
155-
}
156-
157-
158111
class VercelEnvVarMapBuilder:
159112
"""
160113
Builder for creating Vercel environment variable maps.

0 commit comments

Comments
 (0)