-
Notifications
You must be signed in to change notification settings - Fork 275
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
Removed duplicate functions in TUF #804
Conversation
@tobithegreat, would you like to look through and see where the tests failed as a result of this PR? The automated testing / continuous integration we use helps identify possible issues with new pull requests. You can see on this page that the builds running the tests failed, and click Details (I'd look at the Travis results to start.) to see what happened. Sometimes code changes necessitate test changes -- for example, there may be test functions that test pieces of code that are no longer necessary and were removed -- and sometimes test failures indicate that there is a mistake and something was broken. It should help to know that you can run the TUF tests locally by running |
Thanks, will do! |
@awwad sorry to bother, but I'm having trouble running the tests locally. Upon running
I suspect this has to do with my file hierarchy, or some directory referencing error? |
Have you installed tuf?
pip install -r dev-requirements.txt
(from main repo directory)
…On Sat, Nov 17, 2018 at 07:51 Oluwatobi Popoola ***@***.***> wrote:
@awwad
<https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_awwad&d=DwMFaQ&c=slrrB7dE8n7gBJbeO0g-IQ&r=lmb4ogFqgMptuKWQok14rSU0yJ3xUDL7l3ttC3XYeMw&m=TDcSTJRuNI5ZvNxAx0mxnCxUMlZo8yHmkfDrHrT2en0&s=WxkP4YmqJt0japoPBt4bVtrTMgms7uvOO-upCzebUmM&e=>
sorry to bother, but I'm having trouble running the tests locally. Upon
running test aggregate_tests.py from within the tests directory, I
receive an ImportError. Stacktrace below:
Oluwatobis-MBP:tests oluwatobipopoola$ python aggregate_tests.py
Traceback (most recent call last):
File "aggregate_tests.py", line 93, in <module>
suite = unittest.TestLoader().loadTestsFromNames(test_modules_to_run)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/unittest/loader.py", line 130, in loadTestsFromNames
suites = [self.loadTestsFromName(name, module) for name in names]
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/unittest/loader.py", line 91, in loadTestsFromName
module = __import__('.'.join(parts_copy))
File "/Users/oluwatobipopoola/Desktop/tuf/tests/test_slow_retrieval_attack.py", line 59, in <module>
import tuf.log
ImportError: No module named tuf.log
I suspect this has to do with my file hierarchy?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_theupdateframework_tuf_pull_804-23issuecomment-2D439614379&d=DwMFaQ&c=slrrB7dE8n7gBJbeO0g-IQ&r=lmb4ogFqgMptuKWQok14rSU0yJ3xUDL7l3ttC3XYeMw&m=TDcSTJRuNI5ZvNxAx0mxnCxUMlZo8yHmkfDrHrT2en0&s=y-w9M_QeqyMwcy7oB8AMvqIGqHOk4YBYiukfDNdsjMM&e=>,
or mute the thread
<https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_AMpkOA8-2DLaEbwToelOOuOlKBjuiLdVCEks5uwAZQgaJpZM4YfmrW&d=DwMFaQ&c=slrrB7dE8n7gBJbeO0g-IQ&r=lmb4ogFqgMptuKWQok14rSU0yJ3xUDL7l3ttC3XYeMw&m=TDcSTJRuNI5ZvNxAx0mxnCxUMlZo8yHmkfDrHrT2en0&s=MCohhHOGqkoOEtKUas7DGCwNKHjDpMuefMzWG4U7yc4&e=>
.
|
Ah, thank you. I had, but on a different computer than the one my local repo was on. Thanks! |
This latest commit updates all unit tests to reflect removal of duplication code. Apparently, one of the AppVeyor build jobs failed. Environment: PYTHON=C:\Python27, PYTHON_VERSION=2.7, PYTHON_ARCH=32 Error:
Not sure how to deal with this error. |
I re-ran the build and it passed. I think that was an unusual build error, and I'll keep an eye out for it if it happens again. Thanks for taking a look. I'll review this PR shortly. :) |
The commit history is a bit hard to read: See the three upstream-to-local merge commits Those merges happen when you pull from the repository. I advise instead fetching (
In this case, here's how I might go about fixing the PR (without creating a new one): git checkout develop
git rebase tuf/develop
git rebase --continue
git push tobithegreat develop --force Note that those names are based on this remote listing: git remote -v
...
tobithegreat https://github.com/tobithegreat/tuf (fetch)
tobithegreat https://github.com/tobithegreat/tuf (push)
tuf https://github.com/theupdateframework/tuf (fetch)
tuf https://github.com/theupdateframework/tuf (push) If any of that doesn't make sense to you, please feel free to ask about it! |
When that's fixed, this looks good to me. Did you see any other functions that could be replaced by securesystemslib features? |
@awwad Wow, thanks for all the feedback! I'll be sure to make these changes. Also, I updated a few lines in the test cases, that caused errors unrelated to my changes. Please let me know if this change was mistaken! |
However, |
My mistake! Here is the exact error:
And I'm happy to see if it can be replaced. |
As @awwad has mentioned, we are currently working on git history lab guidelines. @tobithegreat, it would be awesome if you could take a look at the work-in-progress document and tell us if it is helpful as it is, or if it would need some more information. You can make comments in the corresponding PR (secure-systems-lab/lab-guidelines#14). |
Hello again!
|
No; you can see the git history in the commits page here, with (roughly) the same merge commits. I can't really say what went wrong without more information, though I have guesses.... Can you send me the output of these commands?
I assume the output of |
Output of
Some of the output from
|
|
Signed-off-by: Oluwatobi Popoola <oluwatobipopoola@Oluwatobis-MBP.home>
Signed-off-by: Oluwatobi Popoola <oluwatobipopoola@Oluwatobis-MBP.home>
30f9561
to
7dfae4e
Compare
Thanks! |
Good and bad news. 😄 The one test that failed on AppVeyor was a fluke I'm familiar with, so I restarted it and it succeeded. (A server didn't start up on AppVeyor within the 3s expected window.... I should adjust those subprocess calls to wait for some flexible period of time, but that's not related to this. 😄 )
There are meaningful errors in the Travis-CI build, though. Travis-CI is running pylint and that is complaining that there are calls in When you add that commit (if you want to), make sure to use an expressive commit message. |
880391d
to
4babf7b
Compare
Finished the commit and fixed the tests, but it was signed off incorrectly. Sorry to ask again, but is there an efficient way to correct the commit without clogging up the history again? |
a254951
to
4963816
Compare
Ran those commands and force pushed once again. This time is states that the DCO is missing. Really sorry about this, if there's something very obvious I am not seeing. |
Methods that essentially duplicated the methods available in `securesystemslib` were removed. Four methods were deleted. These methods were: * generate_and_write_rsa_keypair * generate_and_write_ed25519_keypair * import_rsa_publickey_from_file * import_ed25519_publickey_from_file Signed-off-by: Sebastien Awwad <sebastien.awwad@gmail.com>
Methods that essentially duplicated the methods available in `securesystemslib` were removed. Four methods were deleted. These methods were: * generate_and_write_rsa_keypair * generate_and_write_ed25519_keypair * import_rsa_publickey_from_file * import_ed25519_publickey_from_file Signed-off-by: Oluwatobi Popoola <popoolatobi@gmail.com>
((Meta: DCO sign-off requirements for every contributor for every commit are becoming a nuisance.... It'd be nice to be able to satisfy the checks sometimes by just signing off on the merge of the PR.... These sign-off requirements are part of CNCF best practices, though.)) @JustinCappos: this makes for difficult pedagogy. I don't know if it's reasonable to expect students to deal with this level of history editing in git, so I'm curious to know what you think. Note that once there's a commit missing a sign-off, the commit history has to be changed if we want to satisfy the DCO bot, whether by squashing, rebasing, etc. (Edit: I suppose we could instead tell people they have to create a fresh PR, but that's pretty awful.) |
Thanks very much for your assistance. |
Closing in favor of an updated version of this PR in #919. Thanks for the efforts! |
Signed-off-by: Oluwatobi Popoola popoolatobi@gmail.com
Please fill in the fields below to submit a pull request. The more information
that is provided, the better.
Fixes issue #: 656
Description of the changes being introduced by the pull request:
Removed functions that did not expand functionality to equivalent functions in securesystemslib.
Please verify and check that the pull request fulfills the following
requirements: