Skip to content

Commit 0f0614a

Browse files
learn-cortex-properties.yaml: updated rule instructions
1 parent c4d4ed0 commit 0f0614a

File tree

1 file changed

+58
-16
lines changed

1 file changed

+58
-16
lines changed
Lines changed: 58 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
tag: learn-cortex-properties.yaml
22
name: Learn cortex-properties.yaml
3-
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"
45
draft: false
56
notifications:
67
enabled: false
@@ -13,25 +14,66 @@ evaluation:
1314
ladder:
1415
name: Default Ladder
1516
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"
2223
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![Example 1](https://p-a6fkm3vd.t3.n0.cdn.zight.com/items/GGu9WoD7/5a857857-44b0-428c-8456-c33429fb615c.jpg?v=69cefc407fbc72aacb4541508a6bc9c8)\n\n![Example 2](https://p-a6fkm3vd.t3.n0.cdn.zight.com/items/kpurD5Xn/3201963d-e348-4471-ae27-63f7494ccdec.jpg?v=978c695c1e74c795e0d7b78c5fae9790)\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![Example 3](https://p-a6fkm3vd.t3.n0.cdn.zight.com/items/Wnu9xbLN/bc5a0dad-bd64-4efd-b903-e24a3ee9fe72.jpg?v=1dcf6620de8e9f77031aaaf6a55a3c1d)\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 -\
42+
\ main\n - uat\n ```\n![Example 1](https://p-a6fkm3vd.t3.n0.cdn.zight.com/items/GGu9WoD7/5a857857-44b0-428c-8456-c33429fb615c.jpg?v=69cefc407fbc72aacb4541508a6bc9c8)\n\
43+
\n![Example 2](https://p-a6fkm3vd.t3.n0.cdn.zight.com/items/kpurD5Xn/3201963d-e348-4471-ae27-63f7494ccdec.jpg?v=978c695c1e74c795e0d7b78c5fae9790)\n\
44+
\n\n- Add a basic \"cortex.yaml\" file to define a simple entity in your sandbox.\
45+
\ Example:\n ```\n openapi: 3.0.1\n info:\n title: My Sandbox Service\n\
46+
\ x-cortex-tag: my-sandbox-service\n x-cortex-type: service\n ```\n\
47+
\n- Create a new branch named uat.\n - In GitHub:\n - Go to your repository\n\
48+
\ - Select the `main` branch dropdown\n - Type `uat` and select\
49+
\ “Create branch: uat”\n - Or in your terminal (after navigating to the already\
50+
\ cloned repository folder):\n ```\n \n git checkout -b uat\n\
51+
\ ```\n![Example 3](https://p-a6fkm3vd.t3.n0.cdn.zight.com/items/Wnu9xbLN/bc5a0dad-bd64-4efd-b903-e24a3ee9fe72.jpg?v=1dcf6620de8e9f77031aaaf6a55a3c1d)\n\
52+
\n- In the `uat` branch, update the cortex.yaml to make this entity an incoming\
53+
\ dependency for the `learn-cortex` entity. This will demonstrate the most recent\
54+
\ commit being the source of truth:\n ```\n openapi: 3.0.1\n info:\n\
55+
\ title: My Sandbox Service\n x-cortex-tag: my-sandbox-service\n \
56+
\ x-cortex-type: service\n x-cortex-dependency:\n - tag: learn-cortex\n\
57+
\ ```\n\n- Commit and push your changes to the uat branch:\n ```\n git\
58+
\ add cortex.yaml\n git commit -m \"Add dependency block from uat branch\"\n\
59+
\ git push origin uat\n ```\n\n\n- Confirm that:\n \n - The commit to\
60+
\ the entity in uat was picked up and your new entity is now an incoming dependency\
61+
\ for the learn-cortex entity and passing the rule. \n\n# Relevant documentation\n\
62+
- [Using GitOps in a non-default branch](https://docs.cortex.io/settings/gitops#using-gitops-in-a-non-default-branch)\n"
63+
expression: dependencies.in().length > 0
64+
identifier: 921bc595-5a12-3aa1-af45-e17d17e0d649
65+
weight: 1
66+
level: Completed
67+
failureMessage: "# About\nThis scorecard is checking that the incoming dependency\
68+
\ is set to illustrate the most recent commit in the uat branch was successful.\
69+
\ \n\n# Set up\nYou can read a little more about this here - [Using GitOps in\
70+
\ a non-default branch](https://docs.cortex.io/settings/gitops#using-gitops-in-a-non-default-branch)\n\
71+
\n"
3072
filter:
3173
kind: GENERIC
3274
types:
3375
include:
34-
- service
76+
- service
3577
groups:
3678
include:
37-
- learn-cortex
79+
- learn-cortex

0 commit comments

Comments
 (0)