Skip to content

Conversation

@dobrac
Copy link
Contributor

@dobrac dobrac commented Oct 9, 2025

Fix incorrect copy . . handling.

When the COPY . . instruction was used, all files were in the unpacked directory. Because the copy is detected by ls -A | head -n 1 and the parent folder was tmp, invalid decision was done and incorrect folder was copied. Adding a nested folder should fix it as the parent folder will have only one folder, the unpack one.


Note

Fixes COPY handling by unpacking into a nested dir, correctly moving hidden files, and adding debug-logged execution.

  • Build/Copy Command:
    • Unpack into nested /tmp/<hash>/unpack to correctly handle COPY . . root detection.
    • Move directory contents via find ... -exec mv to include hidden files.
  • Logging:
    • Use RunCommandWithLogger with provided logger at zapcore.DebugLevel for the unpack/move step.

Written by Cursor Bugbot for commit 43310cd. This will update automatically on new commits. Configure here.

@dobrac dobrac added the bug Something isn't working label Oct 9, 2025
@linear
Copy link

linear bot commented Oct 9, 2025

@dobrac dobrac marked this pull request as ready for review October 9, 2025 17:23
@dobrac dobrac requested a review from ValentaTomas as a code owner October 9, 2025 17:23
Copy link
Member

@jakubno jakubno left a comment

Choose a reason for hiding this comment

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

Looks good, but could you add a test with polluting /tmp? 🙏🏻

@dobrac
Copy link
Contributor Author

dobrac commented Oct 9, 2025

Looks good, but could you add a test with polluting /tmp? 🙏🏻

there are currently no tests for the copy instruction at all. I would propose to add them in another PR as it requires non-trivial workflow setup

@dobrac dobrac merged commit 352f43a into main Oct 9, 2025
27 checks passed
@dobrac dobrac deleted the fix-incorrect-copy-handling-eng-3145 branch October 9, 2025 22:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants