This repository was archived by the owner on Feb 15, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
This repository was archived by the owner on Feb 15, 2022. It is now read-only.
CLI hld init --git-push fails when HLD repository is empty #1212
Copy link
Copy link
Closed
microsoft/bedrock-cli
#24Labels
DXDeveloper experienceDeveloper experiencebugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomers
Milestone
Description
Describe the bug:
spk hld init --git-push fails when HLD repository is empty (no initial commits)
Error log:
❯ spk hld init --git-push
info: Initializing bedrock HLD repository.
info: Generating hld manifest-generation in /home/bhargav/code/test-hld-2
info: Writing manifest-generation.yaml file to /home/bhargav/code/test-hld-2/manifest-generation.yaml
info: Generated manifest-generation.yaml. Commit and push this file to master before attempting to deploy via the command 'spk hld install-manifest-pipeline'
; before running the pipeline ensure the following environment variables are available to your pipeline: 'MANIFEST_REPO' (Repository for your kubernetes manifes
ts in AzDo. eg. 'dev.azure.com/bhnook/fabrikam/_git/materialized'), 'PAT' (AzDo Personal Access Token with permissions to the HLD repository.)
info: Generating component.yaml in /home/bhargav/code/test-hld-2
info: Writing component.yaml file to /home/bhargav/code/test-hld-2/component.yaml
info: Generating starter .gitignore in /home/bhargav/code/test-hld-2
info: Writing .gitignore file to /home/bhargav/code/test-hld-2/.gitignore
info: Link to create PR: https://dev.azure.com/bhnook/spk-testing/_git/test-hld-2/pullrequestcreate?sourceRef=spk-hld-init&targetRef=master
error: Cannot checkout original branch master. Clean up will need to be done manually. Error: Unable to checkout git branch master: Error: error: pathspec 'ma
ster' did not match any file(s) known to git
error: Error occurred while initializing hld repository /home/bhargav/code/test-hld-2
error: Cannot checkout original branch master. Clean up will need to be done manually. Error: Unable to checkout git branch master: Error: error: pathspec 'ma
ster' did not match any file(s) known to git
To Reproduce:
- Create a new repository in AzDo - do not select the "Add a README" option.
- Clone the repository on the command line
- Run:
spk hld init --git-push
Expected behavior:
We should either add an empty commit to the cloned branch and push it up before creating the HLD branch and PR
OR
We should error saying that there are no commits and detail the exact command necessary:
git commit -m "Init HLD" --allow-empty && git push origin HEAD
Does this require updates to documentation?:
no
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
DXDeveloper experienceDeveloper experiencebugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomers