aiidalab / aiidalab-widgets-base

Reusable widgets for AiiDAlab applications
MIT License
6 stars 17 forks source link

Fix .ssh/config file not being closed #513

Closed danielhollas closed 11 months ago

danielhollas commented 11 months ago

Turns out we were not closing the .ssh/config file, which was uncovered by looking at pytest warnings when running unit tests in #509.

Also, the existing parsing logic was very brittle and did not take into account a possible variations (e.g. capitalization, extra white space etc.) So I switched to a proper parser from aiida-core, that we already use in this file anyway. Here's a good page describing the syntax of ssh config file. https://www.ssh.com/academy/ssh/config

I also discovered other possible bugs in the code, left them as TODO for future PRs and opened #516 to track them.

codecov[bot] commented 11 months ago

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.04% :tada:

Comparison is base (2c29a9e) 79.31% compared to head (71fb812) 79.35%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #513 +/- ## ========================================== + Coverage 79.31% 79.35% +0.04% ========================================== Files 27 27 Lines 3834 3837 +3 ========================================== + Hits 3041 3045 +4 + Misses 793 792 -1 ``` | [Flag](https://app.codecov.io/gh/aiidalab/aiidalab-widgets-base/pull/513/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aiidalab) | Coverage Δ | | |---|---|---| | [python-3.10](https://app.codecov.io/gh/aiidalab/aiidalab-widgets-base/pull/513/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aiidalab) | `79.35% <100.00%> (+0.04%)` | :arrow_up: | | [python-3.8](https://app.codecov.io/gh/aiidalab/aiidalab-widgets-base/pull/513/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aiidalab) | `79.39% <100.00%> (+0.04%)` | :arrow_up: | | [python-3.9](https://app.codecov.io/gh/aiidalab/aiidalab-widgets-base/pull/513/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aiidalab) | `79.39% <100.00%> (+0.04%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aiidalab#carryforward-flags-in-the-pull-request-comment) to find out more. | [Files Changed](https://app.codecov.io/gh/aiidalab/aiidalab-widgets-base/pull/513?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aiidalab) | Coverage Δ | | |---|---|---| | [aiidalab\_widgets\_base/computational\_resources.py](https://app.codecov.io/gh/aiidalab/aiidalab-widgets-base/pull/513?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aiidalab#diff-YWlpZGFsYWJfd2lkZ2V0c19iYXNlL2NvbXB1dGF0aW9uYWxfcmVzb3VyY2VzLnB5) | `70.01% <100.00%> (+0.27%)` | :arrow_up: | | [tests/test\_computational\_resources.py](https://app.codecov.io/gh/aiidalab/aiidalab-widgets-base/pull/513?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aiidalab#diff-dGVzdHMvdGVzdF9jb21wdXRhdGlvbmFsX3Jlc291cmNlcy5weQ==) | `100.00% <100.00%> (ø)` | |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

yakutovicha commented 11 months ago

@danielhollas please re-request my review when the PR is ready.