-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Buildkite Package Registries command help wording fixes. #440
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,12 +27,12 @@ func NewCmdPackagePush(f *factory.Factory) *cobra.Command { | |
var web bool | ||
|
||
cmd := cobra.Command{ | ||
Use: "push registry-name {path/to/file | --stdin-file-name filename -}", | ||
Short: "Push a new package to Buildkite Packages", | ||
Use: "push registry-slug {path/to/file | --stdin-file-name filename -}", | ||
Short: "Push a new package to a Buildkite registry", | ||
Long: heredoc.Doc(` | ||
Push a new package to Buildkite Packages. The package can be passed as a path to a file in the second positional argument, | ||
or via stdin. If passed via stdin, the filename must be provided with the --stdin-file-name flag, as Buildkite | ||
Packages requires a filename for the package.`), | ||
Push a new package to a Buildkite registry. The package can be passed as a path to a file in the second positional argument, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A "Buildkite registry" is more accurate/specific than the former product name "Buildkite Packages", and less cumbersome than referring to this type of registry as a "Buildkite Package Registries registry". |
||
or via stdin. If passed via stdin, the filename must be provided with the --stdin-file-name flag, as a Buildkite | ||
registry requires a filename for the package.`), | ||
Example: heredoc.Doc(` | ||
Push a package to a Buildkite registry | ||
The web URL of the uploaded package will be printed to stdout. | ||
|
@@ -74,7 +74,7 @@ func NewCmdPackagePush(f *factory.Factory) *cobra.Command { | |
} | ||
|
||
var pkg buildkite.Package | ||
spinErr := bk_io.SpinWhile("Pushing package", func() { | ||
spinErr := bk_io.SpinWhile("Pushing file", func() { | ||
pkg, _, err = f.RestAPIClient.PackagesService.Create(cmd.Context(), f.Config.OrganizationSlug(), cfg.RegistrySlug, buildkite.CreatePackageInput{ | ||
Filename: packageName, | ||
Package: from, | ||
|
@@ -87,13 +87,13 @@ func NewCmdPackagePush(f *factory.Factory) *cobra.Command { | |
return fmt.Errorf("%w: request to create package failed: %w", ErrAPIError, err) | ||
} | ||
|
||
fmt.Fprintf(cmd.OutOrStdout(), "Created package: %s\n", pkg.Name) | ||
fmt.Fprintf(cmd.OutOrStdout(), "View it on the web at: %s\n", pkg.WebURL) | ||
fmt.Fprintf(cmd.OutOrStdout(), "Created package file: %s\n", pkg.Name) | ||
fmt.Fprintf(cmd.OutOrStdout(), "View this file on the web at: %s\n", pkg.WebURL) | ||
return util.OpenInWebBrowser(web, pkg.WebURL) | ||
}, | ||
} | ||
|
||
cmd.Flags().StringP(stdinFileNameFlag, "n", "", "The filename to use for the package, if it's passed via stdin. Invalid otherwise.") | ||
cmd.Flags().StringP(stdinFileNameFlag, "n", "", "The name to use for the package file, if it is passed via stdin. Invalid otherwise.") | ||
cmd.Flags().BoolVarP(&web, "web", "w", false, "Open in a web browser the package information after it has been uploaded.") | ||
|
||
return &cmd | ||
|
@@ -136,12 +136,12 @@ func loadAndValidateConfig(flags *pflag.FlagSet, args []string) (*pushPackageCon | |
} | ||
|
||
if args[1] == "-" && stdinFileName.Value.String() == "" { | ||
return nil, fmt.Errorf("%w: When passing a package via stdin, the --stdin-file-name flag must be provided", ErrInvalidConfig) | ||
return nil, fmt.Errorf("%w: When passing a package file via stdin, the --stdin-file-name flag must be provided", ErrInvalidConfig) | ||
} | ||
|
||
if stdinFileName.Value.String() != "" { | ||
if args[1] != "-" { | ||
return nil, fmt.Errorf("%w: When passing a package via stdin, the final argument must be '-'", ErrInvalidConfig) | ||
return nil, fmt.Errorf("%w: When passing a package file via stdin, the final argument must be '-'", ErrInvalidConfig) | ||
} | ||
|
||
stdInReadable, err := isStdInReadableFunc() | ||
|
This file contains 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An important change, considering slugs and names are distinctly different.