-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
Support fileMode fileOwnership in create migration #18676
Support fileMode fileOwnership in create migration #18676
Conversation
rhertogh
commented
May 23, 2021
Q | A |
---|---|
Is bugfix? | ❌ |
New feature? | ✔️ |
Breaks BC? | ❌ |
Tests pass? | ✔️ |
Fixed issues | yiisoft/yii2-docker/issues/15 |
…ller and BaseFileHelper
…` of the MigrateController
…_file_mode_and_owner_in_create_migration
…FileOwnership to reflect the scope of the settings
Are you sure you've specified correct issue number? |
You mean the 'Fixed issues'? Yes, I had the same problem when the migration was created inside a Docker container and the file is edited on the host (mounted via WSL2 on Ubuntu) changes can't be written to the file. |
…ontroller and BaseFileHelper::changeOwnership()
Co-authored-by: Bizley <[email protected]>
…hip` in BaseMigrateController
Changing mode is pretty straight forward, but maybe this could be added indeed as a bonus to this new method (so more like a |
…_file_mode_and_owner_in_create_migration
…n changing ownership or mode fails
I've added the |
Working on unit test |
…_file_mode_and_owner_in_create_migration
…stChangeOwnershipInvalidArguments() in FileHelperTest since setup() hasn't run yet when data provider is called.
This reverts commit a574908.
…ship() when not run as root()
This reverts commit 2e1ea0f.
…nsion is not loaded
…nsion is not loaded (this time actually when it's NOT loaded)
Unit tests are added. Some require root user to complete. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some code style, rest LGTM
Fixed code style and spelling based on feedback from @bizley Co-authored-by: Bizley <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While porting this change to my own migration extension I've noticed that getmyuid()
and getmygid()
returning not the ids of the current user and user's group but rather the ids of the running script owner. So this needs to be changed (proposed here). Also noticed few more exception messages adjustments.
Getting correct uid and gid from user thanks to @bizley Co-authored-by: Bizley <[email protected]>
👍 |
…nership()` and properties `newFileMode`/`newFileOwnership` in `yii\console\controllers\BaseMigrateController` Co-authored-by: Bizley <[email protected]>