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

Replace archived go-git dependency #283

Merged
merged 8 commits into from May 19, 2021
Merged

Conversation

Integralist
Copy link
Collaborator

@Integralist Integralist commented May 18, 2021

Problem: the go-git dependency doesn't support SSH, resulting in strange low-level authentication errors.
Solution: replace go based implementation of git with a subprocess call to the user's git binary.

Example

$ fastly compute init --name test -d "thing" -a "$(whoami)" -f git@github.com:fastly/compute-starter-kit-rust-default.git -l Rust
Creating a new Compute@Edge project.

Press ^C at any time to quit.


✓ Initializing...
✓ Checking if git is installed...
✓ Fetching package template...
✓ Updating package manifest...
✓ Initializing package...

Initialized package test to:
        /Users/integralist/Code/go/testing-cli-cloningrepo

To publish the package (build and deploy), run:
        fastly compute publish

To learn about deploying Compute@Edge projects using third-party orchestration tools, visit:
        https://developer.fastly.com/learning/integrations/orchestration/


SUCCESS: Initialized package test

Now if I tree the current directory...

$ tree
.
├── Cargo.lock
├── Cargo.toml
├── LICENSE
├── README.md
├── SECURITY.md
├── fastly.toml
├── rust-toolchain
└── src
    └── main.rs

If git is not installed you should see:

✗ Initializing...

ERROR: `git` not found in $PATH.

The Fastly CLI requires a local installation of git.  For installation instructions for your operating system see:

        $ https://git-scm.com/book/en/v2/Getting-Started-Installing-Git

@Integralist Integralist added the enhancement New feature or request label May 18, 2021
@Integralist Integralist marked this pull request as ready for review May 18, 2021 16:53
@Integralist Integralist requested review from phamann, a team and triblondon and removed request for a team May 18, 2021 16:53
pkg/compute/init.go Outdated Show resolved Hide resolved
pkg/compute/init.go Outdated Show resolved Hide resolved
Copy link
Member

@phamann phamann left a comment

Choose a reason for hiding this comment

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

LGTM

@Integralist Integralist merged commit a613afd into main May 19, 2021
@Integralist Integralist deleted the integralist/replace-go-git branch May 19, 2021 14:37
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.

None yet

3 participants