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

Move new files filtering to earlier #29

Merged
merged 10 commits into from
Oct 16, 2019
Merged

Conversation

pivnicek
Copy link
Contributor

@pivnicek pivnicek commented Oct 7, 2019

fixes #28

@pivnicek pivnicek requested a review from eddycek October 7, 2019 15:30
@pivnicek
Copy link
Contributor Author

pivnicek commented Oct 7, 2019

Hi @eddycek

This is a little PR to apply the new file filtering during the preparation step.

I was wondering if it wouldn't make sense also to apply this filter before the glob filter (since that is what I think takes the most time https://github.com/keboola/ex-ftp/blob/master/src/FtpExtractor.php#L129). I was looking at the job log and it took 26 sec for the prepare 10 files step and I think the glob validator may be the culprit, so reducing the amount of files we send to that loop could be helpful. Anyhow, just a couple thoughts. cheers.

@eddycek
Copy link
Member

eddycek commented Oct 7, 2019

Hi @pivnicek

The idea of applying this filter before the global comes to me as a good idea.
@yustme, what do you think about that?

Copy link
Member

@eddycek eddycek left a comment

Choose a reason for hiding this comment

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

lgtm

@pivnicek
Copy link
Contributor Author

pivnicek commented Oct 7, 2019

Thanks @eddycek , I'll add it and we can always take it or leave it :-)

@pivnicek
Copy link
Contributor Author

pivnicek commented Oct 8, 2019

huh, I think I've found a bug. I'm going to add a newFilesOnly test or two.

@pivnicek
Copy link
Contributor Author

pivnicek commented Oct 8, 2019

heh, not a bug in the original, but I think I created one :-). almost got it sorted.

@eddycek
Copy link
Member

eddycek commented Oct 10, 2019

@pivnicek What's the problem?

@pivnicek
Copy link
Contributor Author

ah, I seem to have forgotten about this :-) The main issue is that the shouldBeFileUploaded method https://github.com/keboola/ex-ftp/blob/master/src/FileStateRegistry.php#L40 doesn't just check whether the file should be uploaded, but prepares the output state also. So applying this before the glob means the glob filtered files may still end in the output state.

I would like to change it into 2 methods: isNewFile and prepareOutputState. I'll get to it shortly :-)

@eddycek
Copy link
Member

eddycek commented Oct 10, 2019

@pivnicek oh, it really looks it must be splitted 👍

@pivnicek pivnicek force-pushed the piv-better-newfiles-filtering branch from b081d9f to 1ad8b42 Compare October 14, 2019 10:59
@pivnicek pivnicek requested a review from yustme October 14, 2019 15:35
@pivnicek
Copy link
Contributor Author

I added new tests, and they're passing locally, but the test where I add a file on the fly is not working on travis :-/ https://travis-ci.com/keboola/ex-ftp

@pivnicek pivnicek requested a review from eddycek October 14, 2019 16:00
@eddycek
Copy link
Member

eddycek commented Oct 15, 2019

I added new tests, and they're passing locally, but the test where I add a file on the fly is not working on travis :-/ https://travis-ci.com/keboola/ex-ftp

@pivnicek strange error, did you try to restart the build?

@pivnicek
Copy link
Contributor Author

it fails consistently, but I see why now. docker-compose run --rm app composer ci fails (like on travis), but docker-compose run --rm dev composer ci passes. So I should resolve it shortly.

@pivnicek
Copy link
Contributor Author

I added the volume mapping for the testfile dir to the app service and it passes now. but nejsem jistej

Copy link
Member

@eddycek eddycek left a comment

Choose a reason for hiding this comment

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

just a few things

tests/functional/DatadirTest.php Show resolved Hide resolved
tests/functional/DatadirTest.php Outdated Show resolved Hide resolved
docker-compose.yml Show resolved Hide resolved
@pivnicek pivnicek requested a review from eddycek October 16, 2019 10:20
Copy link
Member

@eddycek eddycek left a comment

Choose a reason for hiding this comment

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

👍

@pivnicek
Copy link
Contributor Author

Thanks @eddycek 🍻

@pivnicek pivnicek merged commit 348fe61 into master Oct 16, 2019
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.

Move "New Files" filtering to earlier
2 participants