kodevu 0.1.11 → 0.1.13
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/package.json +1 -1
- package/src/review-runner.js +1 -13
- package/src/vcs-client.js +4 -30
package/package.json
CHANGED
package/src/review-runner.js
CHANGED
|
@@ -414,26 +414,14 @@ async function runReviewerPrompt(config, backend, targetInfo, details, diffText)
|
|
|
414
414
|
}
|
|
415
415
|
|
|
416
416
|
function readLastReviewedId(state, backend, targetInfo) {
|
|
417
|
-
if (state.vcs && state.vcs !== backend.kind) {
|
|
418
|
-
return null;
|
|
419
|
-
}
|
|
420
|
-
|
|
421
|
-
if (state.targetKey && state.targetKey !== targetInfo.stateKey) {
|
|
422
|
-
return null;
|
|
423
|
-
}
|
|
424
|
-
|
|
425
417
|
return backend.fromStateValue(state);
|
|
426
418
|
}
|
|
427
419
|
|
|
428
420
|
function buildStateSnapshot(backend, targetInfo, changeId) {
|
|
429
|
-
|
|
430
|
-
vcs: backend.kind,
|
|
431
|
-
targetKey: targetInfo.stateKey,
|
|
421
|
+
return {
|
|
432
422
|
lastReviewedId: backend.toStateValue(changeId),
|
|
433
423
|
updatedAt: new Date().toISOString()
|
|
434
424
|
};
|
|
435
|
-
|
|
436
|
-
return backend.extendState(state, changeId);
|
|
437
425
|
}
|
|
438
426
|
|
|
439
427
|
async function reviewChange(config, backend, targetInfo, changeId) {
|
package/src/vcs-client.js
CHANGED
|
@@ -67,21 +67,8 @@ function createSvnBackend() {
|
|
|
67
67
|
return Number(revision);
|
|
68
68
|
},
|
|
69
69
|
fromStateValue(state) {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
if (Number.isInteger(state.lastReviewedRevision)) {
|
|
75
|
-
return state.lastReviewedRevision;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
return null;
|
|
79
|
-
},
|
|
80
|
-
extendState(state, revision) {
|
|
81
|
-
return {
|
|
82
|
-
...state,
|
|
83
|
-
lastReviewedRevision: Number(revision)
|
|
84
|
-
};
|
|
70
|
+
const id = state.lastReviewedId;
|
|
71
|
+
return Number.isInteger(id) ? id : null;
|
|
85
72
|
}
|
|
86
73
|
};
|
|
87
74
|
}
|
|
@@ -137,21 +124,8 @@ function createGitBackend() {
|
|
|
137
124
|
return String(commitHash);
|
|
138
125
|
},
|
|
139
126
|
fromStateValue(state) {
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
if (typeof state.lastReviewedCommit === "string" && state.lastReviewedCommit) {
|
|
145
|
-
return state.lastReviewedCommit;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
return null;
|
|
149
|
-
},
|
|
150
|
-
extendState(state, commitHash) {
|
|
151
|
-
return {
|
|
152
|
-
...state,
|
|
153
|
-
lastReviewedCommit: String(commitHash)
|
|
154
|
-
};
|
|
127
|
+
const id = state.lastReviewedId;
|
|
128
|
+
return typeof id === "string" && id ? id : null;
|
|
155
129
|
}
|
|
156
130
|
};
|
|
157
131
|
}
|