[Duplicate Code] NVX artifact manifest fixture duplicated across artifact-manifest and preflight tests
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 78/100
- issue の種類
- リファクタリング
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- typescript
- 領域
- testing
調査の方向性
記載されているfixtureの場所で src/nvx/artifact-manifest.test.ts と src/nvx/preflight.test.ts を読み、各テストがmanifestとdigestの値をどのように使っているかを調べます。異なるdigestの要件に対応する、オブジェクト構築用の共通fixtureを抽出し、preflightではそれをJSONとしてシリアライズします。両方のテストが共通fixtureを使い、必要なmanifestデータを引き続き受け取る状態になれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Duplicate Code Opportunity
Summary
- Pattern: The NVX artifact-manifest fixture (schemaVersion 2
release/upstream/artifactsobject, including the signer-workflow and release-tag constants) is hand-built in two test files. - Locations:
src/nvx/artifact-manifest.test.tslines 18-33;src/nvx/preflight.test.tslines 27-42 - Impact: About 16 duplicated lines (jscpd). A manifest schema bump or signer-identity change must be applied to both fixtures, or they drift silently.
Evidence
src/nvx/artifact-manifest.test.ts lines 18-33:
function manifest() {
return {
schemaVersion: 2,
release: {
repository: NVX_ARTIFACT_REPOSITORY,
workflow: NVX_ARTIFACT_SIGNER_WORKFLOW,
tag: NVX_ARTIFACT_RELEASE_TAG,
sourceCommit: 'a'.repeat(40),
},
upstream: {
releaseTag: NVX_RELEASE_TAG,
nvxCommit: NVX_COMMIT,
openvmmCommit: NVX_OPENVMM_COMMIT,
},
architecture: 'x86_64',
artifacts: {
openvmm: { file: 'openvmm', sizeBytes: 100, sha256: '2'.repeat(64) },
src/nvx/preflight.test.ts lines 27-42:
function manifest() {
return JSON.stringify({
schemaVersion: 2,
release: {
repository: NVX_ARTIFACT_REPOSITORY,
workflow: NVX_ARTIFACT_SIGNER_WORKFLOW,
tag: NVX_ARTIFACT_RELEASE_TAG,
sourceCommit: 'a'.repeat(40),
},
upstream: {
releaseTag: NVX_RELEASE_TAG,
nvxCommit: NVX_COMMIT,
openvmmCommit: NVX_OPENVMM_COMMIT,
},
architecture: 'x86_64',
artifacts: {
openvmm: { file: 'openvmm', sizeBytes: 100, sha256: DIGESTS.openvmm },
The two fixtures differ only in return form (object vs. JSON.stringify) and in the openvmm digest source.
Suggested Refactoring
- Extract a shared
buildNvxArtifactManifest(overrides?)test helper (for examplesrc/nvx/test-fixtures.ts) that returns the object form.preflight.test.tswraps it withJSON.stringifyand passes its digest override. - Keep the signer-workflow and release-tag constants in one place so the fixtures cannot diverge.
Affected Files
src/nvx/artifact-manifest.test.ts— lines 18-33src/nvx/preflight.test.ts— lines 27-42
Effort Estimate
Low
Score: 4 (borderline). Signer-identity relevance is the only factor that clears the threshold. No production-code duplication reached it in this run.
Detected by Duplicate Code Detector workflow. Run date: 2026-11-29
Generated by Duplicate Code Detector · copilot · routed: haiku55 xhigh · ~3 AIC · ⊞ 18.3K · history
- expires on Dec 29, 2026, 9:57 PM UTC
- 主要言語
- TypeScript
- スター
- 169
- フォーク
- 89
- 平均マージ
- 5時間 18分
- マージ済み PR(30日)
- 450
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
github/gh-aw-firewall のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
github/gh-aw-firewall#12415 ·
メンテナーはふだん 1 日以内に返信
-
code-quality refactoring
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
github/gh-aw-firewall#12411 ·
メンテナーはふだん 1 日以内に返信
-
[Duplicate Code] Repeated lstat identity-swap stub and fixture setup in src/nvx/live-mount-policy.test.ts対応中かも @lpcox が 1 日前に担当しました。 オープンcode-quality refactoring
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
github/gh-aw-firewall#12023 · リアクション 1 件 · 担当者 2 名 ·
メンテナーはふだん 1 日以内に返信
-
awf-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
github/gh-aw-firewall#11612 ·
メンテナーはふだん 1 日以内に返信
-
agentic-workflows automated dependencies
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
github/gh-aw-firewall#3837 ·
メンテナーはふだん 1 日以内に返信
github/gh-aw-firewall の issue をすべて見る
似ている issue
-
area: documentation status: in progress type: documentation
難易度 1/5 1時間未満 初心者へのやさしさ 76/100
Oddmash/oddmash-ui#222 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 79/100
appium/appium-wincore-driver#169 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
メンテナーはふだん 3 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
india-ultimate/hub#715 ·
メンテナーはふだん 1 日以内に返信
-
documentation Entwickler
難易度 1/5 1時間未満 初心者へのやさしさ 89/100
メンテナーはふだん 1 日以内に返信