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: update type of some field of Project struct to match response from deps.dev API #71

Merged
merged 3 commits into from
May 17, 2024

Conversation

zaibon
Copy link
Contributor

@zaibon zaibon commented May 16, 2024

fixes #70

@auto-assign auto-assign bot requested a review from edoardottt May 16, 2024 12:40
@edoardottt edoardottt changed the base branch from main to devel May 16, 2024 14:38
@edoardottt
Copy link
Owner

Hi @zaibon. I've changed the base form main to devel. There are some conflicts that need to be resolved.

@zaibon zaibon force-pushed the project-types branch 3 times, most recently from 1b2c788 to 38276d9 Compare May 16, 2024 15:03
@zaibon
Copy link
Contributor Author

zaibon commented May 16, 2024

@edoardottt Thanks, I've didn't see the devel branch. So I've rebased on it and fixed the conflict.

"github.com/stretchr/testify/require"
)

var (
api = depsdev.NewV3API()
)

func TestGetProject(t *testing.T) {
Copy link
Owner

Choose a reason for hiding this comment

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

Unreliable. If someone stars the repo or fork it the test will fail

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Make sense, I've updated the test to skip comparing actual value.

OpenIssuesCount string `json:"openIssuesCount,omitempty"`
StarsCount string `json:"starsCount,omitempty"`
ForksCount string `json:"forksCount,omitempty"`
OpenIssuesCount int `json:"openIssuesCount,omitempty"`
Copy link
Owner

Choose a reason for hiding this comment

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

It would be better to change all the occurences of this issue. For example,

Score string `json:"score,omitempty"`
should be a number as far as I can see in the docs.
What do you think?

Copy link
Owner

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've added some other type fixe I could find. Any other I've missed?

@edoardottt edoardottt self-assigned this May 17, 2024
@edoardottt edoardottt self-requested a review May 17, 2024 14:24
Copy link
Owner

@edoardottt edoardottt left a comment

Choose a reason for hiding this comment

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

lgtm

@edoardottt edoardottt merged commit 47f5f63 into edoardottt:devel May 17, 2024
5 checks passed
@zaibon zaibon deleted the project-types branch May 28, 2024 16:11
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.

Project structure contains field with wrong type
2 participants