google / go-github

Go library for accessing the GitHub v3 API

Home Page:https://pkg.go.dev/github.com/google/go-github/v62/github

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Update deprecated endpoints in github/action_variables.go

HariCharan-001 opened this issue · comments

$ ./script/metadata.sh update-go
could not find operation "GET /repositories/{repository_id}/environments/{environment_name}/variables" in openapi_operations.yaml
could not find operation "GET /repositories/{repository_id}/environments/{environment_name}/variables/{name}" in openapi_operations.yaml
could not find operation "POST /repositories/{repository_id}/environments/{environment_name}/variables" in openapi_operations.yaml
could not find operation "PATCH /repositories/{repository_id}/environments/{environment_name}/variables/{name}" in openapi_operations.yaml
could not find operation "DELETE /repositories/{repository_id}/environments/{environment_name}/variables/{name}" in openapi_operations.yaml

The official GitHub v3 API documentation has moved the endpoints above and now needs updating.

Detailed discussion around this can be traced to comments under #3102

I'm working on a fix. Just giving a heads-up to avoid duplicate work.

@gmlewis

Quick question on backward compatibility. Should we keep the older function signatures as they are and return an error "This endpoint has been moved, please use this new function instead" ?

I feel it's unnecessary, as the older API does not work anyway.

If we can keep the same API and not break it, but just use the new endpoint URL, that would be ideal.

However, if the old API is broken anyway, and you need to break the API, then that's OK, just not ideal.

The old API is broken anyway. We have to take a new parameter, github-userId, from the user to feed to the updated endpoint URL.

I raised a PR.

Also, it looks like this check has been failing for quite a few PRs recently, even some merged ones. Not sure why, bringing to your notice just in case.

Screenshot 2024-03-16 at 6 30 05 AM