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
Implement register-buildpack
for github type
#716
Conversation
2740165
to
7b4853b
Compare
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.
Overall, it's definitely looking good. Some broader suggestions:
- This should probably have an acceptance test as well, given that it's a new command
- There are quite a few sad paths (particularly in
register_buildpack
) that aren't tested, and should be simple to exercise - It would be nice if more of the errors were wrapped
errors.Wrap
to provide a bit more context to users in sad paths. - I assume one of the maintainers will need to create https://github.com/buildpacks/registry for this to work/test locally, which may be helpful.
return nil | ||
}), | ||
} | ||
cmd.Flags().StringVarP(&flags.BuildpackRegistry, "buildpack-registry", "R", "", "Buildpack Registry name") |
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.
Can we use r
instead of R
? Seems like we only use uppercase shortened flags by pack build
, when we have no other choice
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.
@dfreilich I'm in support of following conventions, so happy to make the change if that is the case. 👍
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.
@dfreilich I don't think that's the ongoing rule. At least during the initial registry PR I proposed capital R
because:
A --buildpack-registry feels like it's of the same importance as --builder.
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.
I understand the importance, but as a cli user, I would find it annoying to capitalize something (a whole extra button press) which is supposed to make it easier; I find capitalized arguments to be more annoying to remember/use.
I thought the use of -B
by pack build
was more because we needed some way of distinguishing --buildpack
from --builder
, rather than to underscore the importance of the argument; and if so, we should follow that pattern in other commands (like create-builder
, which only has lower case shortened ones)
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.
@dfreilich I see your point. at the very minimum I would think we can agree that both build
and register-buildpack
should both use the same flag casing.
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.
@jromero @dfreilich so what's the take away here? Do we want to change -R
to be -r
?
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.
I'd still vote for -r
over -R
484590a
to
d1a0ce4
Compare
@dfreilich Thanks again for the feedback! As far as acceptance tests are concerned, I don't think it should be considered a blocker. Most of the logic for this command is centered on the ability to open a |
f24e942
to
d639776
Compare
Co-authored-by: Joe Kutner <jpkutner@gmail.com> Signed-off-by: Travis Longoria <longoria.public@gmail.com>
d639776
to
83de8b5
Compare
Codecov Report
@@ Coverage Diff @@
## main #716 +/- ##
==========================================
+ Coverage 72.51% 73.52% +1.01%
==========================================
Files 67 75 +8
Lines 4896 5135 +239
==========================================
+ Hits 3550 3775 +225
- Misses 1023 1043 +20
+ Partials 323 317 -6
|
@jromero and @dfreilich are there any more action items on this PR that you'd like resolved? |
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.
overall LGTM!
return nil | ||
}), | ||
} | ||
cmd.Flags().StringVarP(&flags.BuildpackRegistry, "buildpack-registry", "R", "", "Buildpack Registry name") |
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.
I'd still vote for -r
over -R
a2192f0
to
0ae4930
Compare
@jromero any final thoughts on this? |
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.
This is looking great! I've marked a few requested changes. Feel free to reach out via slack or other ways if something is unclear.
Signed-off-by: Travis Longoria <longoria.public@gmail.com>
aec5c7b
to
cd01c95
Compare
Signed-off-by: Travis <longoria.public@gmail.com>
cd01c95
to
3854992
Compare
UA 1: TOML data format
FeedbackIt looks like the output doesn't match exactly what the RFC proposes. There is a missing field for the digest whereas this PR has the digest included as part of the Error cases
|
@jromero I spoke with @jkutner and the intention is to have the |
Sounds good! ✨ Approved! ✨ |
register-buildpack
for github type
Summary
**NOTE: In the RFC, there is mention of 2 types to support:
github
andgit
. This PR is ONLY for supportinggithub
.This PR adds functionality to the
pack
CLI to support registering a buildpack with github. A new command (register-buildpack
) was introduced (hidden behind the experimental flag)By default, if no configuration values are defined in the
config.toml
file, buildpacks will be registered against:https://github.com/buildpacks/registry
. In addition, user can specify their own registries. For example:When there are multiple
registries
, the user can specify a specific registry viabuildpack-registry, -R
flag.For example:
pack register-buildpack <buildpack/image> -R elbandito
For more details:
https://github.com/buildpacks/rfcs/blob/main/text/0022-client-side-buildpack-registry.md
buildpacks/rfcs#75
Documentation
Related
buildpacks/rfcs#75