eclipse-archived / codewind-installer

The installation package for installing Codewind into an editor
https://codewind.dev
Eclipse Public License 2.0
5 stars 28 forks source link

[0.14.0] Retrieve default branch from github API. #507

Closed hhellyer closed 4 years ago

hhellyer commented 4 years ago

What type of PR is this ?

What does this PR do ?

Removes the assumption that a repositories default branch is master and replaces it with a query via the github API to find the default branch name. See: https://developer.github.com/v3/repos/#get-a-repository (We use the github API written in Go to access this.)

I've tested this by running: cwctl --insecure project create --conid KB9FJ0QO --p ~/work/codewind/codewind-workspace/odo-java --url https://codeload.github.com/spring-projects/spring-petclinic and it is now possible to create a Codewind project from that github repository.

Which issue(s) does this PR fix ?

This resolves being unable to create a project from the ODO Java template. This was caused by the project renaming it's default branch from master to main.

Link to the Codewind repository issue(s) this PR fixes or references:

https://github.com/eclipse/codewind/issues/3197

Does this PR require a documentation change ?

Any special notes for your reviewer ?

This is a port of the same changes merged into master under https://github.com/eclipse/codewind-installer/pull/504

codecov[bot] commented 4 years ago

Codecov Report

Merging #507 into 0.14.0 will increase coverage by 0.04%. The diff coverage is 53.84%.

Impacted file tree graph

@@            Coverage Diff             @@
##           0.14.0     #507      +/-   ##
==========================================
+ Coverage   19.35%   19.39%   +0.04%     
==========================================
  Files          81       81              
  Lines        7031     7042      +11     
==========================================
+ Hits         1361     1366       +5     
- Misses       5499     5503       +4     
- Partials      171      173       +2     
Impacted Files Coverage Δ
pkg/utils/download.go 52.11% <50.00%> (-0.56%) :arrow_down:
pkg/project/create.go 50.48% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 38b9896...13c1c80. Read the comment docs.