Closed blackfyre closed 8 months ago
It seems like you've provided a detailed summary of changes and a request to validate whether the code changes meet the primary objectives and requirements in the linked issues. Based on the provided information, I've updated the content as per your instructions. Here's the updated content:
The changes involve setting up the application to work with an S3-compatible storage system (Minio) for image handling, updating environment variables, and adding new functionality to seed images into the S3 storage. The .env.example
and README.md
files have been updated to reflect the new configurations required for S3. New functions have been added to the assets/internals.go
file to handle render data and caching of analytics. Additionally, the main.go
file has been updated to include a new command for seeding images in a development environment. Various migrations have been updated to reflect changes in table naming conventions and schema adjustments. The models/artworks.go
file introduces a new Artwork
model and associated query functions, while the utils/seed/images.go
file includes functions for seeding images into S3 storage.
File(s) | Change Summary |
---|---|
.env.example , README.md |
Updated with new S3 configuration and instructions. |
assets/internals.go |
Added new functionality for handling render data and caching of analytics. |
main.go |
Updated to include a new command for seeding images in a development environment. |
migrations/* |
Updated naming conventions and schemas for various tables. |
models/artworks.go |
Added new Artwork model and associated query functions. |
utils/seed/images.go |
Introduced functions for seeding images into S3 storage. |
Objective | Addressed | Explanation |
---|---|---|
#69: DX: Seed the associated S3 storage with images | ✅ | The utils/seed/images.go file includes a SeedImages function that seeds images into S3 storage, addressing the primary objective of the linked issue. |
The changes made in the codebase align with the objective of the linked issue, which is to seed images into the associated S3 storage. The SeedImages
function in utils/seed/images.go
is specifically designed to handle this task, suggesting that the objective has been met.
Update on Application Configuration Files
The .env.example
file was amended to include new settings related to remote file storage and email protocols.
Instructions on Application Setup and Build
The README.md
file has been updated with guidance about how to run and build the application using a new approach.
New Functions for App Rendering
A new file and function, called NewRenderData
in internals.go
, was added in the assets
directory. This function is responsible for preparing necessary data for the application rendering.
Inclusion of Placeholder Images
Two placeholder image files were added in the assets/reference
directory. This will help during the application testing or usage when real images are not available or broken.
Configuration of Auxiliary Services
A docker-compose.yml
file with configurations for auxiliary services (Minio and Mailpit) was introduced for better organization and replication of the development environment.
New Command for Image Seeding
The main.go
file was revised to include a command seed:images
, which sends images to a specified remote file storage bucket.
Database Table and Data Management Several migration files were either updated or added to setup new tables and data collections in the database. This include new collections such as periods and forms of art, glossaries, guestbooks, artists, types of art, and complementary artists.
Updates to Specific Table Migration
The migration file specific to the art table (migrations/1696479790_add_art_table.go
) got certain modifications for values including the table ID `tId` and table name tName
. Subsequent alterations include updates in collection.Schema
, db.Insert
, and db.DropTable
calls to reference tId
.
Addition of Artwork
Model
A new package, models
, was added and file models/artworks.go
includes a new Artwork
struct, along with the method to get its table name, TableName
.
Addition of Image Seeding Utilities
A new file utils/seed/images.go
added a package, seed
, that provides functions SeedImages
and generateThumbnail
, for managing and processing of artwork images.
A new dev support tool was added.
The
docker-composer
feeds from the.env
file, be sure to have it before running the initial migrations. Minio access will be set-up based on the S3_ACCESS_KEY/SECRET values.Fixes #69 Inspired by #54
Summary by CodeRabbit
Documentation
.env.example
andREADME.md
files with new configuration instructions and running guidelines for the application.New Features
Refactor
Bug Fixes
Chores