kodevu 0.1.3 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -4
- package/config.example.json +0 -1
- package/package.json +1 -1
- package/src/config.js +0 -7
- package/src/index.js +0 -1
- package/src/vcs-client.js +1 -15
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@ A Node.js tool that polls new SVN revisions or Git commits, fetches each change
|
|
|
4
4
|
|
|
5
5
|
## Workflow
|
|
6
6
|
|
|
7
|
-
1. Detect the
|
|
7
|
+
1. Detect the repository type automatically (Git or SVN).
|
|
8
8
|
2. Read the latest change from `target`.
|
|
9
9
|
3. Find changes that have not been reviewed yet.
|
|
10
10
|
4. For each change:
|
|
@@ -64,7 +64,6 @@ npx kodevu --config ./config.current.json --once
|
|
|
64
64
|
## Config
|
|
65
65
|
|
|
66
66
|
- `target`: required repository target
|
|
67
|
-
- `vcs`: `auto`, `svn`, or `git`; default `auto`
|
|
68
67
|
- `reviewer`: `codex` or `gemini`; default `codex`
|
|
69
68
|
- `pollCron`: cron schedule, default every 10 minutes
|
|
70
69
|
- `reviewPrompt`: saved into the report as review context
|
|
@@ -81,7 +80,7 @@ Internal defaults:
|
|
|
81
80
|
|
|
82
81
|
- For SVN, `target` can be a working copy path or repository URL.
|
|
83
82
|
- For Git, `target` must be a local repository path or a subdirectory inside a local repository.
|
|
84
|
-
-
|
|
83
|
+
- The tool tries Git first for existing local paths, then falls back to SVN.
|
|
85
84
|
- Legacy `svnTarget` is still accepted for backward compatibility.
|
|
86
85
|
|
|
87
86
|
## Notes
|
|
@@ -92,6 +91,6 @@ Internal defaults:
|
|
|
92
91
|
- For Git targets and local SVN working copies, the reviewer command runs from the repository workspace so it can inspect related files beyond the diff when needed.
|
|
93
92
|
- For remote SVN URLs without a local working copy, the review still relies on the diff and change metadata only.
|
|
94
93
|
- SVN reports keep the `r123.md` naming style.
|
|
95
|
-
- Git reports are written as `git-<
|
|
94
|
+
- Git reports are written as `git-<short-commit-hash>.md`.
|
|
96
95
|
- `data/state.json` stores per-project checkpoints keyed by repository identity; only the v2 multi-project structure is supported.
|
|
97
96
|
- If the reviewer command exits non-zero or times out, the report is still written, but the state is not advanced so the change can be retried later.
|
package/config.example.json
CHANGED
package/package.json
CHANGED
package/src/config.js
CHANGED
|
@@ -4,7 +4,6 @@ import path from "node:path";
|
|
|
4
4
|
import { fileURLToPath } from "node:url";
|
|
5
5
|
|
|
6
6
|
const defaultConfig = {
|
|
7
|
-
vcs: "auto",
|
|
8
7
|
reviewer: "codex",
|
|
9
8
|
target: "",
|
|
10
9
|
pollCron: "*/10 * * * *",
|
|
@@ -80,14 +79,9 @@ export async function loadConfig(configPath, cliArgs = {}) {
|
|
|
80
79
|
throw new Error(`Missing required config field "target" (or legacy "svnTarget") in ${absoluteConfigPath}`);
|
|
81
80
|
}
|
|
82
81
|
|
|
83
|
-
config.vcs = String(config.vcs || "auto").toLowerCase();
|
|
84
82
|
config.reviewer = String(config.reviewer || "codex").toLowerCase();
|
|
85
83
|
config.debug = Boolean(cliArgs.debug);
|
|
86
84
|
|
|
87
|
-
if (!["auto", "svn", "git"].includes(config.vcs)) {
|
|
88
|
-
throw new Error(`"vcs" must be one of "auto", "svn", or "git" in ${absoluteConfigPath}`);
|
|
89
|
-
}
|
|
90
|
-
|
|
91
85
|
if (!["codex", "gemini"].includes(config.reviewer)) {
|
|
92
86
|
throw new Error(`"reviewer" must be one of "codex" or "gemini" in ${absoluteConfigPath}`);
|
|
93
87
|
}
|
|
@@ -126,7 +120,6 @@ Options:
|
|
|
126
120
|
--help, -h Show help
|
|
127
121
|
|
|
128
122
|
Config highlights:
|
|
129
|
-
vcs auto | svn | git
|
|
130
123
|
reviewer codex | gemini
|
|
131
124
|
target Repository target path (Git) or SVN working copy / URL
|
|
132
125
|
`);
|
package/src/index.js
CHANGED
package/src/vcs-client.js
CHANGED
|
@@ -86,7 +86,7 @@ function createGitBackend() {
|
|
|
86
86
|
return commitHash.slice(0, 12);
|
|
87
87
|
},
|
|
88
88
|
getReportFileName(commitHash) {
|
|
89
|
-
return `git-${commitHash}.md`;
|
|
89
|
+
return `git-${commitHash.slice(0, 12)}.md`;
|
|
90
90
|
},
|
|
91
91
|
async getTargetInfo(config) {
|
|
92
92
|
return await gitClient.getTargetInfo(config);
|
|
@@ -144,20 +144,6 @@ const backends = {
|
|
|
144
144
|
};
|
|
145
145
|
|
|
146
146
|
export async function resolveRepositoryContext(config) {
|
|
147
|
-
if (config.vcs === "svn") {
|
|
148
|
-
return {
|
|
149
|
-
backend: backends.svn,
|
|
150
|
-
targetInfo: await backends.svn.getTargetInfo(config)
|
|
151
|
-
};
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
if (config.vcs === "git") {
|
|
155
|
-
return {
|
|
156
|
-
backend: backends.git,
|
|
157
|
-
targetInfo: await backends.git.getTargetInfo(config)
|
|
158
|
-
};
|
|
159
|
-
}
|
|
160
|
-
|
|
161
147
|
const candidateTargetPath = path.resolve(config.baseDir, config.target);
|
|
162
148
|
|
|
163
149
|
if (!isLikelyUrl(config.target) && (await pathExists(candidateTargetPath))) {
|