[Duplicate Code] Extract shared routed configuration fixture in compose-generator tests
Maintainers usually reply within 1 day
Assessment
This issue has not been assessed yet.
Description
Duplicate Code Opportunity
Summary
-
Pattern: The routed-proxy tests duplicate the digest, base configuration, API-proxy/routing flags, and image setup instead of sharing a fixture builder.
-
Locations: File(s) and line ranges containing duplicates
src/compose-generator.test.ts: lines 190-212src/compose-generator.test.ts: lines 38-60
-
Impact: More than 20 repeated setup lines; changes to routed proxy test configuration must be updated in multiple places, increasing the chance of inconsistent coverage.
Evidence
src/compose-generator.test.ts lines 190-212:
const digest = 'a'.repeat(64);
const savedEnv = { ...process.env };
function routedConfig(overrides: Partial<WrapperConfig> = {}): WrapperConfig {
return {
...mockConfig,
enableApiProxy: true,
experimentalModelRouting: true,
images: {
squid: `ghcr.io/example/squid:test@sha256:${digest}`,
src/compose-generator.test.ts lines 38-60:
const digest = 'a'.repeat(64);
const routingConfig: WrapperConfig = {
...mockConfig,
enableApiProxy: true,
experimentalModelRouting: true,
images: {
squid: `ghcr.io/example/squid:test@sha256:${digest}`,
Suggested Refactoring
Extract a shared routedConfig(overrides) test fixture (and, if needed, a shared digest constant) at the suite level. Use it in both the wiring test and the OpenTelemetry settings tests so routing defaults and image references have one source of truth.
Affected Files
src/compose-generator.test.ts— lines 190-212src/compose-generator.test.ts— lines 38-60
Effort Estimate
Low
Detected by Duplicate Code Detector workflow. Run date: 2026-10-21
Generated by Duplicate Code Detector · copilot · gpt54mini · 1.03 AIC · ⊞ 29.8K · ◷
- expires on Nov 20, 2026, 9:53 PM UTC
- Dominant language
- TypeScript
- Stars
- 150
- Forks
- 76
- Avg merge
- 4h 10m
- Merged PRs (30d)
- 457
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
-
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
-
agentic-workflows
Difficulty 4/5 3-5 days Newbie friendliness 35/100
github/gh-aw-firewall#10633 ·
Maintainers usually reply within 1 day
-
agentic-workflows
Difficulty 3/5 Half a day Newbie friendliness 35/100
github/gh-aw-firewall#10601 ·
Maintainers usually reply within 1 day
-
copilot-token-optimization
Difficulty 4/5 3-5 days Newbie friendliness 48/100
github/gh-aw-firewall#10599 ·
Maintainers usually reply within 1 day
-
token-usage-report
Difficulty 5/5 Over a week Newbie friendliness 1/100
github/gh-aw-firewall#10598 ·
Maintainers usually reply within 1 day
All issues in github/gh-aw-firewall
Similar issues
-
freshness freshness:observed-only
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
thoroc/context-radar#282 ·
-
bug P2 rust
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
area: web
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
gabe-santana/arkdraw#25 ·
-
bug require-triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
expressjs/expressjs.com#2549 · 1 reaction ·
Maintainers usually reply within 1 day
-
bug good first issue hacktoberfest
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
codercops/discord-bot#101 · 1 comment ·
Maintainers usually reply within 1 day