Skip to content

Conversation

@stephenotalora
Copy link
Contributor

@stephenotalora stephenotalora commented Nov 6, 2025

BREAKING CHANGE: UpdateProjectItemOptions.Field is now []*ProjectV2FieldUpdate.

Discovered these issues while integrating the related project item APIs exposed in V77.

Fixes bugs in the implementation of support for field selection and updates in the following project item endpoints:

  • Properly handles URL parameters for field selection in GetOrganizationProjectItem and GetUserProjectItem.
  • Corrects field update struct and request payload formatting in UpdateOrganizationProjectItem and UpdateUserProjectItem.

Adds or updates tests to verify correct handling of these cases.

Covers:
https://docs.github.com/en/rest/projects/items?apiVersion=2022-11-28

Related REST API docs:

Complements: #3793

@stephenotalora stephenotalora changed the title Stephenotalora/get and patch project item fix fix: field selection and update bugs in project item GET/PATCH endpoints Nov 6, 2025
@stephenotalora stephenotalora marked this pull request as ready for review November 6, 2025 23:55
@codecov
Copy link

codecov bot commented Nov 7, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.28%. Comparing base (1b0a91c) to head (98c0d60).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3809   +/-   ##
=======================================
  Coverage   92.27%   92.28%           
=======================================
  Files         192      192           
  Lines       13896    13902    +6     
=======================================
+ Hits        12823    12829    +6     
  Misses        884      884           
  Partials      189      189           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@gmlewis gmlewis changed the title fix: field selection and update bugs in project item GET/PATCH endpoints fix!: Fix field selection and bugs in ProjectsV2 GET endpoints Nov 7, 2025
@gmlewis gmlewis added NeedsReview PR is awaiting a review before merging. Breaking API Change PR will require a bump to the major version num in next release. Look here to see the change(s). bug labels Nov 7, 2025
Copy link
Collaborator

@gmlewis gmlewis left a comment

Choose a reason for hiding this comment

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

Thank you, @stephenotalora!
Please add testBadOptions to all your new unit tests to improve the code coverage.

@stephenotalora
Copy link
Contributor Author

Thank you, @stephenotalora! Please add testBadOptions to all your new unit tests to improve the code coverage.

Good catch, @gmlewis 🙇🏼 fixed! I was deep in the bug fixes and glossed over that. 👍

Copy link
Collaborator

@gmlewis gmlewis left a comment

Choose a reason for hiding this comment

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

Thank you, @stephenotalora!
LGTM.
Awaiting second LGTM+Approval from any other contributor to this repo before merging.

cc: @stevehipwell - @alexandear - @zyfy29

// It contains the field ID and the new value to set.
//
// GitHub API docs: https://docs.github.com/rest/projects/items#update-project-item-for-organization
type ProjectV2FieldUpdate struct {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not?

Suggested change
type ProjectV2FieldUpdate struct {
type UpdateProjectV2Field struct {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Breaking API Change PR will require a bump to the major version num in next release. Look here to see the change(s). bug NeedsReview PR is awaiting a review before merging.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants