Skip to content

feat: Add support for extra fields on Person details#96

Merged
pawelsz-rb merged 4 commits into
masterfrom
pawel/extra_person
Jun 17, 2022
Merged

feat: Add support for extra fields on Person details#96
pawelsz-rb merged 4 commits into
masterfrom
pawel/extra_person

Conversation

@pawelsz-rb

@pawelsz-rb pawelsz-rb commented Jun 17, 2022

Copy link
Copy Markdown
Collaborator

Description of the change

(duplicate of #91)
This is to help achieve parody with the PHP SDK which allows for
additional fields to be specified on the Person object. We use this to
provide details like what account a specific user belongs to or other
additional internal metadata that is helpful when debugging user/account
level errors.

This is mainly mirroring what I saw in the PHP SDK here:

https://github.com/rollbar/rollbar-php/blob/89c9069e8532acb638f2fb9efd36b529ec25354f/src/Payload/Person.php#L68-L80

    public function serialize()
    {
        $result = array(
            "id" => $this->id,
            "username" => $this->username,
            "email" => $this->email,
        );
        foreach ($this->extra as $key => $val) {
            $result[$key] = $val;
        }
        
        return $this->utilities()->serializeForRollbarInternal($result, array_keys($this->extra));
    }

Type of change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Maintenance
  • New release

Related issues

From what I've seen there are not any GitHub issues for this.

Checklists

Development

  • Lint rules pass locally
    (I don't see any editor config or linting documentation in the README or anywhere else in the repo?)
  • The code changed/added as part of this pull request has been covered with tests
    (This code should be covered by existing unit tests, but happy to add a specific test for this code path)
  • All tests related to the changed code pass in development

Code review

  • This pull request has a descriptive title and information useful to a reviewer. There may be a screenshot or screencast attached
  • "Ready for review" label attached to the PR and reviewers assigned
  • Issue from task tracker has a link to this pull request
  • Changes have been reviewed by at least one other engineer

@ijsnow ijsnow left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Looks good, just one question

Comment thread rollbar.go Outdated

@ijsnow ijsnow left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Looks good!

@pawelsz-rb pawelsz-rb merged commit ea8fda4 into master Jun 17, 2022
@pawelsz-rb pawelsz-rb deleted the pawel/extra_person branch June 17, 2022 22:19
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