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

Commit Search by ItemPath Not Functional #538

Open
emagers opened this issue Dec 16, 2024 · 0 comments
Open

Commit Search by ItemPath Not Functional #538

emagers opened this issue Dec 16, 2024 · 0 comments

Comments

@emagers
Copy link

emagers commented Dec 16, 2024

The following API returns a list of commits whose changed items match the input search criteria: https://<host>/<org>/<project>/_apis/git/repositories/<repo>/commits/?searchCriteria.fromDate=<date>&searchCriteria.itemPath=<itemPath>&api-version=7.1

When deserializing the response, the operation fails because there is no item property in the Change object, when it is not an optional field on the struct.

Here is an example of the response demonstrating that it does not return the item property:

{
  "count": 1,
  "value": [
    {
      "commitId": "<commitId>",
      "author": {
        "name": "<name>",
        "email": "<email>",
        "date": "<date>"
      },
      "committer": {
        "name": "<name>",
        "email": "<email>",
        "date": "<date>"
      },
      "comment": "<comment>",
      "commentTruncated": true,
      "changeCounts": {
        "Add": 0,
        "Edit": 4,
        "Delete": 0
      },
      "changes": [
        {
          "sourceServerItem": "<itemPath>",
          "changeType": "edit"
        }
      ],
      "url": "<url>",
      "remoteUrl": "<url>"
    }
  ]
}

The API spec for Change does not require the item property:

https://github.com/MicrosoftDocs/vsts-rest-api-specs/blob/54ebb504ec31877991e385e0c699ab2bd6e62ab4/specification/git/7.1/git.json#L10480C1-L10484C11

The httpExamples do not include the item property (and this matches the real observed response): https://github.com/MicrosoftDocs/vsts-rest-api-specs/blob/54ebb504ec31877991e385e0c699ab2bd6e62ab4/specification/git/7.1/httpExamples/commits/GET__git_repositories__repositoryId__commits_commit_itemPath-_itemPath_.json

However, the vsts-api-patcher is modifying the spec to require it:

https://github.com/microsoft/azure-devops-rust-api/blob/98447bb5e0ea2a43731dd7dc87a816c5dfea31ca/vsts-api-patcher/src/patcher.rs#L1190C1-L1190C27

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

No branches or pull requests

1 participant