Skip to content
This repository has been archived by the owner on Feb 15, 2022. It is now read-only.

Map different ring names to git branches #1313

Open
5 tasks
bnookala opened this issue Apr 3, 2020 · 4 comments
Open
5 tasks

Map different ring names to git branches #1313

bnookala opened this issue Apr 3, 2020 · 4 comments
Assignees
Labels
effort - L indicates item should be broken up enhancement New feature or request great for pairing needs-investigation x-project Mapped to external projects

Comments

@bnookala
Copy link
Member

bnookala commented Apr 3, 2020

As a:

SPK User

I want:

To map different ring names to git branches

So that:

My ring names don't have to be the same as the git branch names

Describe the solution you'd like:

Perhaps some sort of mapping in bedrock.yaml that allows a ring name to target a git branch name, allowing a user to specify a git branch to use for a ring ie

rings:
  prod:
    targetBranch: "master"
  develop:
    targetBranch: "develop"
  qa:
    targetBranch: "test"
etc.

Though perhaps the ideal schema should be inverted to be branch name as the key, and the target ring name as the value ie - we should spend some time figuring out what makes sense here

rings:
  master:
    targetRing "prod" 
  develop:
    targetRing: "develop"
  test:
    targetRing: "qa"

Acceptance Criteria:

  • SPK cli should allow me to specify which target branch i would like to use
  • Bedrock yaml schema should be updated to accommodate a target branch for rings
  • Lifecycle pipeline should accommodate creating ingress routes using the targetRing parameter as the header ring
  • Integration tests
  • Documentation

Describe alternatives you've considered:

This is a preliminary investigation into how we might map different rings to branches - there may exist other methods of solving this.

Additional context:

Customer request

Does this require updates to documentation?:

Yes

@bnookala bnookala added the enhancement New feature or request label Apr 3, 2020
@bnookala bnookala added this to the Service Management Automation milestone Apr 3, 2020
@andrebriggs andrebriggs added the x-project Mapped to external projects label Apr 4, 2020
@andrebriggs
Copy link
Member

@samiyaakhtar if the branch name is now different from the ring name you would need to look at bedrock.yaml to retrieve

@bnookala @evanlouie The customer said this is low priority. I think so too at the moment so we can take our time to think about this. I would put other refactoring and testing ahead of this.

@andrebriggs andrebriggs added this to Ungroomed in Backlog Apr 6, 2020
@andrebriggs andrebriggs moved this from Ungroomed to Prioritized User Stories (Don't modify) in Backlog Apr 13, 2020
@evanlouie evanlouie added the effort - L indicates item should be broken up label Apr 20, 2020
@evanlouie evanlouie added this to To do in Sprint 20 via automation Apr 20, 2020
@evanlouie evanlouie removed this from Prioritized User Stories (Don't modify) in Backlog Apr 20, 2020
@evanlouie evanlouie added this to To do in Sprint 21 via automation Apr 27, 2020
@evanlouie evanlouie self-assigned this Apr 27, 2020
@evanlouie evanlouie moved this from To do to In progress in Sprint 21 Apr 27, 2020
@samiyaakhtar
Copy link
Contributor

@evanlouie @andrebriggs Just created #1396 as a follow up task

@evanlouie evanlouie added this to To do in Sprint 22+ via automation May 4, 2020
@evanlouie evanlouie moved this from To do to In progress in Sprint 22+ May 4, 2020
evanlouie added a commit to microsoft/bedrock-cli that referenced this issue May 4, 2020
- Rings in `bedrock.yaml` now contain a `targetBranch` (set via
  `--target-branch` flag on `ring create`).
  - The `targetBranch` is used as the the trigger branch for the
    serve-build-and-update pipelines; Added during `ring create` time.
- The HLD repository now follows a directory structure of:
  ```
  HLD
  ├── component.yaml
  └── my-application
      ├── access.yaml
      ├── config
      │   └── common.yaml
      ├── component.yaml
      └── <service-name>
          ├── config
          │   └── common.yaml
          ├── component.yaml
          └── <branch-name> # Is no longer always the name of the ring -- uses targetBranch if it was provided and the ring name as fallback
              ├── component.yaml
              ├── config
              │   └── common.yaml
              └── static
                  ├── ingress-route.yaml # still matches on a `Ring` header for the ring name
                  └── middlewares.yaml
  ```

closes microsoft/bedrock#1313
evanlouie added a commit to microsoft/bedrock-cli that referenced this issue May 4, 2020
- Rings in `bedrock.yaml` now contain a `targetBranch` (set via
  `--target-branch` flag on `ring create`).
  - The `targetBranch` is used as the the trigger branch for the
    serve-build-and-update pipelines; Added during `ring create` time.
- The HLD repository now follows a directory structure of:
  ```
  HLD
  ├── component.yaml
  └── my-application
      ├── access.yaml
      ├── config
      │   └── common.yaml
      ├── component.yaml
      └── <service-name>
          ├── config
          │   └── common.yaml
          ├── component.yaml
          └── <branch-name> # Is no longer always the name of the ring -- uses targetBranch if it was provided and the ring name as fallback
              ├── component.yaml
              ├── config
              │   └── common.yaml
              └── static
                  ├── ingress-route.yaml # still matches on a `Ring` header for the ring name
                  └── middlewares.yaml
  ```

closes microsoft/bedrock#1313
evanlouie added a commit to microsoft/bedrock-cli that referenced this issue May 4, 2020
- Rings in `bedrock.yaml` now contain a `targetBranch` (set via
  `--target-branch` flag on `ring create`).
  - The `targetBranch` is used as the the trigger branch for the
    serve-build-and-update pipelines; Added during `ring create` time.
- The HLD repository now follows a directory structure of:
  ```
  HLD
  ├── component.yaml
  └── my-application
      ├── access.yaml
      ├── config
      │   └── common.yaml
      ├── component.yaml
      └── <service-name>
          ├── config
          │   └── common.yaml
          ├── component.yaml
          └── <branch-name> # Is no longer always the name of the ring -- uses targetBranch if it was provided and the ring name as fallback
              ├── component.yaml
              ├── config
              │   └── common.yaml
              └── static
                  ├── ingress-route.yaml # still matches on a `Ring` header for the ring name
                  └── middlewares.yaml
  ```

closes microsoft/bedrock#1313
evanlouie added a commit to microsoft/bedrock-cli that referenced this issue May 4, 2020
- Rings in `bedrock.yaml` now contain a `targetBranch` (set via
  `--target-branch` flag on `ring create`).
  - The `targetBranch` is used as the the trigger branch for the
    serve-build-and-update pipelines; Added during `ring create` time.
- The HLD repository now follows a directory structure of:
  ```
  HLD
  ├── component.yaml
  └── my-application
      ├── access.yaml
      ├── config
      │   └── common.yaml
      ├── component.yaml
      └── <service-name>
          ├── config
          │   └── common.yaml
          ├── component.yaml
          └── <branch-name> # Is no longer always the name of the ring -- uses targetBranch if it was provided and the ring name as fallback
              ├── component.yaml
              ├── config
              │   └── common.yaml
              └── static
                  ├── ingress-route.yaml # still matches on a `Ring` header for the ring name
                  └── middlewares.yaml
  ```

closes microsoft/bedrock#1313
@evanlouie evanlouie moved this from In progress to Impeded in Sprint 22+ May 5, 2020
@evanlouie
Copy link
Contributor

evanlouie commented May 5, 2020

After deeper investigation and attempts at a not too intrusive solution, I believe this cannot be completed without very heavy refactoring of the service build-update pipeline.

Looking for feedback to see if this feature is worth such refactoring.

Notes on what would need to be done captured in: microsoft/bedrock-cli#36

Problems:
The build-update pipeline has no way to map its trigger branch back to a ring.
It doesn't know which directory it needs to cd into prior to calling
fab set to update the image tag.
Multiple rings can map to the same branch. Meaning that the build-update
pipeline would need to be able to update multiple rings -- requiring parsing
of bedrock.yaml.
To get around this problems, we would need to the ability to parse the
bedrock.yaml file in the build-update pipeline. To do so, we would need to
implement a pseudo hld reconcile-like function which would be called in the
pipeline -- meaning the build-update pipeline would require the bedrock-cli as
well (just like the lifecycle pipeline).

I'm leaning towards such refactoring and increase in complexity of the pipeline not being worth the feature -- @andrebriggs @bnookala @mtarng

@evanlouie
Copy link
Contributor

Putting this back in the backlog it becomes a higher priority. Requires deeper design review to come up with solution to address whats mentioned above

@andrebriggs andrebriggs added this to Low Priority Stories (Don't modify) in Backlog May 5, 2020
@evanlouie evanlouie removed this from Impeded in Sprint 22+ May 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
effort - L indicates item should be broken up enhancement New feature or request great for pairing needs-investigation x-project Mapped to external projects
Projects
Backlog
  
Low Priority Stories (Don't modify)
Sprint 20
  
To do
Sprint 21
  
In progress
Development

Successfully merging a pull request may close this issue.

4 participants