Skip to content

Commit b03e2b2

Browse files
committed
learn-cortex-properties.yaml: Added instructions and rule to this scorecard
1 parent 6fa80aa commit b03e2b2

File tree

1 file changed

+42
-18
lines changed

1 file changed

+42
-18
lines changed

data/scorecards/learn-cortex-properties.yaml.yaml

Lines changed: 42 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -22,27 +22,51 @@ ladder:
2222
color: "#7CCB92"
2323
rules:
2424
- title: Learned
25-
expression: custom("learned") != null
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 and gitops enabled\
28+
\ for entity type service. \n\n\n\n### Gotchas\n- The cortex-properties.yaml must\
29+
\ be in the default branch. If it’s missing there, the configuration won't apply.\n\
30+
- Changes in non-listed branches won’t be visible in Cortex.\n- You can manage\
31+
\ the same entity across branches using the same x-cortex-tag. In this case, Cortex\
32+
\ will reflect the entity as defined in the most recent commit across those branches.\n\
33+
- Some customers track entities with different x-cortex-tags across multiple branches\
34+
\ using the same directory and file names. While this works to distinguish entities\
35+
\ in Cortex, it prevents GitOps-based auto-archiving from working as expected.\
36+
\ Because Cortex sees these as the same file path across branches, it will archive\
37+
\ the file in all branches if it’s removed from just one. To avoid this, customers\
38+
\ should name the files differently or avoid using auto archiving. \n\n# Related\
39+
\ Cortex Academy courses\nNone\n\n# Task\n\n- Add a cortex-properties.yaml file\
40+
\ to the main branch with the following content:\n ```\n branches:\n \
41+
\ - 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\
42+
\n![Example 2](https://p-a6fkm3vd.t3.n0.cdn.zight.com/items/kpurD5Xn/3201963d-e348-4471-ae27-63f7494ccdec.jpg?v=978c695c1e74c795e0d7b78c5fae9790)\n\
43+
\n\n- Add a basic cortex.yaml file to define a simple entity in your sandbox.\
44+
\ Example:\n ```\n openapi: 3.0.1\n info:\n title: My Sandbox Service\n\
45+
\ x-cortex-tag: my-sandbox-service\n x-cortex-type: service\n ```\n\
46+
\n- Create a new branch named uat.\n - In GitHub:\n - Go to your repository\n\
47+
\ - Select the `main` branch dropdown\n - Type `uat` and select\
48+
\ “Create branch: uat”\n - Or in your terminal:\n ```\n git checkout\
49+
\ -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\
50+
\n- In the `uat` branch, update the cortex.yaml to make this entity an incoming\
51+
\ dependency for the `learn-cortex` entity. This will demonstrate the most recent\
52+
\ commit being the source of truth:\n ```\n openapi: 3.0.1\n info:\n\
53+
\ title: My Sandbox Service\n x-cortex-tag: my-sandbox-service\n \
54+
\ x-cortex-type: service\n x-cortex-dependency:\n - tag: learn-cortex\n\
55+
\ ```\n\n- Commit and push your changes to the uat branch:\n ```\n git\
56+
\ add cortex.yaml\n git commit -m \"Add dependency block from uat branch\"\n\
57+
\ git push origin uat\n ```\n\n\n- Confirm that:\n \n - The commit to\
58+
\ the entity in uat was picked up and your new entity is now an incoming dependency\
59+
\ for the learn-cortex entity and passing the rule. \n\n# Relevant documentation\n\
60+
- [Using GitOps in a non-default branch](https://docs.cortex.io/settings/gitops#using-gitops-in-a-non-default-branch)\n"
61+
expression: dependencies.in().length > 0
2662
identifier: 921bc595-5a12-3aa1-af45-e17d17e0d649
2763
weight: 1
2864
level: Completed
29-
failureMessage: |
30-
# About
31-
Describe what the scorecard does.
32-
33-
# Set up
34-
Refer to any existing documentation at https://cortex.io/docs and describe any third party software setup.
35-
36-
37-
# Related Cortex Academy courses
38-
List any related courses available at academy.cortex.io.
39-
40-
# Task
41-
Describe the steps to complete the task here.
42-
43-
44-
# CQL Rule
45-
Explain what the CQL checks.
65+
failureMessage: "# About\nThis scorecard is checking that the incoming dependency\
66+
\ is set to illustrate the most recent commit in the uat branch was successful.\
67+
\ \n\n# Set up\nYou can read a little more about this here - [Using GitOps in\
68+
\ a non-default branch](https://docs.cortex.io/settings/gitops#using-gitops-in-a-non-default-branch)\n\
69+
\n"
4670
filter:
4771
kind: GENERIC
4872
groups:

0 commit comments

Comments
 (0)