Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

Add branch mapping to rings #36

Closed
wants to merge 1 commit into from
Closed

Conversation

evanlouie
Copy link
Contributor

@evanlouie evanlouie commented May 4, 2020

THIS PR IS INCOMPLETE -- SEEKING FEEDBACK

This PR is an initial attempt to add the ability to map custom branches to
rings. After investigation and attempts at implementation, I've come to the
conclusion that without a major refactor to the service-build-update pipeline,
adding this functionality cannot be done cleanly.

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 do not believe that the additional functionally of target branches for rings
worth this jump in complexity for hte pipeline.

closes microsoft/bedrock#1313

- 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
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Map different ring names to git branches
1 participant