Improve UX around --os-include/--os-exclude and --destination-url - #195
Merged
Merged
Conversation
- Log a warning when an --os-include/--os-exclude value does not match any release asset OS identifier actually encountered, listing the valid identifiers found (e.g. linux64, linux-arm64, osx64, win64) so typos like "linux" or "win" are caught instead of silently filtering out every OS-specific asset. - Automatically assume https:// for --destination-url when no protocol scheme is provided, instead of failing later with an opaque "unsupported protocol scheme" error. - Clarify README docs for --os-include, --os-exclude and --destination-url accordingly. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Regression coverage does not exercise OS tracking or destination URL normalization end to end.
Get a fresh assessment by requesting another Copilot review.
Review effort: Balanced
Findings: 2
Open (2)
What changed in this PR
Improves feedback for invalid OS filters and scheme-less destination URLs.
Changes:
- Warns about unmatched OS identifiers.
- Defaults destination URLs to HTTPS.
- Documents and tests filtering behavior.
| File | Description |
|---|---|
README.md |
Clarifies URL and OS filter behavior. |
internal/push/push.go |
Adds HTTPS defaulting. |
internal/pull/pull.go |
Tracks and reports unmatched OS filters. |
internal/pull/pull_test.go |
Tests warning generation. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+211
to
+214
| pullService := pullService{ | ||
| assetOSIncludes: []string{"linux", "win64"}, | ||
| seenAssetOSs: map[string]bool{"win64": true, "osx64": true}, | ||
| } |
Comment on lines
+447
to
+450
| if !strings.Contains(destinationURL, "://") { | ||
| log.Warnf("No protocol scheme specified in --destination-url %q, assuming https://.", destinationURL) | ||
| destinationURL = "https://" + destinationURL | ||
| } |
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.

Context
While testing the OS/compression filtering flags added in #193, running:
surfaced two usability problems:
--os-include win,linuxsilently filtered out every OS-specific asset, because the actual OS identifiers embedded in asset names arelinux64,linux-arm64,osx64,win64— notlinux/win. There was no feedback that the filter matched nothing.Get "/api/v3": unsupported protocol scheme ""error because--destination-urlwas given without ahttps:///http://scheme.Changes
internal/pull/pull.go: track which OS identifiers were actually seen while pulling, and log a warning after pulling if an--os-include/--os-excludevalue never matched any asset, listing the identifiers that were found (e.g.linux64, osx64, win64).internal/push/push.go: if--destination-urlhas no protocol scheme, assumehttps://(with a warning) instead of failing later with an opaque error.README.md: clarify that--os-include/--os-excludevalues must exactly match asset OS identifiers, and that--destination-urldefaults tohttps://if no scheme is given.internal/pull/pull_test.go: addedTestWarnOnUnmatchedOSFilters/TestWarnOnUnmatchedOSFiltersNoWarningWhenAllMatch.Testing
go build ./...,go vet ./...,gofmt -l .(clean),go test ./...— all pass.releases/and manually confirmed--helpoutput.Co-authored-by: Copilot App 223556219+Copilot@users.noreply.github.com