spryker-sdk / upgrader

Upgrading and migrating tool for Spryker SCOS
Other
3 stars 2 forks source link

Please use the Github API, Gitlab API, Bitbucket API #38

Open jolo-dev opened 2 years ago

jolo-dev commented 2 years ago

I saw that the Git is using bash commands. Please use their official API instead because using bash requires Git configurations and might not matches your git configuration locally with using cloud containers etc.

Github API

https://docs.github.com/en/developers https://docs.github.com/en/rest

Github PHP Wrapper https://github.com/KnpLabs/php-github-api

Gitlab API

https://docs.gitlab.com/ee/api/

Gitlab PHP Wrapper https://github.com/GitLabPHP/Client

Bitbucket API

https://developer.atlassian.com/server/bitbucket/reference/rest-api/ https://developer.atlassian.com/cloud/bitbucket/rest/intro/ (CLOUD) https://developer.atlassian.com/server/bitbucket/how-tos/command-line-rest/ (SERVER)

As I see you do Provider checks here so you can make use of which API to use.

dereuromark commented 2 years ago

You are right

$command = ['git', 'ls-remote', '--heads', 'origin', $this->getHeadBranch()];

Long term the proper API should be used here.

For now in beta phase I think the developers will need to keep the current flow for now, but there are backlog tickets that will address this.