Skip to content
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

Allow compute init to be reinvoked within an existing package directory #138

Merged
merged 2 commits into from
Jul 8, 2020

Conversation

phamann
Copy link
Member

@phamann phamann commented Jul 7, 2020

TL;DR

Refactors compute init allowing it to be reinvoked within an existing package directory. This is allows more frictionless user journeys between the UI and CLI, for instance allowing as user to regenerate domain or backend etc.

Best reviewed with ?w=1 to ignore whitespace changes: https://github.com/fastly/cli/pull/138/files?w=1

What

  • Changes the flag parsing to populate the manifest data-structure for fields serviceid, name, description, author
  • Guards package template fetching/creation if package already exists
  • Allows multiple author flags to be provided
  • Adds test for existing manifest

@phamann phamann added the enhancement New feature or request label Jul 7, 2020
@phamann phamann requested a review from thommahoney July 7, 2020 12:53
pkg/compute/init.go Outdated Show resolved Hide resolved
pkg/app/run_test.go Outdated Show resolved Hide resolved
pkg/compute/init.go Outdated Show resolved Hide resolved
Comment on lines +80 to +86
if len(d.Flag.Authors) > 0 {
return d.Flag.Authors, SourceFlag
}

if len(d.File.Authors) > 0 {
return d.File.Authors, SourceFile
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to combine them?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They are subtly different. One returns the Flag value, the other returns the File value.

Co-authored-by: Thom Mahoney <mahoneyt@gmail.com>
@phamann phamann merged commit 9fe14a8 into master Jul 8, 2020
@phamann phamann deleted the phamann/rerun-init branch July 8, 2020 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants