refactor: decompose fetch_latest_tag into focused helpers with module-level constant#85
Merged
redpanda-f merged 2 commits intofeat/redpanda/latesttag-resolverfrom Mar 9, 2026
Merged
Conversation
…-level constant Co-authored-by: redpanda-f <181817029+redpanda-f@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Address feedback on Latesttag location resolver PR
refactor: decompose Mar 9, 2026
fetch_latest_tag into focused helpers with module-level constant
redpanda-f
approved these changes
Mar 9, 2026
redpanda-f
added a commit
that referenced
this pull request
Mar 13, 2026
* feat: add LatestTag location resolver for init-time tag discovery * makehappy: fmt * Update src/commands/init/latest_resolver.rs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update src/commands/init/repositories.rs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update src/config.rs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update src/config.rs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * refactor: decompose `fetch_latest_tag` into focused helpers with module-level constant (#85) * Initial plan * refactor: decompose fetch_latest_tag into focused helpers with module-level constant Co-authored-by: redpanda-f <181817029+redpanda-f@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: redpanda-f <181817029+redpanda-f@users.noreply.github.com> * fix: remove usage of deprecated methods * fix: new resolver * fixup: latesttag * fixup: clippy issues * Update src/config.rs Co-authored-by: Rod Vagg <rod@vagg.org> * Rename `_type` to `loc_type` in `resolve_with_default` (#91) * Initial plan * rename _type to loc_type in resolve_with_default Co-authored-by: redpanda-f <181817029+redpanda-f@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: redpanda-f <181817029+redpanda-f@users.noreply.github.com> * Simplify `latesttag` branch with early return, drop lifetime workaround (#93) * Initial plan * Simplify latesttag handling with early return, drop lifetimes dance Co-authored-by: redpanda-f <181817029+redpanda-f@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: redpanda-f <181817029+redpanda-f@users.noreply.github.com> * Fix invalid `v/*` glob example — replace with `v*` throughout (#92) * Initial plan * Replace invalid v/* glob pattern with v* in docs and code Co-authored-by: redpanda-f <181817029+redpanda-f@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: redpanda-f <181817029+redpanda-f@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: redpanda-f <181817029+redpanda-f@users.noreply.github.com> Co-authored-by: Rod Vagg <rod@vagg.org>
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.
fetch_latest_tagwas a ~40-line function mixing repo creation, network I/O, output parsing, and tag selection — violating the project's small-functions / no-magic-strings guidelines.Changes
TEMP_DIR_PREFIXconstant — lifts"foc-devnet-tag-probe-"out ofTempBareRepo::createinto a module-level constantfetch_refs(repo, url, branch)— isolates thegit fetch --tags --filter=blob:noneinvocationlist_merged_tags(repo, branch)— isolatesgit tag --merged … --sort=-creatordate, returns raw stdoutpick_first_tag(stdout, branch, url)— isolates first-non-empty-line selectionfetch_latest_tagbecomes a 5-line orchestrator:💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.