When using GitOps, the Cortex YAML linter validates each cortex.yaml file on its own. If you create a new entity and, in the same pull request, add a relationship that points to that entity, the linter may warn that the referenced entity does not exist—even though it is being created in the same PR.
This warning is informational and does not prevent ingestion after merge.
What you’ll see
In a PR that:
- Adds a new entity, and
- Defines a relationship to or from that entity in the same PR,
the linter may show messages like:
Relationship references non-existent entity
<tag>
even though that entity is defined in another file in the same PR.
Why this happens
- The YAML linter checks each file individually and does not look at other files in the PR.
- Because of that, it cannot “see” entities that are created or updated in other files in the same PR, so it temporarily treats those references as missing.
Is it safe to merge?
Yes. If the only issue is this “entity does not exist”–style warning, you can merge the PR. After merge:
- The new entity is created.
- The relationship that references it is processed and will work as expected.
Recommended ways to work
You can choose either approach:
- Single PR (simpler)Create the entity and define its relationships in the same PR. Ignore the “entity does not exist” warning as long as you know the referenced entity is being added in that PR.
- Two-step PRs (no warning)
- First PR: create the new entity without relationships.
- Second PR: once the entity exists in Cortex, add relationships that reference it.
Both patterns are supported, and the choice depends on whether you prefer fewer warnings or fewer PRs.