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

ADR0007: How we are going to validate the new API codebase #1301

Commits on Mar 10, 2021

  1. ADR0007: How we are going to validate the new API codebase

    Add a decision record about the different options which we can use
    to validate the new code under tuf.api.
    
    TODO: Make decision.
    
    Signed-off-by: Martin Vrachev <[email protected]>
    MVrachev committed Mar 10, 2021
    Configuration menu
    Copy the full SHA
    4b2f28c View commit details
    Browse the repository at this point in the history

Commits on Mar 15, 2021

  1. Correct myself about strict mode in pydantic

    Strict types are available in pydantic:
    https://pydantic-docs.helpmanual.io/usage/types/#strict-types
    it's just sad there is no class-wide strict mode implemented yet:
    See: pydantic/pydantic#1098
    
    Signed-off-by: Martin Vrachev <[email protected]>
    MVrachev committed Mar 15, 2021
    Configuration menu
    Copy the full SHA
    6627853 View commit details
    Browse the repository at this point in the history

Commits on Mar 17, 2021

  1. Add 2 requirements and summarize options stances

    Add summaries of how our options compare against our requirements.
    
    Signed-off-by: Martin Vrachev <[email protected]>
    MVrachev committed Mar 17, 2021
    Configuration menu
    Copy the full SHA
    5734797 View commit details
    Browse the repository at this point in the history
  2. Document marshmallow library as an option

    Signed-off-by: Martin Vrachev <[email protected]>
    MVrachev committed Mar 17, 2021
    Configuration menu
    Copy the full SHA
    c6c706c View commit details
    Browse the repository at this point in the history

Commits on Mar 18, 2021

  1. Document invoking validate_model() for pydantic

    I just understood, that there is a way to invoke all validators with
    pydantic whenever we want with a helper function.
    
    Correct the ADR with this new information and fix some typos.
    
    Signed-off-by: Martin Vrachev <[email protected]>
    MVrachev committed Mar 18, 2021
    Configuration menu
    Copy the full SHA
    08853c7 View commit details
    Browse the repository at this point in the history
  2. Remove typical library as an option

    There are multiple limitations in the "typical" library to consider it
    as an option for our new API which is going to be used from
    variety of projects, some of which are big like PyPI.
    
    The main problems I have with it are:
    1. It's a relatively unknown libr1ary with only 111 stars on GitHub.
    2. It doesn't allow for custom validators. It's focused on type checking
    and it allows for some constraints on the function arguments/class
    attributes, but nothing fancier than that. Adding the possibility for
    custom validators is planned for future versions.
    3. It's a one-man show with only one maintainer actively working on the
    project which is a big red sign for PyPI.
    4. It adds 4 additional dependencies pytzdata, pendulum, inflection,
    and itself - typical.
    5. It doesn't support python 3.6.
    
    Signed-off-by: Martin Vrachev <[email protected]>
    MVrachev committed Mar 18, 2021
    Configuration menu
    Copy the full SHA
    9c65b3d View commit details
    Browse the repository at this point in the history
  3. Close code block for an example

    Signed-off-by: Martin Vrachev <[email protected]>
    MVrachev committed Mar 18, 2021
    Configuration menu
    Copy the full SHA
    e794539 View commit details
    Browse the repository at this point in the history

Commits on Mar 22, 2021

  1. Use one table to compare all options

    Signed-off-by: Martin Vrachev <[email protected]>
    MVrachev committed Mar 22, 2021
    Configuration menu
    Copy the full SHA
    05c36a3 View commit details
    Browse the repository at this point in the history

Commits on Mar 24, 2021

  1. Document hybrid option of typeguard + decorators

    Signed-off-by: Martin Vrachev <[email protected]>
    MVrachev committed Mar 24, 2021
    Configuration menu
    Copy the full SHA
    ca70f30 View commit details
    Browse the repository at this point in the history
  2. Document using typeguard and ValidationMixin

    Signed-off-by: Martin Vrachev <[email protected]>
    MVrachev committed Mar 24, 2021
    Configuration menu
    Copy the full SHA
    b9e838a View commit details
    Browse the repository at this point in the history

Commits on Mar 30, 2021

  1. Add lines and file count information

    Signed-off-by: Martin Vrachev <[email protected]>
    MVrachev committed Mar 30, 2021
    Configuration menu
    Copy the full SHA
    0559bbc View commit details
    Browse the repository at this point in the history
  2. Fix typo

    Signed-off-by: Martin Vrachev <[email protected]>
    MVrachev committed Mar 30, 2021
    Configuration menu
    Copy the full SHA
    3f3fadb View commit details
    Browse the repository at this point in the history