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

Start passing in an option to ActiveRecordColumns compiler for how to generate column types #1888

Merged
merged 14 commits into from
Jun 4, 2024

Commits on May 2, 2024

  1. Add ability to inject options into a DSL compiler

    Co-authored-by: Alexandre Terrasa <583144+Morriar@users.noreply.github.com>
    paracycle and Morriar committed May 2, 2024
    Configuration menu
    Copy the full SHA
    4e3f042 View commit details
    Browse the repository at this point in the history
  2. Add column type option to AR column compiler

    This is either 'untyped', 'nilable', or 'persisted', with the old behaviour being approximated by 'persisted'
    
    Co-authored-by: Alexandre Terrasa <583144+Morriar@users.noreply.github.com>
    paracycle and Morriar committed May 2, 2024
    Configuration menu
    Copy the full SHA
    f049087 View commit details
    Browse the repository at this point in the history
  3. Allow passing compiler options to rbi_for test helper method

    Co-authored-by: Alexandre Terrasa <583144+Morriar@users.noreply.github.com>
    paracycle and Morriar committed May 2, 2024
    Configuration menu
    Copy the full SHA
    1173936 View commit details
    Browse the repository at this point in the history
  4. Move non-StrongTypeGeneration extending tests to 'untyped' tests

    All the tests that were testing existence of StrongTypeGeneration but with the model not extending it are now actually testing the "untyped" option for the `column_types` compiler option to AR columns compiler.
    
    Co-authored-by: Alexandre Terrasa <583144+Morriar@users.noreply.github.com>
    paracycle and Morriar committed May 2, 2024
    Configuration menu
    Copy the full SHA
    2b718ba View commit details
    Browse the repository at this point in the history
  5. Add tests for "nilable" column types option for AR columns compiler

    Co-authored-by: Alexandre Terrasa <583144+Morriar@users.noreply.github.com>
    paracycle and Morriar committed May 2, 2024
    Configuration menu
    Copy the full SHA
    d16788a View commit details
    Browse the repository at this point in the history
  6. Remove StrongTypeGeneration tests

    Co-authored-by: Alexandre Terrasa <583144+Morriar@users.noreply.github.com>
    paracycle and Morriar committed May 2, 2024
    Configuration menu
    Copy the full SHA
    2fa7d23 View commit details
    Browse the repository at this point in the history
  7. Start passing in DSL compiler options from CLI down to DSL pipeline

    Co-authored-by: Alexandre Terrasa <583144+Morriar@users.noreply.github.com>
    paracycle and Morriar committed May 2, 2024
    Configuration menu
    Copy the full SHA
    b039225 View commit details
    Browse the repository at this point in the history
  8. Start passing options for each compiler to its constructor

    Co-authored-by: Alexandre Terrasa <583144+Morriar@users.noreply.github.com>
    paracycle and Morriar committed May 2, 2024
    Configuration menu
    Copy the full SHA
    bceba57 View commit details
    Browse the repository at this point in the history
  9. Don't enforce hash values to always be strings for compiler_options

    Co-authored-by: Alexandre Terrasa <583144+Morriar@users.noreply.github.com>
    paracycle and Morriar committed May 2, 2024
    Configuration menu
    Copy the full SHA
    ff08af4 View commit details
    Browse the repository at this point in the history
  10. Add CLI test for passing in options to ActiveRecordColumns compiler

    Co-authored-by: Alexandre Terrasa <583144+Morriar@users.noreply.github.com>
    paracycle and Morriar committed May 2, 2024
    Configuration menu
    Copy the full SHA
    3cda0f3 View commit details
    Browse the repository at this point in the history
  11. Update README with new CLI flag docs

    Co-authored-by: Alexandre Terrasa <583144+Morriar@users.noreply.github.com>
    paracycle and Morriar committed May 2, 2024
    Configuration menu
    Copy the full SHA
    975d4f2 View commit details
    Browse the repository at this point in the history
  12. IdentityCache needs column type option as nilable for backcompat

    Co-authored-by: Alexandre Terrasa <583144+Morriar@users.noreply.github.com>
    paracycle and Morriar committed May 2, 2024
    Configuration menu
    Copy the full SHA
    aa324a6 View commit details
    Browse the repository at this point in the history
  13. Hide compiler-options as a command line option

    Since this option cannot be supplied properly on the command line, we should hide it as a command line option, but support it in the configuration file. We also error out if the option as supplied does not have proper hashes as values.
    paracycle committed May 2, 2024
    Configuration menu
    Copy the full SHA
    0da147c View commit details
    Browse the repository at this point in the history

Commits on Jun 4, 2024

  1. Parse DSL compiler options into YAML if they are supplied as strings

    Instead of erroring out when the compiler options are not supplied as hashes, we could try to first parse them as YAML (if they are supplied as strings) and only then error if any of the compiler options isn't a hash.
    
    This allows users to supply compiler options as strings in the `tapioca` CLI as:
    ```
    dsl Post --compiler-options='ActiveRecordColumns:{types: untyped}'
    ```
    which is more user-friendly than not being able to pass these options on the command line.
    paracycle committed Jun 4, 2024
    Configuration menu
    Copy the full SHA
    ca2eb8d View commit details
    Browse the repository at this point in the history