Skip to content

fix(update-checker): check that command files are executable by default - #100

Merged
stasadev merged 4 commits into
ddev:mainfrom
codebymikey:20250327_codebymikey_executable_commands
Apr 8, 2026
Merged

stasadev merged 4 commits into
ddev:mainfrom
codebymikey:20250327_codebymikey_executable_commands

Conversation

@codebymikey

@codebymikey codebymikey commented Mar 27, 2026 •

Copy link
Copy Markdown
Contributor

The Issue

Command files should be executable by default

How This PR Solves The Issue

Checks that command files are executable by default.

Manual Testing Instructions

Inside a DDEV addon:

# Create simple non-executable command files
mkdir commands/host/
touch commands/host/{.,_}include-scripts commands/host/non-executable-command

curl -fsSL https://raw.githubusercontent.com/codebymikey/ddev-addon-template/refs/heads/20250327_codebymikey_executable_commands/.github/scripts/update-checker.sh | bash

Automated Testing Overview

N/A

Release/Deployment Notes

N/A

@codebymikey
codebymikey marked this pull request as ready for review March 27, 2026 15:15
@rfay

rfay commented Mar 27, 2026

Copy link
Copy Markdown
Member

The actual reality... I'm not sure that these have to be executable any more, I think DDEV executes them with bash directly, so that means that DDEV's actual code to make them executable (which is what annoyed you) may be obsolete.

@codebymikey

Copy link
Copy Markdown
Contributor Author

Wasn't aware of that. If that's the case, then I'll just close this then.

@rfay

rfay commented Mar 27, 2026

Copy link
Copy Markdown
Member

Well, I'm not 100% sure. But you might fiddle with DDEV a bit to remove the chmod and see if everything still works.

@rfay rfay reopened this Mar 27, 2026
@codebymikey

Copy link
Copy Markdown
Contributor Author

I ran into the executable bit issue whilst running the latest DDEV (v1.25.1).

But if the eventual plan is for a future update to stop it from automatically marking files as executable, then I'm all for that, as that seems a bit safer, and ensures the commands are only executable within the DDEV context.

It might break some workflows if they rely on DDEV automatically making the addon commands executable, but I think it's a worthwhile goal.

Do you know the PR/issue where this was discussed/implemented?

The only way I can see it working without the executable bit is to extract the shebang, then run the command file against it (not sure if there'll be any quirks with doing this manually vs letting the shell do it for you).

@rfay

rfay commented Mar 28, 2026

Copy link
Copy Markdown
Member

I was wrong about this whole thing, the executable bit is required, and that's why DDEV sets it. Your evaluation of the need here is correct.

Comment thread .github/scripts/update-checker.sh Resolved

@stasadev stasadev left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you!

@stasadev
stasadev merged commit 2945a79 into ddev:main Apr 8, 2026
2 checks passed
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.

3 participants