Skip to content

2622 implement unit for global templates#2647

Open
kdp-cloud wants to merge 4 commits into
seek-1.18from
2622-implement-unit-for-global-templates
Open

2622 implement unit for global templates#2647
kdp-cloud wants to merge 4 commits into
seek-1.18from
2622-implement-unit-for-global-templates

Conversation

@kdp-cloud

Copy link
Copy Markdown
Collaborator

Closes #2622

Implements the unit field when uploading a global template JSON file.

@kdp-cloud kdp-cloud added this to the 1.18.1 milestone Jun 30, 2026
@kdp-cloud kdp-cloud self-assigned this Jun 30, 2026
@kdp-cloud kdp-cloud linked an issue Jun 30, 2026 that may be closed by this pull request
@kdp-cloud kdp-cloud changed the base branch from main to seek-1.18 June 30, 2026 12:23
@kdp-cloud kdp-cloud moved this to In progress in SEEK 1.18.x Jun 30, 2026
@kdp-cloud kdp-cloud requested a review from Copilot June 30, 2026 12:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds support for specifying a unit for template attributes when importing global templates from JSON, integrating unit lookup into the ISA template extraction pipeline and verifying behavior via controller/job tests.

Changes:

  • Extend ISA template attribute JSON schema(s) to allow a unit field.
  • Populate TemplateAttribute.unit_id from the imported JSON during template extraction.
  • Add fixtures and tests covering unit import, missing unit, and invalid unit handling (job + controller flows).

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
lib/seek/isa_templates/template_extractor.rb Looks up Unit by symbol from JSON and assigns unit_id on extracted TemplateAttributes.
lib/seek/isa_templates/template_attributes_schema.json Allows unit in production schema for template attributes.
lib/seek/isa_templates/template_attributes_schema_test.json Allows unit in test schema for template attributes.
test/unit/jobs/populate_templates_job_test.rb Adds unit-related job tests (valid unit, missing unit, invalid unit).
test/functional/templates_controller_test.rb Adds controller tests for create/update with unit and JSON upload population including unit.
test/fixtures/files/upload_json_sample_type_template/test_unit_template.json New fixture template JSON including "unit": "g".
test/fixtures/files/upload_json_sample_type_template/invalid_unit_template.json New fixture template JSON including an invalid unit symbol.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lib/seek/isa_templates/template_extractor.rb
Comment thread test/unit/jobs/populate_templates_job_test.rb Outdated
kdp-cloud and others added 2 commits June 30, 2026 14:37
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@kdp-cloud kdp-cloud marked this pull request as ready for review June 30, 2026 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In progress

Development

Successfully merging this pull request may close these issues.

Implement unit for global templates

2 participants