Skip to content

Conversation

Lirt
Copy link

@Lirt Lirt commented May 2, 2025

Exceptions related to netplan parse or validate operations are supposed to throw error and return proper error code.

Resolves/Closes https://bugs.launchpad.net/netplan/+bug/2104373

Description

Described in launchpad issue.

Checklist

  • Runs make check successfully. --> Not successful
  • Retains code coverage (make check-coverage). --> Not successful
  • New/changed keys in YAML format are documented.
  • (Optional) Adds example YAML for new feature.
  • (Optional) Closes an open bug in Launchpad. LP#2104373

@Lirt
Copy link
Author

Lirt commented May 2, 2025

Still in WIP. Working on executing local tests.

Exceptions related to netplan parse or validate operations are supposed to throw
error and return proper error code.

Resolves https://bugs.launchpad.net/netplan/+bug/2104373

Signed-off-by: Ondrej Vasko <ondrej.vaskoo@gmail.com>
@Lirt Lirt force-pushed the bug/exit-on-netplan-parse-error branch from d4ca613 to ddcd795 Compare May 5, 2025 07:53
Lirt added 3 commits May 15, 2025 03:48
Signed-off-by: Ondrej Vasko <ondrej.vaskoo@gmail.com>
Signed-off-by: Ondrej Vasko <ondrej.vaskoo@gmail.com>
- With virtualenv pyflakes and coverage have different names
- Explicitly name pyflakes directories to check. Alternative could be
  using flake8
- Skip codestyle check for .venv and build

Signed-off-by: Ondrej Vasko <ondrej.vaskoo@gmail.com>
@Lirt
Copy link
Author

Lirt commented May 15, 2025

Legacy tests in my setup are failing like this. Is this my problem of my environment, or long-term issue?

13/21 legacy-tests             FAIL             0.24s   exit status 1
―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― ✀  ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
stderr:
Traceback (most recent call last):
  File "/home/ttrilf/Projects/netplan/tests/cli_legacy.py", line 28, in <module>
    from tests.test_utils import MockCmd
ModuleNotFoundError: No module named 'tests.test_utils'

coverage-c and coverage-py are failing locally, but I don't think this is problem of this PR.

Signed-off-by: Ondrej Vasko <ondrej.vaskoo@gmail.com>
@Lirt
Copy link
Author

Lirt commented May 15, 2025

Memory sanitizer is failing

Command failed: _leakcheckbuild/fakeroot/etc/netplan/openvswitch.yaml: Error in network definition: bond0: The 'ovs-vsctl' tool is required to setup OpenVSwitch interfaces.

Again I don't think there is change in this MR that could cause this. Pipeline in main branch passed fine and this PR is rebased on main.

@Lirt
Copy link
Author

Lirt commented May 15, 2025

Hello,

I need help with this PR. Either something is wrong with CI, or adding sys.exit() on critical validation exceptions (as agreed in launchpad) reveals that there is a lot of untested code (because coverage dropped significantly).

Some pipelines fail due to unrelated errors (see #551 (comment)).

Unit tests are passing well locally. Not in CI.

I'm new netplan contributor. The setup for this repository is quite unhandy. For example - why does the project lack requirements.txt or some way to list python packages possibly with pinned version (to avoid breaking changes)? Is this supposed to be developed only on VMs with global python packages?

List of packages that were needed to install are:

meson
pycodestyle
pytest
pytest-cov
pyflakes
cffi
setuptools
ninja
coverage
pandoc
gcovr
pyYaml

I did unrelated change to update meson to exclude some files and allow to find virtualenv python packages for testing (coverage, ...). I can open new PR for that if that is cleaner.

Signed-off-by: Ondrej Vasko <ondrej.vaskoo@gmail.com>
@slyon slyon added the community This PR has been proposed by somebody outside of the Netplan team and roadmap commitments. label May 19, 2025
@slyon slyon changed the title 🐛 Throw error and exit on netplan parse exceptions 🐛 Throw error and exit on netplan parse exceptions (LP: #2104373) May 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community This PR has been proposed by somebody outside of the Netplan team and roadmap commitments.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants