Skip to content

[FME-14339] Added new fetcher#272

Open
nmayorsplit wants to merge 3 commits intoFME-14399from
FME-14451
Open

[FME-14339] Added new fetcher#272
nmayorsplit wants to merge 3 commits intoFME-14399from
FME-14451

Conversation

@nmayorsplit
Copy link
Copy Markdown
Contributor

GO SPLIT COMMONS

What did you accomplish?

  • Bug fix
  • New feature
  • Breaking change

How do we test the changes introduced in this PR?

Extra Notes

@sonarqube-pull-requests
Copy link
Copy Markdown

@nmayorsplit nmayorsplit marked this pull request as ready for review March 31, 2026 15:56
@nmayorsplit nmayorsplit requested a review from a team as a code owner March 31, 2026 15:56
@nmayorsplit nmayorsplit changed the title Fme 14451 [FME-14339] Added new fetcher Mar 31, 2026
}

// Handle conditions - create default if empty
conditions := config.Conditions
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

based on the last structure, the conditions are under targeting element
[
{
"name": "SomeConfig1",
"variants": [
{
"name": "v1",
"definition": {
"prop1": true,
"prop2": 123
}
},
{
"name": "v2",
"definition": {
"prop1": false,
"prop2": 456
}
}
],
"targeting": {
"conditions": [
{
"variant": "v1",
"label": "main condition",
"matchers": [
{
"type": "IS_EQUAL_TO",
"data": {
"type": "NUMBER",
"number": 42
},
"attribute": "age"
},
{
"type": "WHITELIST",
"data": {
"strings": [
"a",
"b",
"c"
]
},
"attribute": "favoriteCharacter"
}
]
}
]
}
}
]

package dtos

// ConvertConfigToSplit converts a ConfigDTO to a SplitDTO
func ConvertConfigToSplit(config ConfigDTO) SplitDTO {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

you need to extract variants element as well, see comment below

import "encoding/json"

// ConfigDTO represents a configuration definition fetched from the /configs endpoint
type ConfigDTO struct {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

same here, missing variants and targeting elements

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.

2 participants