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

Conversation

rbino
Copy link
Collaborator

@rbino rbino commented Jan 18, 2023

Allow uploading a Base Image to a Base Image Collection and doing all CRUD operations on it

@rbino rbino force-pushed the base-images branch 2 times, most recently from 2b1c9da to d120193 Compare January 20, 2023 10:26
@coveralls
Copy link

coveralls commented Jan 20, 2023

Pull Request Test Coverage Report for Build 02a494719b416a2c593a6c9048f2ba8eb2ec5a22-PR-240

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 5 unchanged lines in 2 files lost coverage.
  • Overall coverage increased (+0.7%) to 80.94%

Files with Coverage Reduction New Missed Lines %
lib/edgehog_web/resolvers/base_images.ex 2 95.24%
lib/edgehog_web/schema.ex 3 5.56%
Totals Coverage Status
Change from base Build 72a69ac6dc2a9b1897ecba915757169dad1f898b: 0.7%
Covered Lines: 964
Relevant Lines: 1191

💛 - Coveralls

backend/test/support/fixtures/devices_fixtures.ex Outdated Show resolved Hide resolved
backend/lib/edgehog/base_images.ex Outdated Show resolved Hide resolved
backend/lib/edgehog/base_images.ex Outdated Show resolved Hide resolved
backend/test/edgehog/base_images_test.exs Outdated Show resolved Hide resolved
backend/test/edgehog/base_images_test.exs Outdated Show resolved Hide resolved
backend/test/edgehog/base_images_test.exs Outdated Show resolved Hide resolved
backend/lib/edgehog/base_images.ex Show resolved Hide resolved
backend/lib/edgehog/base_images.ex Outdated Show resolved Hide resolved
@rbino rbino force-pushed the base-images branch 4 times, most recently from 579581a to 42bba4f Compare January 26, 2023 17:49
@rbino rbino marked this pull request as ready for review January 27, 2023 11:41
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 <[email protected]>
Generate unique handle, names and part numbers. This is helpful when using them
to generate associations.

Signed-off-by: Riccardo Binetti <[email protected]>
It needs to be used in multiple changesets

Signed-off-by: Riccardo Binetti <[email protected]>
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 <[email protected]>
Store the file in a bucket and save the URL.
Add relevant mocks to tests.

Signed-off-by: Riccardo Binetti <[email protected]>
Preload it in the default base image collection preloads

Signed-off-by: Riccardo Binetti <[email protected]>
List images for a specific base image collection

Signed-off-by: Riccardo Binetti <[email protected]>
Make room for the BaseImage object, representing an actual uploaded base image

Signed-off-by: Riccardo Binetti <[email protected]>
Allow retrieving a baseImage given its id. Add tests for the query.

Signed-off-by: Riccardo Binetti <[email protected]>
Allow retrieving the list of base images in a base image collection

Signed-off-by: Riccardo Binetti <[email protected]>
Allow uploading a base image to a base image collection

Signed-off-by: Riccardo Binetti <[email protected]>
Allow updating an existing BaseImage

Signed-off-by: Riccardo Binetti <[email protected]>
Allow removing an existing base image.

Update CHANGELOG since Base Image support is now complete.

Signed-off-by: Riccardo Binetti <[email protected]>
@szakhlypa szakhlypa merged commit eab5551 into edgehog-device-manager:main Feb 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants