Skip to content

New step remove sftp file #952

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

Merged
merged 6 commits into from
Jun 13, 2025
Merged

Conversation

gbarat87
Copy link
Contributor

@gbarat87 gbarat87 commented Mar 31, 2025

image

This step is to remove a file from the sftp server.
This is needed as there is no possibility to move a file from a folder to another in the sftp server.
The step "sftp copy file" following by this new one can allows one to move a file around.

@gbarat87 gbarat87 changed the base branch from MOODLE_405_STABLE to MOODLE_401_STABLE March 31, 2025 03:30
@gbarat87 gbarat87 force-pushed the new-step-move-sftp branch 3 times, most recently from 4cdb88d to 69241a1 Compare March 31, 2025 04:09
Copy link
Contributor

@matthewhilton matthewhilton left a comment

Choose a reason for hiding this comment

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

Could this also have unit tests added? e.g. see https://github.com/catalyst/moodle-tool_dataflows/blob/MOODLE_405_STABLE/tests/tool_dataflows_sftp_test.php
Since there's no actual SFTP to test against, it might just end up being a test for 1. sanity check that step loads properly, and 2. testing that source is always a remote, and errors otherwise

@matthewhilton
Copy link
Contributor

matthewhilton commented Apr 1, 2025

Another thought - could this also be added as a flow step just for consistency - you should be able to share most of the functionality with the trait

@gbarat87
Copy link
Contributor Author

gbarat87 commented Apr 9, 2025

@matthewhilton Thank you for the review.
After testing, I ave decided to simply add the step "rename" to allow to rename a file in the sftp server. That is making the move easier.
I decided to keep the delete step as it can be useful as well.
All the methods have been moved to a trait to reuse the same code.

@gbarat87 gbarat87 force-pushed the new-step-move-sftp branch from 323bed9 to e657c3d Compare May 19, 2025 06:06
@gbarat87 gbarat87 force-pushed the new-step-move-sftp branch from e657c3d to c2c4e61 Compare May 19, 2025 07:17
Copy link
Contributor

@matthewhilton matthewhilton left a comment

Choose a reason for hiding this comment

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

Gave this a test locally and works as expected, including field validation (for reference, I used https://hub.docker.com/r/atmoz/sftp)

Just 1 tiny change regarding some lang strings.

Also because we changing the lang strings the version.php needs a bump

@matthewhilton
Copy link
Contributor

Thanks for updating those lang strings @gbarat87 - the CI is failing now because of the php copy paste detector. Honestly i'd be open to disabling it to get the ci green as it isn't super valuable.

@matthewhilton matthewhilton merged commit 893c90a into MOODLE_401_STABLE Jun 13, 2025
23 checks passed
@matthewhilton matthewhilton deleted the new-step-move-sftp branch June 13, 2025 03:53
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