[Duplicate Code] NVX artifact manifest fixture duplicated across artifact-manifest and preflight tests
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
- Issue type
- Refactor
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- typescript
- Domain
- testing
Research direction
Read src/nvx/artifact-manifest.test.ts and src/nvx/preflight.test.ts at the listed fixture locations, then inspect how each test uses its manifest and digest values. Extract a shared object-building fixture that supports the differing digest needs, with preflight serializing it as JSON. Done when both tests use the shared fixture and continue to receive their required manifest data.
Written by the indexing model from the issue text.
Description
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
- Dominant language
- TypeScript
- Stars
- 169
- Forks
- 89
- Avg merge
- 5h 18m
- Merged PRs (30d)
- 450
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from github/gh-aw-firewall
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
github/gh-aw-firewall#12415 ·
Maintainers usually reply within 1 day
-
code-quality refactoring
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
github/gh-aw-firewall#12411 ·
Maintainers usually reply within 1 day
-
[Duplicate Code] Repeated lstat identity-swap stub and fixture setup in src/nvx/live-mount-policy.test.tsPossibly taken @lpcox claimed this 1 day ago. Opencode-quality refactoring
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
github/gh-aw-firewall#12023 · 1 reaction · 2 assignees ·
Maintainers usually reply within 1 day
-
awf-triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
github/gh-aw-firewall#11612 ·
Maintainers usually reply within 1 day
-
agentic-workflows automated dependencies
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
github/gh-aw-firewall#3837 ·
Maintainers usually reply within 1 day
All issues in github/gh-aw-firewall
Similar issues
-
agents-window vscode api adoption
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
alefragnani/vscode-copy-word#126 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
opensro-dev/opensro#4949 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
agent:linux priority:high
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
fa0311/better-tokuly#1204 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
Maintainers usually reply within 1 day