You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
description: "Cortex Learn series: Learn how to set up and use the cortex-properties.yaml for branch support!. Author: \n"
3
+
description: "Cortex Learn series: Learn how to set up and use the cortex-properties.yaml\
4
+
\ for branch support!. Author: \n"
4
5
draft: false
5
6
notifications:
6
7
enabled: false
@@ -13,25 +14,66 @@ evaluation:
13
14
ladder:
14
15
name: Default Ladder
15
16
levels:
16
-
- name: Unwritten
17
-
rank: 1
18
-
color: "#D7AC58"
19
-
- name: Completed
20
-
rank: 2
21
-
color: "#7CCB92"
17
+
- name: Unwritten
18
+
rank: 1
19
+
color: "#D7AC58"
20
+
- name: Completed
21
+
rank: 2
22
+
color: "#7CCB92"
22
23
rules:
23
-
- title: Learned
24
-
description: "# About\nThis scorecard rule will walk you through setting up and testing multi-branch support in Cortex using the cortex-properties.yaml file.\n\n# Set up\nEnsure you have a functioning Github configuration and gitops enabled for entity type service. \n\n\n\n### Gotchas\n- The cortex-properties.yaml must be in the default branch. If it’s missing there, the configuration won't apply.\n- Changes in non-listed branches won’t be visible in Cortex.\n- You can manage the same entity across branches using the same x-cortex-tag. In this case, Cortex will reflect the entity as defined in the most recent commit across those branches.\n- Some customers track entities with different x-cortex-tags across multiple branches using the same directory and file names. While this works to distinguish entities in Cortex, it prevents GitOps-based auto-archiving from working as expected. Because Cortex sees these as the same file path across branches, it will archive the file in all branches if it’s removed from just one. To avoid this, customers should name the files differently or avoid using auto archiving. \n\n# Related Cortex Academy courses\nNone\n\n# Task\n\n- Add a cortex-properties.yaml file to the main branch with the following content:\n ```\n branches:\n - main\n - uat\n ```\n\n\n\n\n\n- Add a basic cortex.yaml file to define a simple entity in your sandbox. Example:\n ```\n openapi: 3.0.1\n info:\n title: My Sandbox Service\n x-cortex-tag: my-sandbox-service\n x-cortex-type: service\n ```\n\n- Create a new branch named uat.\n - In GitHub:\n - Go to your repository\n - Select the `main` branch dropdown\n - Type `uat` and select “Create branch: uat”\n - Or in your terminal:\n ```\n git checkout -b uat\n ```\n\n\n- In the `uat` branch, update the cortex.yaml to make this entity an incoming dependency for the `learn-cortex` entity. This will demonstrate the most recent commit being the source of truth:\n ```\n openapi: 3.0.1\n info:\n title: My Sandbox Service\n x-cortex-tag: my-sandbox-service\n x-cortex-type: service\n x-cortex-dependency:\n - tag: learn-cortex\n ```\n\n- Commit and push your changes to the uat branch:\n ```\n git add cortex.yaml\n git commit -m \"Add dependency block from uat branch\"\n git push origin uat\n ```\n\n\n- Confirm that:\n \n - The commit to the entity in uat was picked up and your new entity is now an incoming dependency for the learn-cortex entity and passing the rule. \n\n# Relevant documentation\n- [Using GitOps in a non-default branch](https://docs.cortex.io/settings/gitops#using-gitops-in-a-non-default-branch)\n"
25
-
expression: dependencies.in().length > 0
26
-
identifier: 921bc595-5a12-3aa1-af45-e17d17e0d649
27
-
weight: 1
28
-
level: Completed
29
-
failureMessage: "# About\nThis scorecard is checking that the incoming dependency is set to illustrate the most recent commit in the uat branch was successful. \n\n# Set up\nYou can read a little more about this here - [Using GitOps in a non-default branch](https://docs.cortex.io/settings/gitops#using-gitops-in-a-non-default-branch)\n\n"
24
+
- title: Learned
25
+
description: "# About\nThis scorecard rule will walk you through setting up and\
26
+
\ testing multi-branch support in Cortex using the cortex-properties.yaml file.\n\
27
+
\n# Set up\nEnsure you have a functioning Github configuration (https://docs.cortex.io/ingesting-data-into-cortex/integrations/github)\
28
+
\ and gitops enabled for entity type service (https://docs.cortex.io/settings/gitops).\
29
+
\ \n\n\n\n### Gotchas\n- The cortex-properties.yaml must be in the default branch.\
30
+
\ If it’s missing there, the configuration won't apply.\n- Changes in non-listed\
31
+
\ branches won’t be visible in Cortex.\n- You can manage the same entity across\
32
+
\ branches using the same x-cortex-tag. In this case, Cortex will reflect the\
33
+
\ entity as defined in the most recent commit across those branches.\n- Some customers\
34
+
\ track entities with different x-cortex-tags across multiple branches using the\
35
+
\ same directory and file names. While this works to distinguish entities in Cortex,\
36
+
\ it prevents GitOps-based auto-archiving from working as expected. Because Cortex\
37
+
\ sees these as the same file path across branches, it will archive the file in\
38
+
\ all branches if it’s removed from just one. To avoid this, customers should\
39
+
\ name the files differently or avoid using auto archiving. \n\n# Related Cortex\
40
+
\ Academy courses\nNone\n\n# Task\n\n- Add a \"cortex-properties.yaml\" file to\
41
+
\ the main branch with the following content:\n ```\n branches:\n -\
0 commit comments