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.
Adds support and tests for the PKI OID map by improving OID entry stringification and making constructed collection hashes support indifferent key access.
Changes:
- Added RSpec coverage for
AppleData::Schemas::PKI#oidsand entry#to_s - Extended PKI OID entry mapper with
nameand#to_s - Updated collection hash construction to return
with_indifferent_accessand adjusted RuboCop ABC size limit
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| spec/apple_data/schemas/pki_spec.rb | Adds specs asserting OID map presence and entry stringification |
| _packages/ruby/lib/apple_data/schemas/pki.rb | Adds name and #to_s for OID entries; introduces key accessor |
| _packages/ruby/lib/apple_data/dsl/data_file_definition.rb | Attempts to label anonymous collection mappers with a custom name |
| _packages/ruby/lib/apple_data/data_file.rb | Returns HashWithIndifferentAccess from constructed collections |
| .rubocop.yml | Loosens ABC metric threshold |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+12
to
+23
| def collection(collection_name, mapper = nil, &) | ||
| data_collection_name = self.class.name | ||
| @collections[collection_name] = AppleData::DSL::CollectionDefinition.new(collection_name, mapper) | ||
| if block_given? && @collections[collection_name].mapper.nil? | ||
| @collections[collection_name].mapper = Class.new(AppleData::SchemaBase) | ||
| @collections[collection_name].mapper.const_set(:DATA_COLLECTION_NAME, data_collection_name) | ||
| @collections[collection_name].mapper.const_set(:COLLECTION_NAME, collection_name) | ||
| @collections[collection_name].mapper.instance_eval do | ||
| def name | ||
| "#{self.class.const_get(:DATA_COLLECTION_NAME)}:#{self.class.const_get(:COLLECTION_NAME)}" | ||
| end | ||
| end |
Comment on lines
+18
to
+20
| attr_accessor :key | ||
|
|
||
| attribute :name, :string |
Comment on lines
+29
to
+31
| define_method :to_s do | ||
| [name, title, description, key].reject(&:blank?).first | ||
| end |
| end | ||
|
|
||
| result.to_h | ||
| result.to_h.with_indifferent_access |
Comment on lines
+13
to
+18
| it 'has entries that respond to #to_s' do | ||
| aggregate_failures do | ||
| expect(instance.oids[:'1.2.840.113635.100.6.1.15'].to_s).to be_a(String) | ||
| expect(instance.oids[:'1.2.840.113635.100.6.1.15'].to_s).to eq 'appleImg4Manifest' | ||
| end | ||
| 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.