Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 0 additions & 47 deletions src/sentry/integrations/vercel/integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,53 +108,6 @@ class VercelEnvVarDefinition(TypedDict):
target: list[str]


# TODO: Remove this function and use the new VercelEnvVarMapBuilder class instead
def get_env_var_map(
organization: RpcOrganization,
project: RpcProject,
project_dsn: str,
auth_token: str | None,
framework: str,
) -> dict[str, VercelEnvVarDefinition]:
"""
Returns a dictionary of environment variables to be set in Vercel for a given project.
"""

is_next_js = framework == "nextjs"
dsn_env_name = "NEXT_PUBLIC_SENTRY_DSN" if is_next_js else "SENTRY_DSN"
return {
"SENTRY_ORG": {
"type": "encrypted",
"value": organization.slug,
"target": ["production", "preview"],
},
"SENTRY_PROJECT": {
"type": "encrypted",
"value": project.slug,
"target": ["production", "preview"],
},
dsn_env_name: {
"type": "encrypted",
"value": project_dsn,
"target": [
"production",
"preview",
"development", # The DSN is the only value that makes sense to have available locally via Vercel CLI's `vercel dev` command
],
},
"SENTRY_AUTH_TOKEN": {
"type": "encrypted",
"value": auth_token,
"target": ["production", "preview"],
},
"VERCEL_GIT_COMMIT_SHA": {
"type": "system",
"value": "VERCEL_GIT_COMMIT_SHA",
"target": ["production", "preview"],
},
}


class VercelEnvVarMapBuilder:
"""
Builder for creating Vercel environment variable maps.
Expand Down
Loading