Conversation
|
Hmm, having some issues uploading the coverage it seems... The tests pass! Trust me 😉 . I'll try re-running in a bit. Update: Aw heck, now the other one is failing to check the code out. Maybe github is having issues at the moment. |
sros2/sros2/api/__init__.py
Outdated
| domain_id = os.getenv(DOMAIN_ID_ENV, '0') | ||
| relative_path = os.path.normpath(identity.lstrip('/')) | ||
| key_dir = os.path.join(keystore_path, KS_CONTEXT, relative_path) | ||
| key_dir = os.path.join(_keystore.keystore_context_dir(keystore_path), relative_path) |
There was a problem hiding this comment.
Since we're refactoring everything anyway, would it make sense to sub in pathlib for readability?
There was a problem hiding this comment.
That's the thing though-- we're not actually refactoring anything here. That would require a more in-depth review and this simple re-organization can already be a pretty significant diff to look through. As it stands I can promise that no meaningful changes were made, which makes review a bit faster assuming the reviewer trusts me. Once this re-organization is finished, we can do all sorts of things (including changing to pathlib) without breaking API, so that isn't time-sensitive.
ruffsl
left a comment
There was a problem hiding this comment.
Nice, I was disliking that long file. Just built and ran this locally on osrf/ros2:nightly and all seems well.
These seem to be more of a github actions issue than a github outage issue... hopefully most of these issues will be fixes by #189 🤞 Otherwise just amending you commig would make this a new workflow run and work around the issues related to "rerunning a failed workflow" |
mikaelarguedas
left a comment
There was a problem hiding this comment.
Thanks for starting the refactor !
History should be preserved when refactoring. Right now all history is lost making it hard to use blame to get more info about a particular piece of code
General question: the new modules are prefixed with _, does that make them private?
In these (private?) modules some functions are private and some public, what does that make them ? all private?
360c245 to
c1069d4
Compare
Codecov Report
@@ Coverage Diff @@
## master #188 +/- ##
==========================================
+ Coverage 53.38% 54.76% +1.38%
==========================================
Files 12 14 +2
Lines 562 577 +15
Branches 52 52
==========================================
+ Hits 300 316 +16
+ Misses 248 247 -1
Partials 14 14
Continue to review full report at Codecov.
|
Yes, although given that nothing is truly private in python, these are simply "non-public". It's simply a way of telling users what we're promising to maintain through a release and what might change.
It's the same public/non-public idea applied to the module. Underscore-prefixed things are intended for use within the module. Ideally such things would be able to change without needing to change any callers (other than the occasional test). The non-underscore-prefixed functions are intended for use outside of the module (e.g. by verbs). We could be using Anyway, in this PR the modified verbs are now using non-public API. That's okay because they're in the same package, and even the non-public modules have their own public/non-public API nicely defined. This comes in handy when it comes to external packages using the SROS2 API: this PR makes the keystore stuff all non-public, because the |
c1069d4 to
300435a
Compare
Sounds good to me 👍 Looks like the splitting with history didn't succeed, if I try to git blame the file I dont see the commits before the split: https://github.com/ros2/sros2/blame/300435a668e02bfa0118a2302621d169799afe06/sros2/sros2/api/_keystore.py I was more expecting something like https://github.com/mikaelarguedas/sros2/blame/split-with-history/sros2/sros2/api/_keystore.py. I can push a version with fixed history on this branch if you want |
Signed-off-by: Kyle Fazzari <kyle@canonical.com>
Signed-off-by: Kyle Fazzari <kyle@canonical.com>
Signed-off-by: Kyle Fazzari <kyle@canonical.com>
Signed-off-by: Kyle Fazzari <kyle@canonical.com>
Signed-off-by: Kyle Fazzari <kyle@canonical.com>
…i-clean-keystore-keystore' into feature/api-clean-keystore
300435a to
064fb08
Compare
Thank you-- sadly it wasn't that easy!
Indeed, that was a lot harder than it should have been, but I think I finally got it. Blames look way better now, no special flags needed. |
mikaelarguedas
left a comment
There was a problem hiding this comment.
looks much nicer 👍, thanks for iterating
Signed-off-by: Kyle Fazzari <kyle@canonical.com>
|
Hmm, something broke here again @mikaelarguedas, any ideas? |
Yes this is the same breakage as the daily sros2 builds that we mentioned on matrix. Issue is outside this repo, a workaround has been pushed and this is now fixed TL;DR: |
We don't currently have a nicely controlled/organized API: everything is implemented in the api's
__init__.py, making is way longer than it needs to be, and most is public without needing to be, which makes it hard to change once we release. This PR starts the process of resolving that by extracting the keystore API into its own succinct, non-public module. In the end we'll hopefully have a tight, small public API to maintain.Note that this introduces no behavioral changes, it's just moving code around.