From fa386511e136d958665e275e7343bac1378cd964 Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Wed, 15 Jan 2025 18:06:20 -0800 Subject: [PATCH] Some final post-deploy fixes (#161) * Fix track_record error * Add newlines * Update PR templates --- .github/PULL_REQUEST_TEMPLATE.md | 9 +++ .github/PULL_REQUEST_TEMPLATE/data_update.md | 68 ++++++++++++++++++++ .github/PULL_REQUEST_TEMPLATE/default.md | 26 ++++++++ .github/pull_request_template.md | 41 ------------ lib/granblue/importers/base_importer.rb | 13 ++-- 5 files changed, 112 insertions(+), 45 deletions(-) create mode 100644 .github/PULL_REQUEST_TEMPLATE.md create mode 100644 .github/PULL_REQUEST_TEMPLATE/data_update.md create mode 100644 .github/PULL_REQUEST_TEMPLATE/default.md delete mode 100644 .github/pull_request_template.md diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..398af0f --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,9 @@ +blank_issues_enabled: false +contact_links: + +- name: Default Pull Request + url: .github/PULL_REQUEST_TEMPLATE/default.md + about: For general changes and updates +- name: Data Update Pull Request + url: .github/PULL_REQUEST_TEMPLATE/data_update.md + about: For game data updates and modifications diff --git a/.github/PULL_REQUEST_TEMPLATE/data_update.md b/.github/PULL_REQUEST_TEMPLATE/data_update.md new file mode 100644 index 0000000..aae8f06 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE/data_update.md @@ -0,0 +1,68 @@ +name: Data Update +description: For game data updates and modifications +body: + +- type: markdown + attributes: + value: | + ## Data Update +- type: textarea + id: summary + attributes: + label: Summary + description: Describe what this data update includes + placeholder: "Adding new Valentines 2024 characters" + validations: + required: true +- type: textarea + id: new-additions + attributes: + label: New Additions + description: List new items being added, grouped by type + value: | + ##### Characters + - + ##### Weapons + - + ##### Summons + - +- type: textarea + id: modifications + attributes: + label: Modifications + description: List existing items being modified + value: | + ##### Characters + - + ##### Weapons + - + ##### Summons + - +- type: textarea + id: csv-files + attributes: + label: CSV Files Added + description: List all CSV files included in this update + value: | + - [ ] `YYYYMMDD-characters-XXX.csv` + - [ ] `YYYYMMDD-weapons-XXX.csv` + - [ ] `YYYYMMDD-summons-XXX.csv` +- type: checkboxes + id: data-checklist + attributes: + label: Checklist + options: + - label: CSV files use the correct naming format (`YYYYMMDD-{type}-XXX.csv`) + - label: CSV files are in the correct location (`db/seed/updates/`) + - label: All required fields are filled out + - label: Dates use the correct format (`YYYY-MM-DD`) + - label: Boolean values are either `true` or `false` + - label: Arrays use the correct format (e.g., `{value1,value2}`) + - label: Ran import in test mode (`bin/rails granblue:import_data TEST=true`) +- type: textarea + id: test-results + attributes: + label: Test Results + description: Paste the output from running the import in test mode + validations: + required: true diff --git a/.github/PULL_REQUEST_TEMPLATE/default.md b/.github/PULL_REQUEST_TEMPLATE/default.md new file mode 100644 index 0000000..a2616ba --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE/default.md @@ -0,0 +1,26 @@ +name: Default Pull Request +description: For general changes and updates +body: + +- type: markdown + attributes: + value: | + ## Description + Please provide a clear description of your changes. +- type: textarea + id: changes + attributes: + label: Changes Made + description: List the main changes in this PR + placeholder: "- Added feature X\n- Fixed bug Y\n- Updated documentation for Z" + validations: + required: true +- type: checkboxes + id: checks + attributes: + label: Checklist + options: + - label: I have tested my changes + - label: I have updated relevant documentation + - label: My changes generate no new warnings + - label: I have added tests if applicable diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md deleted file mode 100644 index f883205..0000000 --- a/.github/pull_request_template.md +++ /dev/null @@ -1,41 +0,0 @@ -## Data Update - -### Summary - - -#### New Additions - -- Characters: - - [ ] -- Weapons: - - [ ] -- Summons: - - [ ] - -#### Modifications - -- Characters: - - [ ] -- Weapons: - - [ ] -- Summons: - - [ ] - -### CSV Files Added - -- [ ] `YYYYMMDD-characters-XXX.csv` -- [ ] `YYYYMMDD-weapons-XXX.csv` -- [ ] `YYYYMMDD-summons-XXX.csv` - -### Checklist - -- [ ] CSV files use the correct naming format (`YYYYMMDD-{type}-XXX.csv`) -- [ ] CSV files are in the correct location (`db/seed/updates/`) -- [ ] All required fields are filled out -- [ ] Dates use the correct format (`YYYY-MM-DD`) -- [ ] Boolean values are either `true` or `false` -- [ ] Arrays use the correct format (e.g., `{value1,value2}`) -- [ ] Ran import in test mode (`bin/rails granblue:import_data TEST=true`) - -### Test Results - diff --git a/lib/granblue/importers/base_importer.rb b/lib/granblue/importers/base_importer.rb index 3c24538..d72143f 100644 --- a/lib/granblue/importers/base_importer.rb +++ b/lib/granblue/importers/base_importer.rb @@ -209,11 +209,16 @@ module Granblue record, was_updated = result type = model_class.name.demodulize.downcase + record_info = { + granblue_id: record.granblue_id, + name_en: record.name_en + } + if was_updated - @updated_records[type] << record.granblue_id + @updated_records[type] << record_info log_updated_record(record) if @verbose else - @new_records[type] << record.granblue_id + @new_records[type] << record_info log_new_record(record) if @verbose end end @@ -247,11 +252,11 @@ module Granblue end def log_new_record(record) - @logger&.log_verbose("Created #{model_class.name} with ID: #{record.granblue_id}") + @logger&.log_verbose("Created #{model_class.name} with ID: #{record.granblue_id}\n") end def log_updated_record(record) - @logger&.log_verbose("Updated #{model_class.name} with ID: #{record.granblue_id}") + @logger&.log_verbose("Updated #{model_class.name} with ID: #{record.granblue_id}\n") end def parse_value(value)