-
Notifications
You must be signed in to change notification settings - Fork 59
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
feat(compute): clone starter kit source with init --from=serviceID #1213
Conversation
When a service is created from a Starter Kit, running compute init --from=serviceID gets the language and little else. This change fetches the source code of the template that was used.
The clone operation will pull the 'original' source directly from GitHub? Will it pull a specific commit hash to ensure that it gets the same thing that was used to initialize the service? If it will be pulling directly from GitHub, the error handling will need to make that clear, since any failure on GitHub's part will make 'fastly compute init' fail and the user will assume it's a Fastly problem. |
Sorry for changing the title of this PR. I should have looked a bit more but confused by the description (or lack of) for the Could we mention the serviceID in here or this was omitted on purpose? |
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 feel like the --from=<ServiceID>
feature is a bit misleading (dare I say... less than useful) or I guess I'm just generally a bit confused by its motivation/purpose 🤔
In my mind if I use --from=<ServiceID>
then I'm expecting the code for that package to be made available to me so I can continuing developing the package. But from what I can tell this is just downloading the starter kit that the package was originally based on, and I'm not sure how that's useful.
Now if the original developer of the package had set --include-source
as part of the fastly compute build
subcommand, then I guess we might be able to extract the original source code from the uploaded package (e.g. download the package, and then extract code from the package.tar.gz
file).
EDIT: I saw something internally that indicated this implementation might make sense when tied into something coming in the UI in the future.
Sorry, I'm not totally sure I follow. Mention it where, in the PR, or somewhere in code/messaging? |
In the help description:
|
Introduced two changes here, based on feedback and working with product: 1. Improved the wording of the messaging to stdout while fetching a package's starter kit source to make it clearer that's what's happening. 2. Only attempt to fetch the source if the service version is 1.
@Integralist @kpfleming @fgsch Updated with feedback addressed. After some internal discussions, there are three changes here:
|
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.
One small requested change, otherwise LGTM.
eb90f48
to
da47c5f
Compare
When we initialize an empty service with
compute init --from=<serviceID>
, we don't have the source code. This change attempts to look at thecloned_from
metadata and use that to fetch the rest of the project.