apollographql / apollographql/apollo-tooling

Better handling for git not being installed during service push

Open
#1,989 0 comments 2 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
3k
Forks
460
PR merge metrics
No merged PRs in 30d

Description

**Intended outcome:**

Attempting to push schema using the CLI from a docker image that does not have git CLI installed.

I am providing a variant name (a.k.a 'tag'), so the git commit hash should not be necessary. I should see a successful push without any errors.

The process does continues and completes successfully, but I need to supply this tool to colleagues and an error in the logs is going to cause issues.

**Actual outcome:**

An error is output to the console.

```
Loading Apollo Project [started]
Loading Apollo Project [completed]
Uploading service to Apollo Graph Manager [started]
Unable to retrieve remote url, failed with:
Error: [git-rev-sync] failed to execute command: null/Error: spawnSync git ENOENT
Fetching info from federated service
Uploading service to Apollo Graph Manager [completed]
A new service called 'test' for the 'my-graph@dev' graph was created
The gateway for the 'my-graph@dev' graph was updated with a new schema, composed from the updated 'orders' service
╔════════╤══════════════════════╤═══════════════╗
║ id │ graph │ tag ║
╟────────┼──────────────────────┼───────────────╢
║ 72d97a │ my-graph │ dev ║
╚════════╧══════════════════════╧═══════════════╝
```

**How to reproduce the issue:**

Execute the service:push command in an environment where git is not installed. Use the --variant argument.

**Versions**

apollo@2.28.0

Contributor guide

Open the contributing guide

Research direction

Start at the service:push command and reproduce the upload in an environment without git, using --variant. Trace the handling of the git-rev-sync ENOENT message; done means a variant-based push succeeds without emitting an error when git is unavailable.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, typescript
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.