#1284 Add a way for a user to know why their component wasn't reused
Opened 4 years ago by mprahl. Modified 4 years ago

Based on the conversation in #1274, it's difficult for a user to know why their component wasn't reused. MBS currently logs the reason, so we should just expose that reason to the user in the JSON API, and then have it be shown in the MBS UI as well for convenience.

I see a couple of options forward for this. We could add a separate column in the database that stores the reason that the component couldn't be reused. We could instead add an additional state to the state_trace when the component can't be reused, then the JSON API can return a dynamic field called no_reuse_reason from this value.

Additionally, we should add a log message in get_reusable_component to state which component is being checked. It's hard to determine that in the logs currently.


@mprahl, @mcurlej, can we discuss that on some short call today?

I personally think that some user-facing logs provided by MBS with these information would be better long-term solution than solution just for this particular issue. I think using state and state_reason for this would be an overuse of that field and can easily lead to state when we just add more and more things there (without any pagination in API btw).

It would be beneficial for both users and developers if there would be per ModuleBuild and per ComponentBuild log entries with important data stored in DB. I have no idea what overhead of that would be. We can for now store just the component reuse data there at beginning, so there's no extra overhead, but the API would be ready for new additions - it would support pagination and wouldn't be hidden in "state".

Login to comment on this ticket.

Metadata