-
Notifications
You must be signed in to change notification settings - Fork 6
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
Optimization #28
Optimization #28
Conversation
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.
I answered and resolved the comments on #26 and will get to creating the 2 requested unit tests by professor and create an extra third unit test, then I will then start working on the EDIS poster if all checks pass. |
"Valid File Not Redownloaded"
|
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.
Overall, I think the sentiment is the same here: some of these are interesting changes, but we really want to see a PR that is only the "don't re-download if the file already exists in the filesystem and validates properly".
Please move the other improvements / fixes to other PRs where they can be discussed separately.
hey thank you for listening to, and reading my comments :) |
internal/resource.go
Outdated
// Remove existing file if present | ||
os.Remove(fileName) | ||
|
||
// Create new file with immediate close |
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.
Why the need to do this?
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.
You've marked this resolved but you have not answered my question.
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.
You've marked this resolved but you have not answered my question.
this is not included and has been deleted in the final 1 commit apologies for not communicating that with you raphael, last week in the last few commits i did it was fixed
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.
| this is not included and has been deleted in the final 1 commit apologies for not communicating that with you raphael, last week in the last few commits i did it was fixed
Do you mean that this code was removed? I see it's still very much here.
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.
oh! i was unable to find it in the resource.go when i did the search finder in the go file editor, i could have sworn i removed os.Remove(fileName), i have double checked to not find it in the resource.go file as of today,
let me know which line do you see it on.
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.
wait it moved since i updated it in the previous commits
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.
ive deleted it as its supposed to return the file name it should not remove the file name that would break the code haha your right
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.
Code is still here...
thank you for being patient with this PR, i fixed most of the CI test errors :) |
may i get the CI test to run please, thank you so much and apologies for bugging you i just want to make sure i get my part of the code completed before EDIS |
Hey! after our meeting today i decided to remove and revert some things that we discussed in our meeting today @jsquyres After reverting my code that i did to fix the CI test on lock_test.go and delete_test.go leaving just resource.go and dowload_test.go. I now have the same error that i had before i had made the changes to my code to fix the CI test so that it would pass, now i have a "go test ./cmd -v" error in: FAIL: TestRunDownloadMultipleErrors These were the tests that i had fixed by adding lock_test.go and delete_test.go. I am 100% positive that the CI test will not pass because of this change by deleting the other go files. I am not sure how to proceed further to closing this PR i would like some guidance. @rabadin @jsquyres Thank You!! |
thank you so much for letting me know, i accidentally figured it out while checking the goland ID, i removed it and hopefully the CI test passes now :) best regards |
if this CI test passes i will squash my 30 commits down to one commit hopefully without error |
30dccb6
to
d2e3ce3
Compare
Hello Raphael, Me and Dr.Squyres during our meeting today we figured out the problem with why the commits were not squashing after a bit of troubleshooting, Thanks to Dr.Squyres and his help I managed to get the 35 commits squashed down to 22 commits then 1 commit, all the while preserving the changes in the process. We both have requested a review for this PR on your end to approve this PR for the merge. Best Wishes and Happy Thanksgiving! |
internal/resource.go
Outdated
// Remove existing file if present | ||
os.Remove(fileName) | ||
|
||
// Create new file with immediate close |
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.
You've marked this resolved but you have not answered my question.
internal/resource.go
Outdated
// Remove existing file if present | ||
os.Remove(fileName) | ||
|
||
// Create new file with immediate close |
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.
| this is not included and has been deleted in the final 1 commit apologies for not communicating that with you raphael, last week in the last few commits i did it was fixed
Do you mean that this code was removed? I see it's still very much here.
internal/resource.go
Outdated
// Remove existing file if present | ||
os.Remove(fileName) | ||
|
||
// Create new file with immediate close |
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.
Code is still here...
Right, and what you see is what @rabadin is asking about: you deleted this line: return getUrl(u, fileName, ctx) and replaced it with a bunch of new code. There's no reason to do that on this PR. You can go ahead and remove all that new code from |
@jsquyres not a problem at all, thank you for pointing that out, i was confused so thanks! i managed to delete the code i added and returned the line back to where it was before. |
Minor problem -- it doesn't compile. Can you fix?
|
Still got some compile errors:
|
I think the confusing point here is:
Why? The reason why is because github is effectively making a pretend merge commit from this branch and main, and then doing the compile and running the tests there. That's where the compile fail / test fails are occurring. My suggestion would be to rebase this PR on top of main. Then build and run the tests, and you should see the same failures that CI is showing. |
i am not sure but i hope i fixed the problem that was with the PR, even though the CI test passes i know there will be conflicts which is why i am not sure. |
Conflicts happen when something lands on the target branch that modifies the exact same lines that your change touches. Unless something lands before your PR does, there won't be conflicts. |
@777Denoiser Can you please squash your commits into just one commit? |
I've been trying on my own to squash the 6 commits and I'm having trouble doing it without creating useless commits, I got successful rebase on my end several times and to no luck.. wants to tell you this afters hours of trying... |
if a file is already i the file system and it validates, we do not need to download it again. Update resource.go added comment back to the code Update resource.go removed os.Remove(fileName) which was previously on line 82 Update resource.go deleted my code under the geturltodir function and added the missing line that was requested dont download if file already present if a file is already i the file system and it validates, we do not need to download it again. fixed the too less calls in lock.Download go included a missing boolean value for the lock.Download call. dont download if file already present if a file is already i the file system and it validates, we do not need to download it again. Update resource.go added comment back to the code Update resource.go removed os.Remove(fileName) which was previously on line 82 Update resource.go deleted my code under the geturltodir function and added the missing line that was requested dont download if file already present if a file is already i the file system and it validates, we do not need to download it again. fixed the too less calls in lock.Download go included a missing boolean value for the lock.Download call.
i believe i did it with some trial and error |
- Refactor resource.go code to limit code duplication - Refactor test code to use the same format as the existing tests - Move test code to resource_test.go (since it's testing resource.go) - Improve test coverage Drive-by: fix typo in test file name.
No description provided.