Sitelet https://web.archive.org/web/20200908095958/https://github.com/microsoft/bedrock/issues/1313/
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Map different ring names to git branches #1313

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

Map different ring names to git branches #1313

bnookala opened this issue Apr 3, 2020 · 4 comments

Comments

@bnookala
Copy link
Member

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

@andrebriggs
Copy link
Member

@andrebriggs andrebriggs commented Apr 6, 2020

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

@samiyaakhtar samiyaakhtar commented Apr 28, 2020

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

@evanlouie evanlouie commented May 5, 2020

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 join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Sprint 20
  
To do
Sprint 21
  
In progress
Backlog
  
Low Priority Stories (Don't modify)
Linked pull requests

Successfully merging a pull request may close this issue.

4 participants
You can’t perform that action at this time.