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

Code of Conduct API preview is being deprecated #343

Open
HowardWolosky opened this issue Oct 7, 2021 · 0 comments
Open

Code of Conduct API preview is being deprecated #343

HowardWolosky opened this issue Oct 7, 2021 · 0 comments
Labels
api-repositories Work to complete the API's defined here: https://developer.github.com/v3/repos/ good first issue If you're new to the project (or to OSS in general) and you'd like to contribute, try this one. help wanted Anyone in the community is welcome to do this work up for grabs Anyone in the community is welcome to do this work

Comments

@HowardWolosky
Copy link
Member

Issue Details

Just received a heads-up from GitHub that the Code of Conduct API preview which uses the scarlet-witch-preview header is being deprecated on December 6, 2021.

Deprecation Notice: https://github.blog/changelog/2021-10-06-deprecation-notice-codes-of-conduct-api-preview/

It is suggested to migrate to the Get community profile metrics endpoint to retrieve this information.

Suggested Next Steps

It looks like we definitely need to do the following:

  • Implement Get-GitHubCommunityProfileMetrics per the new API

Then we need to do one of these two things:

  1. Deprecate GetGitHubCodeOfConduct since it uses an API endpoint that is going away.
    or
  2. Modify Get-GitHubCodeOfConduct to use Get-GitHubCommunityProfileMetrics behind the scenes, and put the return content into the same format. This should be mostly straight-forward as most of the same data is being returned by the new API, with the exception of body and CodeOfConductKey... That means the body would have to be retrieved with an additional query after the Get-GitHubCommunityProfileMetrics call, and the $Key parameter would have to be deprecated entirely since there is no equivalent way to get that information with the new API.

My preference would be doing 2.

Reference data

This is the current output of Get-GitHubCommunityProfileMetrics for microsoft/PowerShellForGitHub

{
    "health_percentage":  85,
    "description":  "Microsoft PowerShell wrapper for GitHub API",
    "documentation":  null,
    "files":  {
                  "code_of_conduct":  {
                                          "key":  "other",
                                          "name":  "Other",
                                          "html_url":  "https://github.com/microsoft/PowerShellForGitHub/blob/master/CODE_OF_CONDUCT.md",
                                          "url":  "https://api.github.com/repos/microsoft/PowerShellForGitHub/community/code_of_conduct"
                                      },
                  "code_of_conduct_file":  {
                                               "url":  "https://api.github.com/repos/microsoft/PowerShellForGitHub/contents/CODE_OF_CONDUCT.md",
                                               "html_url":  "https://github.com/microsoft/PowerShellForGitHub/blob/master/CODE_OF_CONDUCT.md"
                                           },
                  "contributing":  {
                                       "url":  "https://api.github.com/repos/microsoft/PowerShellForGitHub/contents/CONTRIBUTING.md",
                                       "html_url":  "https://github.com/microsoft/PowerShellForGitHub/blob/master/CONTRIBUTING.md"
                                   },
                  "issue_template":  null,
                  "pull_request_template":  {
                                                "url":  "https://api.github.com/repos/microsoft/PowerShellForGitHub/contents/.github/PULL_REQUEST_TEMPLATE.md",
                                                "html_url":  "https://github.com/microsoft/PowerShellForGitHub/blob/master/.github/PULL_REQUEST_TEMPLATE.md"
                                            },
                  "license":  {
                                  "key":  "other",
                                  "name":  "Other",
                                  "spdx_id":  "NOASSERTION",
                                  "url":  null,
                                  "node_id":  "MDc6TGljZW5zZTA=",
                                  "html_url":  "https://github.com/microsoft/PowerShellForGitHub/blob/master/LICENSE"
                              },
                  "readme":  {
                                 "url":  "https://api.github.com/repos/microsoft/PowerShellForGitHub/contents/README.md",
                                 "html_url":  "https://github.com/microsoft/PowerShellForGitHub/blob/master/README.md"
                             }
              },
    "updated_at":  "\/Date(1631741244000)\/",
    "content_reports_enabled":  false
}

and this is the current result for Get-GitHubCodeOfConduct -OwnerName microsoft -RepositoryName PowerShellForGitHub

{
    "key":  "other",
    "name":  "Other",
    "html_url":  "https://github.com/microsoft/PowerShellForGitHub/blob/master/CODE_OF_CONDUCT.md",
    "url":  "https://api.github.com/repos/microsoft/PowerShellForGitHub/community/code_of_conduct",
    "body":  "# PowerShellForGitHub PowerShell Module\n\n## Code of Conduct\n\nThis project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).\nFor more information see the [Code of conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/)\nor contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions\nor comments.\n",
    "CodeOfConductKey":  "other"
}
@HowardWolosky HowardWolosky added up for grabs Anyone in the community is welcome to do this work help wanted Anyone in the community is welcome to do this work good first issue If you're new to the project (or to OSS in general) and you'd like to contribute, try this one. api-repositories Work to complete the API's defined here: https://developer.github.com/v3/repos/ labels Oct 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api-repositories Work to complete the API's defined here: https://developer.github.com/v3/repos/ good first issue If you're new to the project (or to OSS in general) and you'd like to contribute, try this one. help wanted Anyone in the community is welcome to do this work up for grabs Anyone in the community is welcome to do this work
Projects
None yet
Development

No branches or pull requests

1 participant