mirror of
https://github.com/tiennm99/time-mocker.git
synced 2026-10-03 07:13:43 +00:00
chore: add push/PR CI, drop unused windows dep, refresh docs
Add a CI workflow running fmt, clippy with warnings denied, and the test suite on every push and pull request. Remove the unused workspace windows dependency now that only windows-sys is used. Update the README architecture name and Java harness reference, clarify the plans gitignore comment, and carry the code-reviewer agent memory.
This commit is contained in:
1 parent
ffab962360
commit
1da4af498b
6 files changed
+51
-4
No files matched your search
@@ -0,0 +1 @@
|
||||
- [History rewrite verification](feedback_history-rewrite-verification.md) — raw-byte message compare, empty-tree fsck false positive, merge commits in "linear" chains
|
||||
@@ -0,0 +1,18 @@
|
||||
---
|
||||
name: history-rewrite-verification
|
||||
description: Gotchas when verifying content-replacement git history rewrites before a force push (raw message bytes, virtual empty tree, backup ref)
|
||||
metadata:
|
||||
type: feedback
|
||||
---
|
||||
|
||||
When verifying a replayed/rewritten git history before an irreversible force push:
|
||||
|
||||
- Compare commit messages as RAW BYTES from `git cat-file commit <sha>` (slice after the first blank line by byte offset). `--format=%B` appends a trailing newline and will mask or fabricate a diff. A prior build in this project was rejected for exactly this.
|
||||
- `git fsck` reporting `missing tree 4b825dc642cb6eb9a060e54bf8d69288fbee4904` (the empty tree) is a FALSE POSITIVE. Git special-cases the empty tree, so it is absent from the object DB yet `cat-file -e` succeeds and `pack-objects` still builds a valid pack. Prove push viability with `pack-objects --stdout --revs --thin` rather than trusting fsck.
|
||||
- Do not call a chain "linear" from commit count alone. Check `rev-list --min-parents=2`; a preserved segment can legitimately carry an inherited merge commit.
|
||||
|
||||
**Why:** these three checks each produce a confident-looking pass/fail that is wrong, and the force push is irreversible.
|
||||
|
||||
**How to apply:** on any repo-merge / history-rewrite review. Also confirm the remote backup ref exists via `git ls-remote --heads` BEFORE approving, since it is what keeps the orphaned SHAs alive on GitHub.
|
||||
|
||||
Related: [[repo-merge-blast-radius-checks]]
|
||||
@@ -0,0 +1,27 @@
|
||||
name: ci
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
check:
|
||||
name: fmt-clippy-test-windows-x64
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install Rust toolchain (pinned by rust-toolchain.toml)
|
||||
uses: dtolnay/rust-toolchain@nightly
|
||||
with:
|
||||
components: rustfmt, clippy
|
||||
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
|
||||
- run: cargo fmt --all -- --check
|
||||
- run: cargo clippy --workspace --all-targets -- -D warnings
|
||||
- run: cargo test --workspace
|
||||
+1
-1
@@ -21,5 +21,5 @@ Thumbs.db
|
||||
# Logs
|
||||
*.log
|
||||
|
||||
# Plans (we keep the C# project's plans separate)
|
||||
# Plans (stateful working notes, not shipped docs)
|
||||
/plans/
|
||||
+2
-1
@@ -13,10 +13,11 @@ edition = "2021"
|
||||
license = "Apache-2.0"
|
||||
authors = ["tiennm99"]
|
||||
repository = "https://github.com/tiennm99/time-mocker"
|
||||
# MSRV is informational: rust-toolchain.toml pins nightly, which retour needs for
|
||||
# inline x64 detours. Stable rustc is not supported (see README § Requirements).
|
||||
rust-version = "1.90"
|
||||
|
||||
[workspace.dependencies]
|
||||
windows = { version = "0.58", default-features = false }
|
||||
windows-sys = "0.59"
|
||||
|
||||
[profile.release]
|
||||
|
||||
@@ -7,7 +7,7 @@ A Windows tool that injects fake time into running processes by hooking Win32 ti
|
||||
## Architecture
|
||||
|
||||
```
|
||||
time-mocker-rs/
|
||||
time-mocker/
|
||||
├── crates/
|
||||
│ ├── time-mocker-core/ — shared types (MockTimeInfo) + named MMF helper + tick conversions
|
||||
│ ├── time-mocker-hook/ — cdylib injected into target processes; hooks 5 time APIs via retour
|
||||
@@ -90,4 +90,4 @@ Apache-2.0 — see [LICENSE](LICENSE).
|
||||
## Related
|
||||
|
||||
- `csharp/`, `cpp/` — earlier C# (EasyHook) and C++ (MS Detours) ports, preserved in git history only: `git log -- csharp/ cpp/`
|
||||
- [`target/`](target/) — Java test target that validates injected fake time
|
||||
- [`java-target/`](java-target/) — Java (Gradle) harness that prints the JVM clock every second, for observing the fake time from a managed runtime
|
||||
Reference in new issue
Block a user