Skip to content
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

Add a flag to treat warnings as errors #338

Open
andersbogsnes opened this issue Jun 26, 2020 · 4 comments
Open

Add a flag to treat warnings as errors #338

andersbogsnes opened this issue Jun 26, 2020 · 4 comments
Labels
Junior Easy issue to contribute to ldap2pg

Comments

@andersbogsnes
Copy link

When running ldap2pg, it can be useful to be able to upgrade a warning to an error, so that we get a failure. This is a good way to quickly see if something could be wrong with my configuration, while allowing ldap2pg to adopt warnings for corner cases.

@bersace
Copy link
Member

bersace commented Jun 26, 2020

Thanks @andersbogsnes

In #337 , I change a warning to an error. I also changed behaviour on mispelled attribute to raise an error. This make ldap2pg less sloppy.

This is a good reason to implement #286 . It's easy to check for warning if we count them.

@andersbogsnes do you prefer to stop on first warning (i.e. make warning critical) or continue but fail in the end if there has been one or more warning ?

@andersbogsnes
Copy link
Author

If I'm running in strict mode, it's generally because I want to fail fast and get immediate feedback - that is also the behaviour of other tooling, including python:

Sphinx: https://www.sphinx-doc.org/en/master/man/sphinx-build.html (See the -W flag)
Python: https://docs.python.org/3/using/cmdline.html#cmdoption-w (when running in -Werror mode)

@bersace
Copy link
Member

bersace commented Jun 26, 2020

Great. So i suggest a --strict switch flag with the YAML counterpart strict: yes. Fail fast on first warning.

@bersace bersace added the Junior Easy issue to contribute to ldap2pg label Oct 8, 2020
@bersace
Copy link
Member

bersace commented Oct 18, 2023

As of ldap2pg v6, this would apply to the following warning:

  • Bad DN
  • Unexpected DN
  • Reusing unmanaged role

Not for the following warning:

  • Running a prerelease
  • Dry run
By the way, I suggest to replace the following warning by an error
  • Bad verbosity (flags.go)
  • Bad integer (ldap/rc.go)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Junior Easy issue to contribute to ldap2pg
Projects
None yet
Development

No branches or pull requests

2 participants