Skip to content
Merged
Show file tree
Hide file tree
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
11 changes: 11 additions & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,23 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: actions/setup-python@v6
with:
python-version: "3.12"
- uses: actions/setup-node@v6
with:
node-version: "22"
- name: Check whitespace
run: |
set -euo pipefail
if [ "${{ github.event_name }}" = "pull_request" ]; then
git fetch --no-tags --depth=1 origin "${{ github.base_ref }}"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Avoid re-shallowing the base before diffing

In pull_request runs this fetch still uses --depth=1; even with the new checkout fetch-depth: 0, running a full clone followed by this exact fetch creates .git/shallow at the base tip, so git diff origin/${{ github.base_ref }}...HEAD can again fail with no merge base for a PR merge commit. Fresh evidence after the new change is that the later fetch is what reintroduces the shallow boundary; git fetch -h also distinguishes --depth <depth> from --unshallow, so the safer fix is to avoid the shallow fetch here or explicitly unshallow/fetch enough history before the three-dot diff.

Useful? React with 👍 / 👎.

git diff --check "origin/${{ github.base_ref }}...HEAD"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Fetch enough history before diffing PRs

In the pull_request path, this diff usually runs after actions/checkout has checked out the synthetic PR merge commit with its default shallow history (fetch-depth: 1). Fetching only the base branch tip at depth 1 leaves both commits grafted, so git diff origin/${{ github.base_ref }}...HEAD cannot find a merge base and exits with fatal: ... no merge base, failing CI for normal PRs before tests run. I reproduced the same sequence with a shallow checkout of a PR merge ref plus git fetch --depth=1 origin main; use a non-shallow checkout/fetch or diff against the appropriate event SHAs instead.

Useful? React with 👍 / 👎.

else
git diff-tree --check --no-commit-id --root -r HEAD
fi
- name: Validate runtime targets
run: python3 scripts/runtime_settings.py validate
- name: Run unit tests
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@ __pycache__/
.venv/
.wrangler/
local/
.env
.env.*
!*.env.example
web/strategy-switch-console/wrangler.toml
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ It supports the system but does not decide which strategy should be live. Strate
## Quick start

```bash
python -m pip install -e .
python -m pytest -q
python3 scripts/runtime_settings.py validate
python3 -m unittest discover -s tests -v
```

## Manual Strategy Switch
Expand Down
4 changes: 2 additions & 2 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ QuantRuntimeSettings 是 QuantStrategyLab 的运行配置包。为 QuantStrategy
## 快速开始

```bash
python -m pip install -e .
python -m pytest -q
python3 scripts/runtime_settings.py validate
python3 -m unittest discover -s tests -v
```

## 一键切换策略
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@ requires-python = ">=3.11"
[tool.ruff]
line-length = 120
target-version = "py311"