Catalog - Add Status in Known allowed fields
π Issue Labels
- [x] Please familiarize yourself with the issue labels used in this project: LABELS.md
π Search Terms
Catalog, policy, status
ποΈ Project Area
Catalog
π Need
Add in status to known fields within NoForeignRootFieldsEntityPolicy as work to add support for status to entities. Currently due to this hard coded policy the status field cannnot be used at all. Though there is use of it inside the catalog itself HERE, so not sure how exactly that works in allowing those thru.
π Proposal
Though the proposal for status is still alpha feature and still needs alot of work done, currently the NoForeignRootFieldsEntityPolicy doesn't allow for the use of status within the root entity due to it not being included in defaultKnownFields array. Am I please able to add status to this array of allowed fields so that we can allow for users who want to to start using statuses in their entities. ( like me ;) )
π Alternatives
No response
Have you read the Code of Conduct?
- [x] I have read the Code of Conduct
Are you willing to submit a PR?
Yes, and I have enough information to get started
We would also love to see support for this for our use case π
The documentation led us to believe an entity with a status field could be ingested, but alas no.
Would love to see some support for this as well. π Dealing with this exact problem right now
PR is up to add in support for the status field. If we don't want to allow it in use for what ever reason, we probs need to remove it from the docs as it does say you are allowed to use it DOCS as is kinda confusing bc you actually can't bc of this policy
@pguppy @dknz2008 @dme-rea Might I ask what your more exact use cases are? We'd like to understand what it is that you are trying to achieve before knowing where to best move with this ask.
For example, letting users put these statuses in yaml files makes very little sense. This was meant as a signalling mechanism for code running inside the engine and there are lots of other places in the payload where people can put different types of info. Like for example spec.lifecycle, would that then instead be considered a status instead? Probably not, right? So getting some strict semantics going here is paramount.
The particular use that I was hoping to use this for was that I have made a new entity provider to create entities from a new data source. The API that we use to get the information of these entities also includes a bunch of status checks in that api that we would like to keep in the catalog along with the metadata. These status checks aren't exactly something that change often and so don't really need seperate integration to query on the fly from the frontend, say when the user goes to the override page. Thought that the status field would be a good use case for these and I am still actually using it it's just under the 'spec' field for now.
Our use case is as follows:
We have an system pulling user and group (org hierarchy) data from an internal HR system and transforming this data into backstage entity yaml files.
There are cases where certain required data are missing in the source system, or errors occur during transformation such that these groups should be considered somewhat invalid or incomplete when loaded into backstage. This needs to be flagged to the end user in backstage when viewing that group page.
Capturing one or more of these errors in the status field allows them to be shown automatically on the entity page using the existing <EntityProcessingErrorsPanel> component.
Our current workaround is:
- Store the
statusdata withinmetadata - In a catalog processor (post process) move
metadata.status-->status
@pguppy Feel free to explore metadata.labels or metadata.annotations as well for this.
@dme-rea I wonder if this actually is so core to the thing at hand, that it should be in the spec - or, if those entities should be in a dead letter queue somewhere and surfaced so they can get fixed over time. One thing I'm thinking about is, is the information actionable for the end user (the consumer of that API, or the users of the Backstage interface)? Or should it be surfaced in a more clandestine way directly to those in power to change it?
Hi @freben
One thing I'm thinking about is, is the information actionable for the end user (the consumer of that API, or the users of the Backstage interface)?
For this specific use case, yes - it's actionable by the end user. It's basically a call-to-action for them to get their house in order if they want the entity to display correctly in Backstage.
Until we have some other notification mechanism, using the status field (and the associated automatically displayed error dialogs) are going to be an ideal way for us to let end users know if there are any actions they need to take to get specific entities ingested correctly.
Found in team's triaging this morning. I donβt believe this issue has scaled enough yet, so it doesn't mandate the proposed solution at this time. We may reconsider in the future, thank you again for raising.
my use case for this is described in the attached diagram.
we have an external system that stores declarative configuration that is conveniently in the shape of an entity. there is automation that uses this declarative configuration to then provision external resources. the outputs of this automation are persisted in the external system. backstage will use these outputs for various things.
Implementation wise on the backstage side of things, I'm pretty open to solutions here. It seems simplest to allow EntityProviders to populate the .status.items[] in a way that supports this use case (following the pattern kubernetes made mainstream with imperative outputs / observed state being in the status block).
@steven-terrana If I understand things correctly, that's one of those cases where we would discourage putting it in the entity. It'd amount to cloning information for little value; it adds risk and complexity and data delays and consistency concerns, when instead a direct request on-demand to the external system could fetch realtime, up-to-date info without involving the catalog. This is what we do for the majority of things; for example the continuous deployment system doesn't store data in entities; entities contain an app identifier that then can be used for fetching deployment info directly from the continuous deployment system.
Sorry if I misinterpreted the use case.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.