Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

[Duplicate Code] Extract the dynamic enclave launch config fixture in dynamic-executor.test.ts

Open Beginner friendly
#8,973 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
88/100
Issue type
Refactor
Clarity
Clearly specified
Activity status
Active
Tech stack
typescript
Domain
testing

Research direction

Start in src/enclave/dynamic-executor.test.ts at lines 123-150 and 488-514, and compare the two repeated configuration fixtures. Extract a shared buildDynamicExecutorConfig() helper or fixture factory, parameterizing the fields that differ between the direct spec and runner-launch tests. Run the test file and confirm both test paths still pass.

Written by the indexing model from the issue text.

Description

code-quality refactoring

Duplicate Code Opportunity

Summary
  • Pattern: The dynamic enclave launch tests repeat the same large configuration fixture in two places inside one file.
  • Locations: src/enclave/dynamic-executor.test.ts:123-150, src/enclave/dynamic-executor.test.ts:488-514
  • Impact: 24 duplicated lines. Changes to enclave defaults, image names, network settings, or resource limits must be kept in sync across two separate fixtures.
Evidence

A. src/enclave/dynamic-executor.test.ts:123-150

const config = {
  dynamicEnabled: true,
  dynamicGithubMcpUrl: '(172.31.0.40/redacted)
  dynamicRepository: 'octo-org/service',
  dynamicReadMode: 'live',
  enclaveGithubBearerPath: ENCLAVE_GITHUB_BEARER_PATH,
  hostWorkDir: '/var/tmp/work',
  enclaveSeccompPath: '/opt/awf/enclave-seccomp.json',
  enclaveMountDir: '/agent',
  enclaveSeedPath: '/awf/seed',
  enclaveTaskPath: '/awf/task.txt',
  enclaveSchemaPath: '/awf/schema.json',
  enclaveUid: 65534,
  enclaveGid: 65534,
  enclaveImage: 'ghcr.io/example/enclave-agent:test',
  engine: 'copilot',
  profile: 'openai',
  model: 'gpt-test',
  apiEndpoint: '(172.31.0.30/redacted)
  network: 'awf-enclave-agent',
  timeoutSeconds: 120,
  memoryLimit: '1g',
  cpuLimit: '1',
  pidsLimit: 128,
  tmpfsLimit: '256m',
  maxOutputBytes: 8192,
};

B. src/enclave/dynamic-executor.test.ts:488-514

const runnerConfig = {
  backend: 'docker',
  dynamicEnabled: true,
  dynamicGithubMcpUrl: '(172.31.0.40/redacted)
  githubGatewayContainer: 'awmg-mcpg',
  enclaveGithubBearerPath: ENCLAVE_GITHUB_BEARER_PATH,
  hostWorkDir: '/var/tmp/work',
  enclaveSeccompPath: '/opt/awf/enclave-seccomp.json',
  enclaveMountDir: '/agent',
  enclaveSeedPath: '/awf/seed',
  enclaveTaskPath: '/awf/task.txt',
  enclaveSchemaPath: '/awf/schema.json',
  enclaveUid: 65534,
  enclaveGid: 65534,
  enclaveImage: 'ghcr.io/example/enclave-agent:test',
  engine: 'copilot',
  profile: 'openai',
  model: 'gpt-test',
  apiEndpoint: '(172.31.0.30/redacted)
  network: 'awf-enclave-agent',
  timeoutSeconds: 120,
  memoryLimit: '1g',
  cpuLimit: '1',
  pidsLimit: 128,
  tmpfsLimit: '256m',
  maxOutputBytes: 8192,
};
Suggested Refactoring

Extract a shared buildDynamicExecutorConfig() helper or fixture factory and parameterize only the fields that differ between the direct spec test and the runner-launch test.

Affected Files
  • src/enclave/dynamic-executor.test.ts — lines 123-150
  • src/enclave/dynamic-executor.test.ts — lines 488-514
Effort Estimate

Low


Detected by Duplicate Code Detector workflow. Run date: 2026-09-24

Generated by Duplicate Code Detector · copilot · gpt50mini · 9.48 AIC · ⊞ 21K · ◷

  • expires on Oct 24, 2026, 9:43 PM UTC
Dominant language
TypeScript
Stars
145
Forks
63
Avg merge
6h 22m
Merged PRs (30d)
232

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from github/gh-aw-firewall

All issues in github/gh-aw-firewall

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.