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.

@samiyaakhtar
Copy link
Contributor

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

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
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

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
None yet
Development

Successfully merging a pull request may close this issue.

4 participants