Skip to content
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

feat(entities): Support custom attributes JSON #1526

Merged
merged 13 commits into from
Oct 30, 2023

Conversation

amolero-nr
Copy link
Contributor

Supports JSON strings for --customAttributes for deployment markers. Ref: NR-165686.

@codecov
Copy link

codecov bot commented Oct 25, 2023

Codecov Report

Merging #1526 (ed2172c) into main (139975f) will increase coverage by 0.07%.
The diff coverage is 58.33%.

@@            Coverage Diff             @@
##             main    #1526      +/-   ##
==========================================
+ Coverage   47.40%   47.48%   +0.07%     
==========================================
  Files         125      125              
  Lines        7716     7742      +26     
==========================================
+ Hits         3658     3676      +18     
- Misses       3917     3925       +8     
  Partials      141      141              
Files Coverage Δ
internal/entities/command_deployment.go 56.66% <58.33%> (+5.10%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@amolero-nr amolero-nr changed the title Feat/custom attributes json feat(entities): Support custom attributes JSON Oct 26, 2023
@@ -127,3 +142,23 @@ func parseCustomAttributes(a *[]string) (*map[string]string, error) {

return &customAttributeMap, nil
}

func getCustomAttributes(a []string, b string) (interface{}, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we make this function always return *map[string]interface{} or map[string]interface{} instead of interface{}? Then you won't need to use the switch statement.

Copy link
Contributor

Choose a reason for hiding this comment

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

:butting-in-emoji: map[string]interface{}'s zero value is nil since it's a reference type, so no need for*map[string]interface{}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, done in ed2172c

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.

None yet

3 participants