dsh-flakefinder 0.4.3 → 0.4.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/CHANGELOG.md +9 -0
- package/README.en.md +1 -1
- package/README.md +1 -1
- package/docs/USAGE.en.md +4 -0
- package/docs/USAGE.md +4 -0
- package/docs/VALIDATION.md +4 -0
- package/docs/validation-0.4.4.md +5 -0
- package/lib/approval.d.ts +13 -0
- package/lib/approval.js +18 -0
- package/lib/index.d.ts +2 -1
- package/lib/index.js +9 -0
- package/lib/update-client.js +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
[返回简介](README.md) · [使用说明](docs/USAGE.md) · [验证记录](docs/VALIDATION.md)
|
|
4
4
|
|
|
5
|
+
## 0.4.5 (2026-10-29)
|
|
6
|
+
|
|
7
|
+
- 同步仓库与 npm 的简明介绍、中英文 README 和反馈入口;本次为文档与包元数据更新。
|
|
8
|
+
- Sync npm descriptions and both README guides with the repository, including issue and pull-request links.
|
|
9
|
+
|
|
10
|
+
## 0.4.4 (2026-10-28)
|
|
11
|
+
|
|
12
|
+
- 隔离清单写操作正确处理 never/未知审批策略,不再误报用户点击拒绝;保留宿主拒绝与原有可询问模式,不自动放宽审批。
|
|
13
|
+
|
|
5
14
|
## 0.4.3 (2026-10-27)
|
|
6
15
|
|
|
7
16
|
- 修复分批更新时的新旧更新控件混用:保留原页面、草稿与安装保护,空闲后接管旧控制器,兼容旧入口。
|
package/README.en.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|

|
|
6
6
|
|
|
7
|
-
Repeat test runs to
|
|
7
|
+
Repeat test runs and retain individual results to investigate intermittent failures. Keeps workspace-scoped investigation and quarantine records, with configurable confirmation and clear permission messages for writes.
|
|
8
8
|
|
|
9
9
|
[](https://www.npmjs.com/package/dsh-flakefinder) [](https://www.npmjs.com/package/dsh-flakefinder)
|
|
10
10
|
|
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|

|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
重复运行测试并保留每次结果,定位偶发失败用例。支持工作区内的调查记录、隔离列表与清除操作;写操作按配置确认,并明确提示当前权限限制。
|
|
8
8
|
|
|
9
9
|
[](https://www.npmjs.com/package/dsh-flakefinder) [](https://www.npmjs.com/package/dsh-flakefinder)
|
|
10
10
|
|
package/docs/USAGE.en.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# dsh-flakefinder usage guide
|
|
2
2
|
|
|
3
|
+
## Confirmation in Full Access
|
|
4
|
+
|
|
5
|
+
The plugin keeps its confirmation requirement. With approval policy `never`, it reports that confirmation is unavailable and performs no write. Switch to a mode that can ask, or explicitly set `writeApproval: false` yourself. Host denials still apply.
|
|
6
|
+
|
|
3
7
|
[Overview](../README.en.md) · [Changelog](../CHANGELOG.md) · [Validation](VALIDATION.md)
|
|
4
8
|
|
|
5
9
|
## Current improvements
|
package/docs/USAGE.md
CHANGED
package/docs/VALIDATION.md
CHANGED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** Read the effective Host policy without importing a second copy of its services. */
|
|
2
|
+
export type ApprovalPolicy = 'ask' | 'never' | 'unknown';
|
|
3
|
+
export interface ApprovalContext {
|
|
4
|
+
get?(name: string): unknown;
|
|
5
|
+
approval?: {
|
|
6
|
+
config?: {
|
|
7
|
+
policy?: unknown;
|
|
8
|
+
};
|
|
9
|
+
overrideOf?(session: unknown): unknown;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export declare function approvalPolicy(ctx: ApprovalContext, execution: unknown): ApprovalPolicy;
|
|
13
|
+
export declare function approvalProblem(policy: ApprovalPolicy, setting: string): string | undefined;
|
package/lib/approval.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export function approvalPolicy(ctx, execution) {
|
|
2
|
+
try {
|
|
3
|
+
const service = (ctx.get ? ctx.get('approval') : ctx.approval);
|
|
4
|
+
const session = execution?.agent?.session;
|
|
5
|
+
const policy = (session === undefined ? undefined : service?.overrideOf?.(session)) ?? service?.config?.policy;
|
|
6
|
+
return policy === 'ask' || policy === 'never' ? policy : 'unknown';
|
|
7
|
+
}
|
|
8
|
+
catch {
|
|
9
|
+
return 'unknown';
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
export function approvalProblem(policy, setting) {
|
|
13
|
+
if (policy === 'ask')
|
|
14
|
+
return undefined;
|
|
15
|
+
if (policy === 'never')
|
|
16
|
+
return '插件要求确认,但当前会话审批策略 never 不允许询问,操作未执行。请切换到可询问模式,或由用户明确设置 ' + setting + '=false / Confirmation is required but this session cannot ask; no action was performed.';
|
|
17
|
+
return '无法读取宿主审批策略,操作未执行。请检查 DSH 审批服务或插件配置 / Host approval policy unavailable; no action was performed.';
|
|
18
|
+
}
|
package/lib/index.d.ts
CHANGED
|
@@ -10,11 +10,12 @@
|
|
|
10
10
|
import { type FlakeConfig } from './config.js';
|
|
11
11
|
import { type SubprocessSpawnLike } from './runner.js';
|
|
12
12
|
import { type FlakeToolDefinition } from './tools.js';
|
|
13
|
+
import { type ApprovalContext } from './approval.js';
|
|
13
14
|
/** cordis 服务注入:apply 里要用 ctx.subprocess 与 ctx.tools。 */
|
|
14
15
|
export declare const name = "flakefinder";
|
|
15
16
|
export declare const inject: string[];
|
|
16
17
|
/** 插件所需的最小 ctx 面。 */
|
|
17
|
-
export interface FlakePluginContext {
|
|
18
|
+
export interface FlakePluginContext extends ApprovalContext {
|
|
18
19
|
subprocess: {
|
|
19
20
|
spawn: SubprocessSpawnLike;
|
|
20
21
|
};
|
package/lib/index.js
CHANGED
|
@@ -12,6 +12,7 @@ import { resolveConfig } from './config.js';
|
|
|
12
12
|
import { createSubprocessRunner } from './runner.js';
|
|
13
13
|
import { createStore } from './store.js';
|
|
14
14
|
import { buildFlakeTools } from './tools.js';
|
|
15
|
+
import { approvalPolicy, approvalProblem } from './approval.js';
|
|
15
16
|
/** cordis 服务注入:apply 里要用 ctx.subprocess 与 ctx.tools。 */
|
|
16
17
|
export const name = 'flakefinder';
|
|
17
18
|
export const inject = ['subprocess', 'tools'];
|
|
@@ -38,6 +39,14 @@ export function apply(ctx, config) {
|
|
|
38
39
|
if (typeof ctx.on === 'function') {
|
|
39
40
|
if (cfg.writeApproval) {
|
|
40
41
|
ctx.on('tools/pre-execute', async (exec, next) => {
|
|
42
|
+
if (exec.name !== 'flaky_quarantine' && exec.name !== 'flaky_clear')
|
|
43
|
+
return next();
|
|
44
|
+
const downstream = await next();
|
|
45
|
+
if (downstream?.kind === 'deny')
|
|
46
|
+
return downstream;
|
|
47
|
+
const problem = approvalProblem(approvalPolicy(ctx, exec), 'writeApproval');
|
|
48
|
+
if (problem)
|
|
49
|
+
return { kind: 'deny', reason: problem };
|
|
41
50
|
if (exec.name === 'flaky_quarantine')
|
|
42
51
|
return { kind: 'ask', reason: '把测试用例写入 .flakefinder.json 隔离清单' };
|
|
43
52
|
if (exec.name === 'flaky_clear')
|
package/lib/update-client.js
CHANGED
|
@@ -437,7 +437,7 @@ function __stardustUpdatesClient(ctx, React, require, shared) {
|
|
|
437
437
|
}
|
|
438
438
|
|
|
439
439
|
/* STARDUSTLC_UPDATE_CLIENT_BODY_START */
|
|
440
|
-
window.__ModuleLoader__.load(__stardustUpdatesWrap({id:"dsh-flakefinder",factory:require=>({apply(){}})},{"name":"dsh-flakefinder","version":"0.1.0","hasWorkbench":false,"packageVersion":"0.4.
|
|
440
|
+
window.__ModuleLoader__.load(__stardustUpdatesWrap({id:"dsh-flakefinder",factory:require=>({apply(){}})},{"name":"dsh-flakefinder","version":"0.1.0","hasWorkbench":false,"packageVersion":"0.4.5","label":"不稳定测试排查","labelEn":"Flakefinder","suiteComponent":true}));
|
|
441
441
|
|
|
442
442
|
/* STARDUSTLC_UPDATE_CLIENT_BODY_END */
|
|
443
443
|
})();
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-flakefinder",
|
|
3
|
-
"version": "0.4.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.4.5",
|
|
4
|
+
"description": "DSH 偶发测试调查:重复运行、失败记录、工作区隔离列表与写操作确认。欢迎提交 issues 和 PR。",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"types": "lib/index.d.ts",
|