Conversation
There was a problem hiding this comment.
Pull request overview
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Introduces a Ruby DSL and Zeitwerk-based loading to define and consume AppleData YAML-backed schemas/models, along with new RSpec coverage and dependency updates.
Changes:
- Added a
DataFile.defineDSL (and supporting DSL classes) to declare schema-backed collections. - Added schema/model definitions for IMG4, FDR, PKI, and LocalPolicy, plus RSpec specs validating mapping.
- Updated gem entrypoint/dependencies (Zeitwerk, Shale, ActiveSupport, JsonPath) and normalized associated YAML data shapes.
Reviewed changes
Copilot reviewed 25 out of 34 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| _packages/ruby/spec/spec_helper.rb | Adds RSpec configuration and loads the gem for tests. |
| _packages/ruby/spec/apple_data/data_file_spec.rb | Adds a spec that enumerates all data files and validates collections. |
| _packages/ruby/spec/apple_data/data/img4_spec.rb | Adds schema mapping specs for AppleData::Schemas::IMG4. |
| _packages/ruby/spec/apple_data/data/fdr_spec.rb | Adds schema mapping specs for AppleData::Schemas::FactoryDataRestore. |
| _packages/ruby/ruby.iml | Marks spec as a test source and updates IDE gem indexes. |
| _packages/ruby/lib/apple_data/version.rb | Bumps gem version and removes Sorbet type sigil. |
| _packages/ruby/lib/apple_data/schemas/pki.rb | Adds PKI schema definition via the new DSL. |
| _packages/ruby/lib/apple_data/schemas/local_policy.rb | Adds LocalPolicy schema definition via the new DSL. |
| _packages/ruby/lib/apple_data/schemas/img4.rb | Adds IMG4 schema definition via the new DSL. |
| _packages/ruby/lib/apple_data/schemas/factory_data_restore.rb | Adds FDR schema definition via the new DSL. |
| _packages/ruby/lib/apple_data/schema_base.rb | Introduces a common SchemaBase mapper superclass. |
| _packages/ruby/lib/apple_data/models/metadata.rb | Adds a Metadata mapper model. |
| _packages/ruby/lib/apple_data/models/img4/tag.rb | Adds IMG4 Tag model mapper. |
| _packages/ruby/lib/apple_data/models/img4/property.rb | Adds IMG4 Property model mapper. |
| _packages/ruby/lib/apple_data/models/img4/object.rb | Adds IMG4 Object model mapper. |
| _packages/ruby/lib/apple_data/dsl/data_file_definition.rb | Implements the DSL for defining data files and collections. |
| _packages/ruby/lib/apple_data/dsl/collection_definition.rb | Implements runtime collection accessors and mapping logic. |
| _packages/ruby/lib/apple_data/data_file.rb | Moves to DSL-driven definitions; updates file loading & key normalization. |
| _packages/ruby/lib/apple_data.rb | Adds Zeitwerk loader, eager loads schemas, and centralizes requires. |
| _packages/ruby/lib/apple-data.rb | Removes legacy shim require file. |
| _packages/ruby/bin/console | Adds interactive console script (Pry). |
| _packages/ruby/apple-data.gemspec | Declares runtime dependencies introduced by the new loader/DSL. |
| _packages/ruby/Gemfile.lock | Updates lockfile to include new dependencies and tools. |
| _packages/ruby/Gemfile | Switches to gemspec and adds dev/test tooling (pry, rbs-inline, rubocop plugins). |
| _data/pki.yaml | Reshapes PKI certificate_names data to mapped objects. |
| _data/img4.yaml | Fixes IMG4 YAML structure for firmware_name. |
| _data/fdr.yaml | Updates FDR modes and improves property metadata fields. |
| Gemfile.lock | Updates root lockfile for new gem deps and tool versions. |
| Gemfile | Adds rbs-inline to root dev/test dependencies. |
Files not reviewed (4)
- .idea/apple-knowledge.iml: Generated file
- .idea/jsonSchemas.xml: Generated file
- .idea/runConfigurations/AppleData_Specs.xml: Generated file
- .idea/webResources.xml: Generated file
Suppressed comments (1)
_packages/ruby/spec/apple_data/data_file_spec.rb:1
- The
puts klasswill add noise to test output and can make failures harder to scan (especially in CI). Remove theputs(or switch to RSpec metadata/logging if you need debug output).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+48
to
+53
| parts[-1] = "#{parts[-1]}.yaml" unless parts[-1].end_with? '.yaml' | ||
| @filename = File.join(AppleData.data_location, File.join(*parts)) | ||
| @data = {} | ||
| @data = YAML.load_file @filename if File.exist? @filename | ||
| @data.with_indifferent_access | ||
| @data.deep_symbolize_keys! | ||
| @data = @data.with_indifferent_access |
Comment on lines
+18
to
+21
| @mapped_collections ||= {} | ||
| if @mapped_collections[name].nil? | ||
| collection_definition = self.class.const_get(:COLLECTIONS)[name] | ||
|
|
Comment on lines
+1
to
+3
| AppleData::Schemas::LocalPolicy = AppleData::DataFile.define do | ||
| self.default_filename = 'local_policy' | ||
| end |
Comment on lines
+20
to
+22
| def self.all | ||
| @data_files | ||
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.