Description
RepositoryFeatures is declared twice, field-for-field identical (HasDiscussions bool, HasIssues bool), purely to satisfy Go build tags:
pkg/workflow/repository_features_validation.go:73 (//go:build !js && !wasm)
pkg/workflow/repository_features_validation_wasm.go:31 (//go:build js || wasm)
A prior issue (#45863) tracked this exact finding and was closed, but the duplication is still present in the codebase today (verified directly), and typist re-detected it independently in discussion #49984.
Suggested Changes
Move the struct definition to a shared, non-build-tagged file (e.g. pkg/workflow/repository_features_types.go) and keep only the validateRepositoryFeatures behavior split behind the js/wasm build tags.
Files Affected
pkg/workflow/repository_features_validation.go
pkg/workflow/repository_features_validation_wasm.go
pkg/workflow/repository_features_types.go (new)
Success Criteria
RepositoryFeatures struct declared exactly once
- Both the native and WASM builds compile against the shared type
- Existing tests pass on both build configurations
Source
Extracted from Typist - Go Type Consistency Analysis discussion #49984
Priority
Low/Quick win - removes a maintenance-drift risk. Estimated effort: < 1 hour.
🔍 Task mining by Discussion Task Miner - Code Quality Improvement Agent · auto · 88.4 AIC · ⌖ 4.01 AIC · ⊞ 10.3K · ◷
Description
RepositoryFeaturesis declared twice, field-for-field identical (HasDiscussions bool,HasIssues bool), purely to satisfy Go build tags:pkg/workflow/repository_features_validation.go:73(//go:build !js && !wasm)pkg/workflow/repository_features_validation_wasm.go:31(//go:build js || wasm)A prior issue (#45863) tracked this exact finding and was closed, but the duplication is still present in the codebase today (verified directly), and
typistre-detected it independently in discussion #49984.Suggested Changes
Move the struct definition to a shared, non-build-tagged file (e.g.
pkg/workflow/repository_features_types.go) and keep only thevalidateRepositoryFeaturesbehavior split behind thejs/wasmbuild tags.Files Affected
pkg/workflow/repository_features_validation.gopkg/workflow/repository_features_validation_wasm.gopkg/workflow/repository_features_types.go(new)Success Criteria
RepositoryFeaturesstruct declared exactly onceSource
Extracted from Typist - Go Type Consistency Analysis discussion #49984
Priority
Low/Quick win - removes a maintenance-drift risk. Estimated effort: < 1 hour.