Skip to content

Conversation

@solababs
Copy link
Contributor

No description provided.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 19, 2025

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions bot added the group/backend Issue related to the backend (API Server, Git Agent) label Nov 19, 2025
@codspeed-hq
Copy link

codspeed-hq bot commented Nov 19, 2025

CodSpeed Performance Report

Merging #7683 will not alter performance

Comparing sb-20251119-graphql-response-for-metadata-ifc-1940 (0692ff0) with develop (fa5d94c)

Summary

✅ 12 untouched


async def _build_meta_response(self, db: InfrahubDatabase, field_name: str, fields: dict) -> dict:
data = {}
for meta_field in fields.get(field_name).keys():
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like it could potentially be problematic if fields.get(field_name) were to return None and we then call .keys() on None. It might be that within this context it should never happen. But in the function signature we don't have any type of guarantee that this would be the case. Is there something we can change around this?

data[meta_field] = peer.id if peer else None
continue

if meta_field_data is not None and isinstance(meta_field_data, str):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can skip both of the meta_field_data is not None checks here as we're already checking the variable with isinstance. I.e. if it's a string or a RelationshipManager it will never be None.


class BaseAttribute(ObjectType):
class InfrahubAttributeMetaObject(ObjectType):
updated_by = String(required=False, description="UUID of the user that last modified the attribute or relationship")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small comment here regarding the UUID. I think that Aaron had a hardcoded user with the name -system- or similar. Not sure if we want to mention something like that in these descriptions? As it's just a description and not a strict type other systems wouldn't expect there to always be a UUID behind this response.

This is more of an observation, and I'm not sure about the correct approach if we should just leave it as it is now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

group/backend Issue related to the backend (API Server, Git Agent)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants