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 Base Images #240

Merged
merged 13 commits into from
Feb 23, 2023
Merged

Add Base Images #240

merged 13 commits into from
Feb 23, 2023

Commits on Feb 8, 2023

  1. Generate BaseImage resource in BaseImages context

    Generated with:
    mix phx.gen.context BaseImages BaseImage base_images \
      version:string:unique release_display_name:map description:map \
      starting_version_requirement:string \
      base_image_collection_id:references:base_image_collections \
      tenant_id:references:tenants
    
    Copyright headers and formatting added afterwards
    
    Signed-off-by: Riccardo Binetti <riccardo.binetti@secomind.com>
    rbino committed Feb 8, 2023
    Configuration menu
    Copy the full SHA
    36f3fa1 View commit details
    Browse the repository at this point in the history
  2. devices_fixtures: make fixtures unique

    Generate unique handle, names and part numbers. This is helpful when using them
    to generate associations.
    
    Signed-off-by: Riccardo Binetti <riccardo.binetti@secomind.com>
    rbino committed Feb 8, 2023
    Configuration menu
    Copy the full SHA
    892b2f3 View commit details
    Browse the repository at this point in the history
  3. Extract validate_locale to Edgehog.Localization.Validation module

    It needs to be used in multiple changesets
    
    Signed-off-by: Riccardo Binetti <riccardo.binetti@secomind.com>
    rbino committed Feb 8, 2023
    Configuration menu
    Copy the full SHA
    7723558 View commit details
    Browse the repository at this point in the history
  4. Adapt the generated code to the actual BaseImage requirement

    In the context:
    - Add localization to description and display name
    - Change get_base_image!/1 to fetch_base_image/1
    - Disallow updating version on update
    - Preload the associations
    
    In the migration:
    - Fix indexes including the tenant_id
    - Add non-nullability where relevant
    
    Also adapt tests, adding helpers to reduce noise
    
    Signed-off-by: Riccardo Binetti <riccardo.binetti@secomind.com>
    rbino committed Feb 8, 2023
    Configuration menu
    Copy the full SHA
    716d3be View commit details
    Browse the repository at this point in the history
  5. Add the actual upload for the BaseImage

    Store the file in a bucket and save the URL.
    Add relevant mocks to tests.
    
    Signed-off-by: Riccardo Binetti <riccardo.binetti@secomind.com>
    rbino committed Feb 8, 2023
    Configuration menu
    Copy the full SHA
    3900c2c View commit details
    Browse the repository at this point in the history
  6. base_image_collection: add base_images association

    Preload it in the default base image collection preloads
    
    Signed-off-by: Riccardo Binetti <riccardo.binetti@secomind.com>
    rbino committed Feb 8, 2023
    Configuration menu
    Copy the full SHA
    da684dd View commit details
    Browse the repository at this point in the history
  7. base_images: add list_base_images_for_collection

    List images for a specific base image collection
    
    Signed-off-by: Riccardo Binetti <riccardo.binetti@secomind.com>
    rbino committed Feb 8, 2023
    Configuration menu
    Copy the full SHA
    355ff1b View commit details
    Browse the repository at this point in the history
  8. astarte_types: rename BaseImage object to BaseImageInfo

    Make room for the BaseImage object, representing an actual uploaded base image
    
    Signed-off-by: Riccardo Binetti <riccardo.binetti@secomind.com>
    rbino committed Feb 8, 2023
    Configuration menu
    Copy the full SHA
    4262922 View commit details
    Browse the repository at this point in the history
  9. GraphQL: add BaseImage object and baseImage query

    Allow retrieving a baseImage given its id. Add tests for the query.
    
    Signed-off-by: Riccardo Binetti <riccardo.binetti@secomind.com>
    rbino committed Feb 8, 2023
    Configuration menu
    Copy the full SHA
    3ef7858 View commit details
    Browse the repository at this point in the history
  10. GraphQL: add baseImages field to baseImageCollection object

    Allow retrieving the list of base images in a base image collection
    
    Signed-off-by: Riccardo Binetti <riccardo.binetti@secomind.com>
    rbino committed Feb 8, 2023
    Configuration menu
    Copy the full SHA
    e3604d7 View commit details
    Browse the repository at this point in the history
  11. GraphQL: add createBaseImage mutation

    Allow uploading a base image to a base image collection
    
    Signed-off-by: Riccardo Binetti <riccardo.binetti@secomind.com>
    rbino committed Feb 8, 2023
    Configuration menu
    Copy the full SHA
    c6f59da View commit details
    Browse the repository at this point in the history
  12. GraphQL: add updateBaseImage mutation

    Allow updating an existing BaseImage
    
    Signed-off-by: Riccardo Binetti <riccardo.binetti@secomind.com>
    rbino committed Feb 8, 2023
    Configuration menu
    Copy the full SHA
    6c9e22e View commit details
    Browse the repository at this point in the history
  13. GraphQL: add deleteBaseImage mutation

    Allow removing an existing base image.
    
    Update CHANGELOG since Base Image support is now complete.
    
    Signed-off-by: Riccardo Binetti <riccardo.binetti@secomind.com>
    rbino committed Feb 8, 2023
    Configuration menu
    Copy the full SHA
    02a4947 View commit details
    Browse the repository at this point in the history