Skip to content

fix: add name for image#109

Merged
ngovinh2k2 merged 1 commit intodevfrom
fix/add-name-for-image
Apr 17, 2026
Merged

fix: add name for image#109
ngovinh2k2 merged 1 commit intodevfrom
fix/add-name-for-image

Conversation

@ngovinh2k2
Copy link
Copy Markdown
Member

What?

Add name for image

Why?

From the request

How?

Testing?

  • Functional Testing
  • Security
  • Performance
  • Error Handling
  • Code Quality
  • Documentation
  • Database
  • Deployment
  • Final Review

Anything Else?

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request renames the keys used for presigned URLs in the authentication and space serializers, moving from the original field names to a 'url_' prefixed format. The reviewer notes that these modifications constitute breaking changes for API consumers and suggests adopting a '_url' suffix (e.g., 'avatar_url' instead of 'url_avatar') to better align with standard REST API naming conventions.

data = super().to_representation(instance)
if instance.avatar:
data["avatar"] = get_presigned_url(
data["url_avatar"] = get_presigned_url(
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

Renaming the key from avatar to url_avatar introduces a breaking change for API consumers who expect the presigned URL in the avatar field. After this change, avatar will contain the raw filename (the "name" mentioned in the PR title). To follow standard REST API naming conventions, it is recommended to use the suffix _url for fields containing links.

Suggested change
data["url_avatar"] = get_presigned_url(
data["avatar_url"] = get_presigned_url(

Comment thread apps/space/serializers.py
data = super().to_representation(instance)
if instance.logo:
data["logo"] = get_presigned_url(
data["url_logo"] = get_presigned_url(
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

This change is a breaking change as the logo field will now return the filename instead of the presigned URL. It is recommended to use logo_url for the link to maintain consistency and follow standard naming conventions.

Suggested change
data["url_logo"] = get_presigned_url(
data["logo_url"] = get_presigned_url(

Comment thread apps/space/serializers.py
)
if instance.build_artifact:
data["build_artifact"] = get_presigned_url(
data["url_build_artifact"] = get_presigned_url(
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

This change breaks backward compatibility for the build_artifact field. Using build_artifact_url is recommended for the presigned URL field to clearly distinguish it from the filename field.

Suggested change
data["url_build_artifact"] = get_presigned_url(
data["build_artifact_url"] = get_presigned_url(

@ngovinh2k2 ngovinh2k2 merged commit 206b701 into dev Apr 17, 2026
1 check passed
@ngovinh2k2 ngovinh2k2 deleted the fix/add-name-for-image branch April 17, 2026 04:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant