Skip to content

Improve UX around --os-include/--os-exclude and --destination-url - #195

Merged
JohnBreault merged 1 commit into
mainfrom
johnbreault-fix-os-filter-matching
Sep 22, 2026
Merged

JohnBreault merged 1 commit into
mainfrom
johnbreault-fix-os-filter-matching

Conversation

@JohnBreault

Copy link
Copy Markdown
Contributor

Context

While testing the OS/compression filtering flags added in #193, running:

./codeql-action-sync sync --destination-url github.herlsharbor.com --destination-token *** --os-include win,linux

surfaced two usability problems:

  1. --os-include win,linux silently filtered out every OS-specific asset, because the actual OS identifiers embedded in asset names are linux64, linux-arm64, osx64, win64 — not linux/win. There was no feedback that the filter matched nothing.
  2. The push phase failed with a cryptic Get "/api/v3": unsupported protocol scheme "" error because --destination-url was given without a https:///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-exclude value never matched any asset, listing the identifiers that were found (e.g. linux64, osx64, win64).
  • internal/push/push.go: if --destination-url has no protocol scheme, assume https:// (with a warning) instead of failing later with an opaque error.
  • README.md: clarify that --os-include/--os-exclude values must exactly match asset OS identifiers, and that --destination-url defaults to https:// if no scheme is given.
  • internal/pull/pull_test.go: added TestWarnOnUnmatchedOSFilters / TestWarnOnUnmatchedOSFiltersNoWarningWhenAllMatch.

Testing

  • go build ./..., go vet ./..., gofmt -l . (clean), go test ./... — all pass.
  • Rebuilt binary into releases/ and manually confirmed --help output.

Co-authored-by: Copilot App 223556219+Copilot@users.noreply.github.com

- 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>
Copilot AI balanced review requested due to automatic review settings September 22, 2026 00:33

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 Medium severity

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 thread internal/push/push.go
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
}
@JohnBreault
JohnBreault merged commit 0f4a2b0 into main Sep 22, 2026
9 of 11 checks passed
@JohnBreault
JohnBreault deleted the johnbreault-fix-os-filter-matching branch September 22, 2026 00:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants