* Update gitignore
There is a mystery postgres folder and we are going to ignore it
* Add migrations
* Update preview state default to pending
* Adds indexes
* Adds PgHero and PgStatements
* Update .gitignore
* Update Gemfile
Production:
- `newrelic_rpm`
Development:
- `pg_query`
- `prosopite`
* Configure Sidekiq
Create job for cleaning up party previews
* Configure Prosopite and remove CacheFreeLogger
* Enable query logging
* Update api_controller.rb
Add N+1 detectioin via Prosopite in development/test environments
* Refactor canonical object blueprints
* Refactor grid object blueprints
* Remove N+1 from grid object models
Reimplementing `character` `summon` and `weapon` was making N+1s which made queries really slow
* Add counter caches to party
* Add preview generation helpers
The Party model can respond to queries about its preview state with the following models:
- `schedule_preview_generation`
- `preview_content_changed?`
- `preview_expired?`
- `should_generate_preview?`
- `ready_for_preview?`
- `needs_preview_generation?`
- `preview_relevant_attributes`
Removes the following methods:
- `schedule_preview_regeneration`
- `preview_relevant_changes?`
* Add cache to is_favorited(user)
* Refactored PartyBlueprint to minimize N+1s
* Remove preview expiry constants
These are defined in the Coordinator instead
* Add method comments
* Create parties_controller.rbs
* Update logic and logs
* Updates excluded methods and calculate_count
* Use `includes` instead of `joins`
* Use a less-insane way of counting
* Adds a helper method for party privacy
* Update filter condition helpers
Just minor refactoring
* Fix old view name in PartyBlueprint
* Refactor parties#create
* Remove redundant return
* Update parties_controller.rbs
* Update parties#index
* Update parties_controller.rb
Updates apply_includes and apply_excludes, along with modifying id_to_table and build_query
* Update parties_controller.rb
Adds the rest of the changes, too tired to write them all out. Some preview generation, some filtering
* Refactor parties#index and parties#favorites
These are mostly the same methods, so we remove common code into build_parties_query and render_paginated_parties
* Alias table name to object to maintain API consistency
* Maintain API consistency with raid blueprint
* Optimize party loading by adding eager loading to `set_from_slug`
- Refactored `set_from_slug` to use `includes` for eager loading associated models:
- `user`, `job`, `raid` (with `group`)
- `characters` (with `character` and `awakening`)
- `weapons` (with `weapon`, `awakenings`, `weapon_key1`, `weapon_key2`, `weapon_key3`)
- `summons` (with `summon`)
- `guidebooks` (`guidebook1`, `guidebook2`, `guidebook3`)
- `source_party`, `remixes`, `skills`, and `accessory`
- This change improves query efficiency by reducing N+1 queries and ensures all relevant associations are preloaded.
- Removed redundant favorite check as it was not necessary in this context.
* Refactor grid blueprints
- **GridCharacterBlueprint:**
- Removed `:minimal` view restriction on `party` association.
- Improved nil checks for `ring1`, `ring2`, and `earring` to prevent errors.
- Converted string values in `awakening_level`, `over_mastery`, and `aetherial_mastery` fields to integers for consistency.
- Ensured `over_mastery` and `aetherial_mastery` only include valid entries, filtering out blank or zero-modifier values.
- **GridWeaponBlueprint:**
- Removed `:minimal` view restriction on `party` association.
- Ensured `weapon` association exists before accessing `ax`, `series`, or `awakening`.
- Improved conditional checks for `weapon_keys` to prevent errors when `weapon` or `series` is nil.
- Converted `awakening_level` field to integer for consistency.
- **GridCharacterBlueprint:**
- Removed `:minimal` view restriction on `party` association.
* Update raid blueprints
- Show flat representation of raid group in RaidBlueprint's nested view
- Show nested representation of raid in RaidGroupBlueprint's full view
* Move n+1 detection to around_action hook
* Improve handling mastery bonuses
- Improved handling of nested attributes:
- Replaced old mastery structure with new `rings` and `awakening` assignments.
- Added `new_rings` and `new_awakening` virtual attributes for easier updates.
- Updated `assign_attributes` to exclude `rings` and `awakening` to prevent conflicts.
- Enhanced parameter transformation:
- Introduced `transform_character_params` to process `rings`, `awakening`, and `earring` more reliably.
- Ensured proper type conversion (`to_i`) for numeric values in `uncap_level`, `transcendence_step`, and `awakening_level`.
- Improved error handling for missing values by setting defaults where needed.
- Optimized database queries:
- Added `.includes(:awakening)` to `set` to prevent N+1 query issues.
- Updated strong parameters:
- Changed `rings` from individual keys (`ring1`, `ring2`, etc.) to a structured array format.
- Refactored permitted attributes to align with the new nested structure.
* Eager-load jobs when querying job skills
* Eager load raids/groups when querying
* Update users_controller.rb
More efficient way of denoting favorited parties.
* Update awakening.rb
- Removes explicitly defined associations and adds ActiveRecord associations instead
* Update party.rb
- Removes favorited accessor
- Renames derivative_parties to remixes and adds in-built sort
* Update weapon_awakening.rb
- Removes redefined explicit associations
* Update grid_character.rb
- Adds code transforming incoming ring and awakening values into something the db understands
* Update character.rb
Add explicit Awakenings enum
* Update coordinator.rb
Adds 'queued' as a state for generation
* Add default preview images
* Update application.rb
* Adds app assets path in API mode
* Cleans up file
* Create assets.rb
An initializer for font assets (for image generation)
* Updates to Canvas and Coordinator
* Update parties_controller.rb
* Adds retry header if generation is still in progress
* Streams S3 content instead of redirecting to prevent 302
* Update coordinator.rbs
* Create previews.rake
A rake task for generating images offline
* Add commands to build phase
* Only re-index search when records are updated
* Add logs and fixes
* Add preview_s3_key to Parties
* Add some extra packages to Nixfile
* Add logging around custom font use
* Add mini_magick and rufus-scheduler
* Expose attributes and add sigs to AwsService
* Get Party ready for preview state
* Added new fields for preview state and generated_at timestamp
* Add preview state enum to model
* Add preview_relevant_changes? after_commit hook
* Add jobs for generating and cleaning up party previews
* Add new endpoints to PartiesController
* `preview` shows the preview and queues it up for generation if it doesn't exist yet
* `regenerate_preview` allows the party owner to force regeneration of previews
* Schedule jobs
* Stalled jobs are checked every 5 minutes
* Failed jobs are retried every hour
* Old preview jobs are cleaned up daily
* Add the preview service
This is where the bulk of the work is. This service renders out the preview images bit by bit. Currently we render the party name, creator, job icon, and weapon grid.
This includes signatures and some fonts.
* Move app/helpers/granblue_wiki to lib/parsers/wiki
This clears up the namespace beginning with "Granblue"
* Removed some top-level Granblue libs
DataImporter and DownloadManager exist inside of the PostDeployment namespace now so these files are redundant
* Fix Downloaders namespace
Our namespace was singular Downloader, now it is plural Downloaders to match the folder name
* Fix import paths
* DownloadManager was moved to downloaders/
* import_data task now uses the PostDeployment version of DataImporter
* Update application.rb
Eager-Load/Autoload the lib/ folder
* Update cors.rb
Add Granblue website and Extension ID to CORS
* Add transformers
Transformers take raw data from Granblue Fantasy and transforms them into hensei-compatible JSON. Transformers heavily borrow from vazkii/hensei-transfer.
* Add ImportController and route
This adds the controller that handles creating a full party from transformed Granblue Fantasy data
* Adds more new items to the database
* Updates to older migrations
These were manually updated in the database
* Adds more new items to the database
* Fixes misclassification of Grand Weapons
* Add the final new items
* Delete 20250115-summons-003.csv
* Updates weapons with granblue_id reference to Characters
* Remove extra empty lines
* Adds Orologia summon
* Modify deployment manager
Use - to make it easier to copy paste into Github PR
* Fresh credentials.yml.enc
* Update .ruby-gemset
* Made PostDeploymentManager modular
We broke PostDeploymentManager out into several files to make it easier to maintain.
We also added a "force" mode that forces the script to consider all CSV files. This is useful for testing the post-deploy script itself. This should only be used in test mode or you will dirty your database.
We also fine tuned some of the logging to make sure that both verbose and non-verbose modes are helpful.
* Add table for data version and migrate
* Modify migration and re-migrate
* Create data_version.rb
Adds a model for DataVersion
* Add aws-sdk-s3 and create aws_service.rb
AwsService handles streaming game image files from the Granblue Fantasy server to our S3 instance.
* Add importers
The Importer libraries take CSV data and import them into the database for each type. We currently support characters, summons and weapons.
* Add downloaders
Downloaders take Granblue IDs and download images for those items from the Granblue Fantasy server in all relevant sizes.
Downloaders can download to disk or stream the file directly to S3.
* Create data_importer.rb
* Fetches a list of all CSV files present in the updates folder
* Checks which have already been imported
* Sends unimported data to the appropriate Importer to handle
* Create download_manager.rb
Creates an appropriate downloader for each Granblue ID it receives
* Update download_images.rake
Most of this task has been extracted into the Downloader libraries
* Update import_data.rake
* Create deploy.rake
This task is to be run as a post-deploy script. It checks for new unimported data, imports it, then downloads the relevant images to S3 or local disk depending on the parameters provided.
* Update credentials.yml.enc
* Began working on a README and added example CSVs
* Modify importer to handle updates
This way we can also add FLBs and other uncaps easier.
* Updates only require values that will change
When updating a row, fields that don't have a provided value will not be changed
* Rebuild search indices in post deploy
* Clean up logs with LoggingHelper
* More logging adjustments
Trying to get a nice-looking output
* Change some ASCII characters
* Final ASCII changes
* Fix issues with Summon and Weapon importers
* Finish README for contributing
At the expense of making database calls, the image downloader now only attempts to download images that will exist for the specific object based on how many uncaps it has.
* Make weapon key series an array
Draconic Weapons Providence can have original Draconic Weapon keys, but also have a new key that can only be equipped to them. Thanks, Cygames.
* Update weapon.rb
* Update to check key compatibility against an array instead of an int
* Add convenience function to check if the weapon is part of a Draconic Weapon series
* Update grid_weapon.rb
Update conflict detection to:
* Detect Draconic Weapons Providence
* Add multiple weapons to conflicting weapons instead of just one
* (WIP) Update conflict view rendering
Conflict blueprints should render multiple conflict weapons instead of just one.
Also adds Draconic Weapon Providence series to various places that check series by number
* Finish last bugs
We tested to ensure that conflict resolution appears for
* Opus and Draconic
* Draconic and Draconic 2
* Draconic 2 + Opus and Draconic 1
Manually setting summon transcendence was not working due to a change that passed in the canonical object instead of the grid object to `max_uncap_level`
* Add migrations to add user roles and party visibility.
* Update schema.rb
* Add admin check in User model
* Implement rudimentary visibility of teams
* Adds checks to Party model
* Hides parties from collection views depending on visibility
* Disallows viewing private parties if you're not the owner
* Add a party's visibility to blueprint
* Add admin mode
The API Controller checks if the user is logged in and whether they are an admin, and checks for the X-Admin-Mode header
* Implement admin mode overrides
* Add admin_mode to authorize
* Note to self: Implement user editing by admins
* Fix syntax error with equality in SQL
* Fix syntax error with method name
* Fix bug in who can see restricted parties
* Add privacy control to user profiles
* Fix favorites page by fixing how query is built
* Set uncap level when GridSummon is created
If you don't, then NULL entries get sent to the database from the bookmarklet.