Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: playbook files permission mode incompatible with Windows #4740

Conversation

wendrul
Copy link
Contributor

@wendrul wendrul commented Nov 18, 2024

Important

Fix file permission setting in write_file_at_user_defined_location() for Windows compatibility by adding conditional compilation.

  • Behavior:
    • In write_file_at_user_defined_location() in worker.rs, added conditional compilation to handle file permission setting.
    • On Unix, uses std::os::unix::fs::PermissionsExt::from_mode() to set file permissions if mode is provided.
    • On Windows, logs an error if mode is provided, as setting file permissions is not supported.
  • Misc:
    • Added #[cfg(unix)] and #[cfg(windows)] to separate Unix and Windows-specific code paths.

This description was created by Ellipsis for 01af6ce. It will automatically update as commits are pushed.

@wendrul wendrul requested a review from rubenfiszel as a code owner November 18, 2024 19:18
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot 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 to me! Reviewed everything up to 01af6ce in 39 seconds

More details
  • Looked at 23 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. backend/windmill-common/src/worker.rs:241
  • Draft comment:
    Consider providing more context in the error message, such as suggesting alternative ways to set file permissions on Windows.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The PR addresses a platform-specific issue by using conditional compilation to handle file permissions differently on Unix and Windows systems. This is a good approach, but the error message on Windows could be more informative.

Workflow ID: wflow_sMiRtGweEfO23Q8m


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Copy link

cloudflare-workers-and-pages bot commented Nov 18, 2024

Deploying windmill with  Cloudflare Pages  Cloudflare Pages

Latest commit: 1a01dc6
Status: ✅  Deploy successful!
Preview URL: https://5e19770e.windmill.pages.dev
Branch Preview URL: https://win-672-fix-windows-not-acce.windmill.pages.dev

View logs

@rubenfiszel rubenfiszel merged commit 4d9ec90 into main Nov 18, 2024
4 checks passed
@rubenfiszel rubenfiszel deleted the win-672-fix-windows-not-accepting-permission-mode-for-ansible-files branch November 18, 2024 21:14
@github-actions github-actions bot locked and limited conversation to collaborators Nov 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants