Skip to content

[FSSDK-11140] Ruby: Update project config to track CMAB properties #362

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Jun 13, 2025

Conversation

esrakartalOpt
Copy link
Contributor

Summary

  • Updated projetc config to track CMAB properties
  • Add test case

Test plan

Issues

@esrakartalOpt esrakartalOpt marked this pull request as ready for review June 3, 2025 22:14
Copy link
Contributor

Choose a reason for hiding this comment

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

The new test is good, but you might add further tests for the new attribute lookup methods to verify error cases and edge cases.

Copy link

@raju-opti raju-opti left a comment

Choose a reason for hiding this comment

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

Approved with few comments

# Returns:
# Attribute corresponding to the provided attribute key.
attribute = @attribute_key_map[attribute_key]
return attribute if @attribute_key_map.key?(attribute_key)

Choose a reason for hiding this comment

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

I don't have much ruby knowledge, but I was curious whether we can refactor like this:

attribute = @attribute_key_map[attribute_key]
return attribute if attribute

Copilot says that will work

# Returns:
# Attribute key corresponding to the provided attribute ID.
attribute = @attribute_id_to_key_map[attribute_id]
return attribute if @attribute_id_to_key_map.key?(attribute_id)

Choose a reason for hiding this comment

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

similar here

},
'cmab' => {
'type' => 'object',
'items' => {

Choose a reason for hiding this comment

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

as cmab field is a single object, I guess items field is not appropriate. Also, we can probably specify the type of attributeIds.

update suggested by copilot

'cmab' => {
  'type' => 'object',
  'properties' => {
    'attributeIds' => {
      'type' => 'array',
      'items' => { 'type' => 'string' }
    },
    'trafficAllocation' => {
      'type' => 'integer'
    }
  }
}

@esrakartalOpt esrakartalOpt merged commit 7658884 into master Jun 13, 2025
10 checks passed
@esrakartalOpt esrakartalOpt deleted the esra/FSSDK-11140_cmab_implementation branch June 13, 2025 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants