Conversation
…cation - Add cmdutil.TimeAgo() and TimeAgoFromString() replacing 5 duplicate timeAgo implementations - Add cmdutil.GetUserDisplayName() replacing 2 duplicate getUserDisplayName functions - Add cmdutil.PrintJSON() replacing 8 duplicate JSON marshal/print blocks - Add cmdutil.PrintTableHeader() replacing 7 duplicate table header blocks - Add cmdutil.ConfirmPrompt() for shared confirmation logic - Replace all local truncateString/truncateMessage with existing cmdutil.TruncateString - Clean up unused imports across all modified files
- Add future timestamp guard in TimeAgo (returns 'in the future')
- Migrate project/list.go: replace truncateString, JSON, table header boilerplate
- Migrate issue/view.go: replace JSON output with cmdutil.PrintJSON
- Use 'any' instead of 'interface{}' in output.go
- Remove PRUser, PRParticipant, PullRequest, PRComment from pr/shared.go - Remove getPullRequest helper, use api.Client.GetPullRequest directly - Update pr/view.go to use api.PullRequest, api.User, cmdutil.GetUserDisplayName - Update pr/reopen.go, pr/diff.go, pr/merge.go, pr/checkout.go, pr/comment.go - Update pr/pr_test.go to use api types - Fix type conversions: int64 PR IDs, PRState to string casts
- Multi-stage build: golang:1.25-alpine builder + alpine:3.21 runtime - Supports VERSION and BUILD_DATE build args for ldflags - Minimal runtime image with git + ca-certificates - .dockerignore excludes .git, .worktrees, bin/, docs/, .github/
- Add Nickname field to api.User, add Nickname fallback in GetUserDisplayName - Use api.PRStateOpen/PRStateDeclined constants instead of raw strings - Dockerfile: add non-root user, OCI labels, BUILD_DATE default - .dockerignore: add Dockerfile, Makefile, .goreleaser.yml, dist/, *.test
refactor: eliminate code duplication, remove duplicate types, add Dockerfile
- Fix Makefile ldflags: github.com/rbansal42/bb -> github.com/rbansal42/bitbucket-cli - Remove unused formatTimestamp function from pipeline/view.go - Clean up unused time import
fix: Makefile module path + remove dead code from final review
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.
Summary
Merges the complete deduplication refactoring work from dev to main.
Phase 1: Extract shared utilities into cmdutil
cmdutil.TimeAgo()/TimeAgoFromString()— replaces 5 duplicate implementationscmdutil.TruncateString()— replaces 6 duplicate implementationscmdutil.GetUserDisplayName()— replaces 2 duplicate implementationscmdutil.PrintJSON()— replaces 8 duplicate JSON marshal blockscmdutil.PrintTableHeader()— replaces 7 duplicate table header blockscmdutil.ConfirmPrompt()— shared confirmation prompt helperPhase 2: Remove duplicate PR types
PRUser,PRParticipant,PullRequest,PRCommentfrompr/shared.goapi.*types directlyNicknamefield toapi.Userfor complete API compatibilityPhase 3: Dockerfile
golang:1.25-alpinebuilder +alpine:3.21runtime.dockerignoreBug fixes
formatTimestampfunction from pipeline/view.goStats