Skip to content

feat: don't apply file extension if --rename already contains it - #705

Merged
avirtopeanu-ionos merged 1 commit into
masterfrom
ux/image-upload-rename
Aug 25, 2026
Merged

avirtopeanu-ionos merged 1 commit into
masterfrom
ux/image-upload-rename

Conversation

@avirtopeanu-ionos

Copy link
Copy Markdown
Contributor

if image upload --rename already contains a file extension, don't append the image's file extension.

@avirtopeanu-ionos
avirtopeanu-ionos requested review from a team, adeatcu-ionos, cavramoniu-ionos, cristiGuranIonos, mimihalescu and rmocanu-ionos and a lite review from Copilot and removed request for a team August 19, 2026 09:08
@sonarqubecloud

Copy link
Copy Markdown

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Updates image upload --rename behavior so user-provided rename values that already include the image file extension don’t end up with a duplicated extension, and aligns CLI/docs text and changelog with the new behavior.

Changes:

  • Add applyRename helper to append an image extension only when the rename value doesn’t already end with it (case-insensitive).
  • Update image upload CLI flag help text and the generated docs to reflect the new rename/extension behavior.
  • Add unit tests covering applyRename edge cases and document the fix in the changelog.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
docs/subcommands/Compute Engine/image/upload.md Updates --rename help text to explain non-duplication of extensions.
commands/compute/image/upload.go Uses applyRename to avoid doubling extensions when building upload names/paths.
commands/compute/image/upload_test.go Adds test coverage for applyRename (including case-insensitive matching).
CHANGELOG.md Documents the fixed behavior for image upload --rename.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@avirtopeanu-ionos
avirtopeanu-ionos merged commit 26aa9f0 into master Aug 25, 2026
13 checks passed
@avirtopeanu-ionos
avirtopeanu-ionos deleted the ux/image-upload-rename branch August 25, 2026 07:21
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.

2 participants