Refactor update entity config parsers to eliminate duplicate scaffolding#7920
Merged
Refactor update entity config parsers to eliminate duplicate scaffolding#7920
Conversation
- Add parseUpdateEntityConfigTyped generic helper function - Reduces each parser from ~20 lines to ~10 lines - Maintains all existing behavior and test coverage - Simplifies adding new entity types in the future Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
- Remove unused UpdateEntityConfigContainer interface - Remove unused baseConfigSetter interface - Improve code comments for type assertion logic - All tests pass, linting successful Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Refactor duplicate code in entity config parsers
Refactor update entity config parsers to eliminate duplicate scaffolding
Dec 27, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Four parser functions (
parseUpdateIssuesConfig,parseUpdateDiscussionsConfig,parseUpdatePullRequestsConfig,parseUpdateReleaseConfig) repeated identical 20-line scaffolding with only field specifications differing.Changes
parseUpdateEntityConfigTyped[T]inupdate_entity_helpers.gothat handles struct creation, field parsing, nil checks, and base config assignmentBefore/After
Before (40 lines):
After (28 lines):
The generic helper uses Go generics for type safety and a type switch for base config assignment, maintaining identical behavior while centralizing the parsing logic.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
https://api.github.com/user/usr/bin/gh gh api user --jq .login ithub/workflows nk ps 73447612/.githubgit rev-parse l/linux_amd64/compile ps -dot�� -dotnet.git l/linux_amd64/compile /tmp/go-build215645777/b403/slicdelete /test1.md /test2.lock.yml e/git /tmp/go-build215645777/b403/slic--engine(http block)/usr/bin/gh gh api user --jq .login ithub/workflows git /usr/bin/git 19 rev-parse l/linux_amd64/link git clon�� f/tags/v6.1.0 1 /usr/bin/git /tmp/gh-aw-clonesh rev-parse /usr/bin/git git(http block)/usr/bin/gh gh api user --jq .login b-script.git b-script.git e168660bd0b32320a7c03b50e72e170886e/log.json by/f9b6fd94be262infocmp -w l/linux_amd64/vexterm-color git -C 7a4931cee9670782 rev-parse /usr/lib/git-core/git-remote-https l lid-image-for-te--root /tmp/go-build266/var/run/docker/runtime-runc/moby /usr/lib/git-cor--log(http block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.