Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Use arrays rather than CSV#82

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
SamMorrowDrums merged 1 commit intomainfromwm/use-arrays-rather-than-csv
Apr 3, 2025

Conversation

williammartin
Copy link
Collaborator

@williammartinwilliammartin commentedApr 3, 2025
edited
Loading

Description

Fixes#31

Reviewer Notes

I added a new testing pattern for the tool implementations I changed because there was no safety around the outgoing requests being correct. I didn't roll it out everywhere because it's a big lift and a pattern I would want feedback on.

The README and description of these arrays isn't great, but I tried to follow the previous format.

@CopilotCopilotAI review requested due to automatic review settingsApril 3, 2025 18:56
Copy link
Contributor

@CopilotCopilotAI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates the issue creation, listing, and updating logic to use arrays (string[]) instead of comma-separated strings, addressing#31.

  • Removed CSV parsing helper functions and related tests.
  • Updated parameter definitions and test data in issues and server modules to accept arrays.
  • Updated README documentation to reflect the new API parameter types.

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
FileDescription
pkg/github/server_test.goRemoved CSV parsing tests in favor of array parameter usage
pkg/github/server.goRemoved CSV parsing helper functions and updated parameter handling
pkg/github/issues_test.goUpdated tests to send arrays for assignees, labels, and filter parameters
pkg/github/issues.goChanged parameter definitions from strings to arrays for labels/assignees
README.mdUpdated parameter descriptions to indicate arrays instead of CSV strings

Tip: Copilot only keeps its highest confidence comments to reduce noise and keep you focused.Learn more

@@ -426,8 +426,8 @@ func Test_CreateIssue(t *testing.T) {
"repo": "repo",
"title": "Test Issue",
"body": "This is a test issue",
"assignees": "user1, user2",
"labels": "bug, help wanted",
"assignees": []string{"user1, user2"},
Copy link
Preview

CopilotAIApr 3, 2025

Choose a reason for hiding this comment

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

The test input for the 'assignees' parameter is still a single string containing a comma-separated list instead of two separate array elements. Consider updating it to []string{"user1", "user2"} to reflect the new array format.

Suggested change
"assignees": []string{"user1,user2"},
"assignees": []string{"user1","user2"},

Copilot uses AI. Check for mistakes.

Copy link
CollaboratorAuthor

Choose a reason for hiding this comment

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

Interesting that no test failed.

SamMorrowDrums reacted with heart emoji
Copy link
CollaboratorAuthor

Choose a reason for hiding this comment

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

Right, it's a bit weird that we don't actually assert that the handler provided the correct arguments to the API:

mock.WithRequestMatchHandler(
mock.PostReposIssuesByOwnerByRepo,
mockResponse(t,http.StatusCreated,mockIssue),
),

Copy link
CollaboratorAuthor

Choose a reason for hiding this comment

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

I addressed this by adding some new request matching functionality:33d5752#diff-2e611e3b483afedad4fd22bdbefada38ac15d4d752b7d71e22b454e8e3800b5eR770-R779

SamMorrowDrums reacted with rocket emoji
@williammartinwilliammartinforce-pushed thewm/use-arrays-rather-than-csv branch 2 times, most recently from33d5752 toe9bf1f1CompareApril 3, 2025 19:48
Copy link
Collaborator

@SamMorrowDrumsSamMorrowDrums left a comment

Choose a reason for hiding this comment

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

If this is how things continue, I'm just gonna LGTM the rest! ;-)

@SamMorrowDrumsSamMorrowDrumsforce-pushed thewm/use-arrays-rather-than-csv branch frome9bf1f1 toe406c0fCompareApril 3, 2025 21:00
@SamMorrowDrumsSamMorrowDrums merged commitd01e705 intomainApr 3, 2025
16 checks passed
@SamMorrowDrumsSamMorrowDrums deleted the wm/use-arrays-rather-than-csv branchApril 3, 2025 21:10
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

Copilot code reviewCopilotCopilot left review comments

@SamMorrowDrumsSamMorrowDrumsSamMorrowDrums approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Revisit use of comma-separated lists
2 participants
@williammartin@SamMorrowDrums

[8]ページ先頭

©2009-2025 Movatter.jp