armory / dinghy

Pipelines as code for Spinnaker
Apache License 2.0
31 stars 12 forks source link

feat(repo_config): added support for multiple branches per single repo #165

Closed kkotula closed 2 years ago

kkotula commented 2 years ago

The purpose of this pull request is effectively enable support for multiple branches per single repository.

Let's use below repoConfig for example:

repoConfig:
  - provider: github
    repo: dinghy
    branch: main
  - provider: github
    repo: dinghy
    branch: test

Up until now fetching repository configuration - check method GetRepoConfig - utilized just two attributes: provider and repo. If we had configuration like the one above, search would return the first config that matched those two attributes. As the slice of is ordered, GetRepoConfig would always return first configuration without taking branch into consideration. Even though two branches are configured per single repository, we would always use just one.

I aimed at changing aforementioned behavior to actually support multiple branches per the same repository. To achieve that I added branch into the mix of attributes that are used to find expected configuration.

coveralls commented 2 years ago

Coverage Status

Coverage increased (+0.05%) to 53.788% when pulling 87ed246986e8c5f009d7896eaa5b31f01359b2f2 on feat/support_mutliple_branches_per_repo into f695642bddaf9aa34ac0eb2463236df872a40299 on master.