Skip to content

Commit

Permalink
Handle sentry cli version
Browse files Browse the repository at this point in the history
  • Loading branch information
FirelightFlagboy committed Oct 17, 2024
1 parent 0196402 commit a5e8f0b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 14 deletions.
24 changes: 10 additions & 14 deletions misc/version_updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def _only_major_version(version: str) -> str:
r"ghcr.io/scille/parsec-cloud/parsec-testbed-server:[^\s]+",
"ghcr.io/scille/parsec-cloud/parsec-testbed-server:{version}",
)

SENTRY_CLI_GA_VERSION = ReplaceRegex("sentry-cli-version: [0-9.]+", "sentry-cli-version: {version}")

@enum.unique
class Tool(enum.Enum):
Expand All @@ -87,6 +87,7 @@ class Tool(enum.Enum):
WinFSP = "winfsp"
Testbed = "testbed"
PreCommit = "pre-commit"
SentryCLI = "sentry-cli"

def post_update_hook(self, updated_files: set[Path]) -> set[Path]:
updated: set[Path] = set()
Expand Down Expand Up @@ -190,7 +191,12 @@ def get_tools_version() -> dict[Tool, str]:


def get_tool_version(tool: Tool) -> str:
return get_tools_version()[tool]
try:
return get_tools_version()[tool]
except KeyError as ke:
raise ValueError(
f"Tool {tool.value} not found in the versions file {VERSIONS_FILE}"
) from ke


def set_tool_version(tool: Tool, version: str) -> None:
Expand Down Expand Up @@ -250,6 +256,7 @@ def set_tool_version(tool: Tool, version: str) -> None:
Tool.Node: [NODE_GA_VERSION],
Tool.WasmPack: [WASM_PACK_GA_VERSION],
Tool.WinFSP: [CI_WINFSP_VERSION],
Tool.SentryCLI: [SENTRY_CLI_GA_VERSION],
},
ROOT_DIR / "bindings/electron/package.json": {
Tool.License: [JSON_LICENSE_FIELD],
Expand Down Expand Up @@ -386,18 +393,7 @@ def set_tool_version(tool: Tool, version: str) -> None:
]
},
ROOT_DIR / "misc/versions.toml": {
Tool.Rust: [ReplaceRegex(r'rust = "[0-9.]+"', 'rust = "{version}"')],
Tool.Python: [ReplaceRegex(r'python = "[0-9.]+"', 'python = "{version}"')],
Tool.Poetry: [ReplaceRegex(r'poetry = "[0-9.]+"', 'poetry = "{version}"')],
Tool.Node: [ReplaceRegex(r'node = "[0-9.]+"', 'node = "{version}"')],
Tool.WasmPack: [ReplaceRegex(r'wasm-pack = "[0-9.]+"', 'wasm-pack = "{version}"')],
Tool.Nextest: [ReplaceRegex(r'nextest = "[0-9.]+"', 'nextest = "{version}"')],
Tool.Parsec: [ReplaceRegex(r'parsec = "[0-9.]+.*"', 'parsec = "{version}"')],
Tool.License: [ReplaceRegex(r'license = "[^\"]*"', 'license = "{version}"')],
Tool.PostgreSQL: [ReplaceRegex(r'postgres = "[0-9.]+"', 'postgres = "{version}"')],
Tool.WinFSP: [ReplaceRegex(r'winfsp = "[0-9.]+"', 'winfsp = "{version}"')],
Tool.Testbed: [ReplaceRegex(r'testbed = "[0-9.]+.*"', 'testbed = "{version}"')],
Tool.PreCommit: [ReplaceRegex(r'pre-commit = "[0-9.]+"', 'pre-commit = "{version}"')],
k: [ReplaceRegex(rf'{k.value} = "[0-9.]+"', f'{k.value} = "{{version}}"')] for k in Tool
},
ROOT_DIR / "server/packaging/server/in-docker-build.sh": {
Tool.Poetry: [
Expand Down
1 change: 1 addition & 0 deletions misc/versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ postgres = "14.10"
winfsp = "2.0.23075"
testbed = "3.0.3-a.0.dev.20000.fa2c652"
pre-commit = "3.7.1"
sentry-cli = "2.37.0"

0 comments on commit a5e8f0b

Please sign in to comment.