Skip to content

refactor: deduplicate hardcoded version strings - #50

Closed
wasim-builds wants to merge 8 commits into
Fei-Away:mainfrom
wasim-builds:single-source-version
Closed

refactor: deduplicate hardcoded version strings#50
wasim-builds wants to merge 8 commits into
Fei-Away:mainfrom
wasim-builds:single-source-version

Conversation

@wasim-builds

Copy link
Copy Markdown
Contributor

Fixes #19. Made macos/VERSION the single source of truth. Read the version string dynamically during build/runtime from this file instead of hardcoding 1.1.2 across multiple files. Also removed the hardcoded version from package.json.

Copilot AI review requested due to automatic review settings July 16, 2026 17:46

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses issue #19 by making macos/VERSION the single source of truth for the Dream Skin Studio version, removing duplicated hardcoded version strings and reading the version dynamically during build/runtime.

Changes:

  • Read SKIN_VERSION from macos/VERSION in the injector and shared macOS shell helpers instead of hardcoding 1.1.2.
  • Update macOS tests and client release packaging text to reference macos/VERSION.
  • Remove the hardcoded "version" field from macos/package.json.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
macos/tests/run-tests.sh Updates version assertions to be derived from macos/VERSION.
macos/scripts/injector.mjs Loads SKIN_VERSION from macos/VERSION at runtime.
macos/scripts/common-macos.sh Sets SKIN_VERSION by reading macos/VERSION for shared scripts.
macos/scripts/build-client-release.sh Uses macos/VERSION when generating client-facing instructions text.
macos/package.json Removes hardcoded package version to avoid duplication.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread macos/tests/run-tests.sh Outdated
EXPECTED_BUNDLE="/Applications/Codex \$(touch \"$STATE_EVAL_MARKER\").app"
EXPECTED_EXE="$EXPECTED_BUNDLE/Contents/MacOS/ChatGPT; touch \"$STATE_EVAL_MARKER\""
EXPECTED_VERSION='1.1.2 "nightly"'
EXPECTED_VERSION="$(/bin/cat "$ROOT/VERSION" 2>/dev/null | /usr/bin/tr -d '\\n\\r') \\"nightly\\""
Comment thread macos/tests/run-tests.sh Outdated
/usr/bin/cmp -s "$NO_DESKTOP_CONFIG" "$TMP/original-without-desktop.toml"

/usr/bin/env -u HOME /bin/bash -c '. "$1/scripts/common-macos.sh"; [ -n "$HOME" ] && [ "$SKIN_VERSION" = "1.1.2" ]' _ "$ROOT"
/usr/bin/env -u HOME /bin/bash -c '. "$1/scripts/common-macos.sh"; [ -n "$HOME" ] && [ "$SKIN_VERSION" = "$(/bin/cat "$ROOT/VERSION" 2>/dev/null | /usr/bin/tr -d '\''\n\r'\'')" ]' _ "$ROOT"
Comment thread macos/scripts/common-macos.sh Outdated
INJECTOR_JOB_LABEL="com.openai.codex-dream-skin-studio.injector"
EXPECTED_CODEX_TEAM_ID="${CODEX_EXPECTED_TEAM_ID:-2DC432GLL2}"
SKIN_VERSION="1.1.2"
SKIN_VERSION="$(/bin/cat "$PROJECT_ROOT/VERSION" 2>/dev/null | /usr/bin/tr -d '\\n\\r')"
Comment thread macos/scripts/build-client-release.sh Outdated

/usr/bin/printf '%s\n' \
'Codex 主题编辑器 1.1.2' \
'Codex 主题编辑器 '"$(/bin/cat "$ROOT/VERSION" 2>/dev/null | /usr/bin/tr -d '\\n\\r')" \\
@Fei-Away

Copy link
Copy Markdown
Owner

Thanks for this! Main now sources the version from a single VERSION file, which covers what this PR was after. Closing to avoid duplicate work — appreciate you digging into this!

感谢!main 现在统一从单一的 VERSION 文件读取版本号,已经覆盖了这个 PR 的目标。先关闭,谢谢你的investigate!

@Fei-Away Fei-Away closed this Jul 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Maintainability] 版本号硬编码在 6 处,缺单一真相源 / Version string duplicated across 6 files

3 participants