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

fix(tapd): fix errors when configrating scopes #6236

Closed
wants to merge 5 commits into from

Conversation

d4x1
Copy link
Contributor

@d4x1 d4x1 commented Oct 12, 2023

⚠️ Pre Checklist

Please complete ALL items in this checklist, and remove before submitting

  • I have read through the Contributing Documentation.
  • I have added relevant tests.
  • I have added relevant documentation.
  • I will add labels to the PR, such as pr-type/bug-fix, pr-type/feature-development, etc.

Summary

What does this PR do?
TAPD's api return something like:

{
    "status": 1,
    "data":
    [
        {
            "Workspace":
            {
                "id": "55850509",
                "name": "xx",
                "pretty_name": "55850509",
                "description": "",
                "status": "normal",
                "parent_id": "1",
                "secrecy": "0",
                "created": "2020-11-15 16:34:28",
                "creator_id": "1093132487",
                "creator": "abc",
                "begin_date": null,
                "end_date": null,
                "member_count": 28
            }
        }
    ],
    "info": "success"

id and parent_id is a string which can be parsed to uint64. Devlake's code regard these two fields as uint64.
So I extract type StringUint64, adapt to TAPD's API resp.

Does this close any open issues?

Closes N/A

Screenshots

Include any relevant screenshots here.

Other Information

Any other information that is important to this PR.

decodeHook,
}

func decodeHookStringUint64(f reflect.Type, t reflect.Type, data interface{}) (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.

according https://github.com/mitchellh/mapstructure/blob/main/mapstructure_examples_test.go#L123 mapstructure should support decoding string into int. This should not be needed, please confirm if it is necessary.

@d4x1
Copy link
Contributor Author

d4x1 commented Oct 13, 2023

#6239 fix this problem in a simple way.

@d4x1 d4x1 closed this Oct 13, 2023
@d4x1 d4x1 added the pr-type/bug-fix This PR fixes a bug label Oct 26, 2023
@d4x1 d4x1 added this to the v0.20 milestone Oct 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-type/bug-fix This PR fixes a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants