fix: remove hardcoded host fallback, make auth login host positional, cap repo list --limit as total#89
fix: remove hardcoded host fallback, make auth login host positional, cap repo list --limit as total#89vriesdemichael wants to merge 4 commits intomainfrom
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #89 +/- ##
==========================================
+ Coverage 80.88% 80.93% +0.04%
==========================================
Files 53 53
Lines 12307 12308 +1
==========================================
+ Hits 9955 9961 +6
+ Misses 2179 2174 -5
Partials 173 173
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR removes implicit localhost host resolution, makes bb auth login require an explicit host argument, and fixes repository pagination so --limit caps total results rather than only controlling page size.
Changes:
- Remove the
http://localhost:7990default host fallback and return a validation error when no host is configured. - Change
bb auth loginto require a positional<host>argument (removing the--hostflag). - Rework repository listing pagination so
--limitcaps total returned results and stops fetching pages once satisfied.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/config/config.go | Removes localhost fallback; returns validation error when no host can be resolved. |
| internal/config/config_test.go | Updates env-based config tests and adds coverage for “no host configured” error. |
| internal/cli/cmd/auth/auth.go | Makes auth login host positional and removes --host flag. |
| internal/cli/cmd/auth/auth_test.go | Updates auth command tests for positional login host and dependency paths. |
| internal/services/repository/service.go | Implements limit-as-total-cap pagination with a fixed default page size. |
| internal/services/repository/service_test.go | Updates paging tests to assert early-stop behavior when the limit is reached. |
| internal/cli/repo_commands.go | Updates --limit help text to reflect total-cap semantics. |
| internal/cli/root_test.go | Adjusts CLI tests to use positional auth login host. |
| tests/integration/live/cli_command_coverage_live_test.go | Updates live CLI coverage tests for positional auth login host. |
| tests/integration/live/context_inference_live_test.go | Updates live context inference tests for positional auth login host. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
… cap repo list --limit as total - #84: Remove localhost:7990 default; return a clear validation error when no Bitbucket host is configured via BITBUCKET_URL or stored credentials - #86: Change 'bb auth login --host <url>' to a required positional argument 'bb auth login <host>'; update all call sites and tests accordingly - #87: Fix --limit on 'bb repo list' to cap total results instead of only controlling page size; add defaultPageSize=25 and paginate until limit is met Closes #84 Closes #86 Closes #87
40fd9c5 to
a5cf503
Compare
Summary
http://localhost:7990hardcoded fallback in config resolution; now returns a clear validation error (no Bitbucket host configured: set BITBUCKET_URL or run 'bb auth login <host>') when neitherBITBUCKET_URLnor stored credentials provide a host.bb auth login --host <url>to a required positional argument:bb auth login <host>. Removes the--hostflag and theLoadConfig()fallback path. All call sites and tests updated.--limitonbb repo listto cap total results rather than only controlling page size. IntroduceddefaultPageSize=25; pagination stops as soon as the limit is reached or the last page is returned.Changes
internal/config/config.godefaultBitbucketURLconst; empty host now returns a validation errorinternal/config/config_test.goTestLoadFromEnvErrorsWhenNoHostConfiguredinternal/cli/cmd/auth/auth.gologinnow usescobra.ExactArgs(1)positional host;--hostflag removedinternal/cli/cmd/auth/auth_test.gointernal/services/repository/service.godefaultPageSize=25; rewrotelistPaged()to treatLimitas total capinternal/services/repository/service_test.goTestListRepositoriesAcrossPagesto assert limit-as-cap behaviorinternal/cli/repo_commands.go--limitflag descriptioninternal/cli/root_test.goauth loginargtests/integration/live/cli_command_coverage_live_test.gotests/integration/live/context_inference_live_test.goNotes
All unit tests pass (
go test ./cmd/... ./internal/...). The live integration tests (-tags=live) require a running Bitbucket instance and are expected to fail in CI without one — this is a pre-existing environment constraint, not a regression introduced by this PR.Closes #84
Closes #86
Closes #87