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

feat: new CodeQL variants analysis, [GET] user by accountId, projects v2 status update endpoints, new code scanning repository rule, BREAKING CHANGE: removed release-released webhook, description updates #452

Merged
merged 45 commits into from
Nov 6, 2024

Conversation

octokitbot
Copy link
Collaborator

@octokitbot octokitbot commented May 13, 2024

BREAKING CHANGE: Removed release-released webhook

@octokitbot octokitbot added the Type: Maintenance Any dependency, housekeeping, and clean up Issue or PR label May 13, 2024
@wolfy1339 wolfy1339 changed the title 🤖📯 GitHub OpenAPI Update feat: new CodeQL variants analysis endpoints, new code scanning repository rule, description updates, removes Copilot usage metrics endpoint May 13, 2024
@wolfy1339
Copy link
Member

wolfy1339 commented May 13, 2024

Was the /orgs/{org}/team/{team_slug}/copilot/usage endpoint intentionally removed?

@wolfy1339
Copy link
Member

I can't get the update_dry_run workflow to trigger. This will need to be merged manually @gr2m @kfcampbell @nickfloyd

@wolfy1339 wolfy1339 added the Type: Breaking change Used to note any change that requires a major version bump label May 13, 2024
@kfcampbell
Copy link
Member

kfcampbell commented May 13, 2024

The update_dry_run check hasn't worked in some time; we've been merging without it.

I don't have any knowledge on the Copilot API changes, though I suppose I would trust the process unless I had a reason to doubt it.

@wolfy1339 are you comfortable with me merging as-is (with a breaking change in the commit message body)?

@gr2m
Copy link
Contributor

gr2m commented May 13, 2024

I would suggest to add a deprecation like https://github.com/octokit/openapi/blob/main/changes/2021-04-30-operation-code-scanning-list-alert-instances.json, if the endpoint is infact being deprecated. If we remove an endpoint without a breaking change then people will run into cryptic TypeScript errors when using https://github.com/octokit/plugin-rest-endpoint-methods.js (used by octokit, @octokit/rest, probot, ...), when the plugin version and the types version get out of sync. Adding the endpoint back with a note should prevent these problems and provide a better DX

@wolfy1339
Copy link
Member

The copilot endpoints are in beta, and are subject to change. I don't see this endpoint anywhere in the docs

@gr2m
Copy link
Contributor

gr2m commented May 15, 2024

@kfcampbell can you find out what the status is with the endpoint? If we can expect it to be re-released soon again, I'd vote for not removing it temporarily

@kfcampbell
Copy link
Member

I'm sorry, this slipped through the cracks for me. I've asked and will report back when I hear anything.

@kfcampbell
Copy link
Member

It was intended to be a temporary decision to unship the endpoint; it will be added back in the near future. We should probably not remove it across all our repos at this point.

@wolfy1339
Copy link
Member

@kfcampbell Do you have any update for the /orgs/{org}/team/{team_slug}/copilot/usage endpoint

@wolfy1339
Copy link
Member

@kfcampbell @nickfloyd Hi, is there any update for the issue blocking this PR

@kfcampbell
Copy link
Member

@wolfy1339 sorry for the delay! The endpoint is back in our specification but marked as "public beta". It's visible in github/rest-api-description if you search for the operationId copilot/usage-metrics-for-team. Here's the YAML:

  "/orgs/{org}/team/{team_slug}/copilot/usage":
    get:
      summary: Get a summary of Copilot usage for a team
      description: |-
        > [!NOTE]
        > This endpoint is in public preview and is subject to change.

        You can use this endpoint to see a daily breakdown of aggregated usage metrics for Copilot completions and Copilot Chat in the IDE
        for users within a team, with a further breakdown of suggestions, acceptances, and number of active users by editor and language for each day.
        See the response schema tab for detailed metrics definitions.

        The response contains metrics for up to 28 days prior. Usage metrics are processed once per day for the previous day,
        and the response will only include data up until yesterday. In order for an end user to be counted towards these metrics,
        they must have telemetry enabled in their IDE.

        > [!NOTE]
        > This endpoint will only return results for a given day if the team had five or more members with active Copilot licenses, as evaluated at the end of that day.

        Organization owners for the organization that contains this team, and owners and billing managers of the parent enterprise can view Copilot usage metrics for a team.

        OAuth app tokens and personal access tokens (classic) need either the `manage_billing:copilot`, `read:org`, or `read:enterprise` scopes to use this endpoint.
      tags:
      - copilot
      operationId: copilot/usage-metrics-for-team
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/rest/copilot/copilot-usage#get-a-summary-of-copilot-usage-for-a-team
      parameters:
      - "$ref": "#/components/parameters/org"
      - "$ref": "#/components/parameters/team-slug"
      - name: since
        description: Show usage metrics since this date. This is a timestamp in [ISO
          8601](https://en.wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:MM:SSZ`).
          Maximum value is 28 days ago.
        in: query
        required: false
        schema:
          type: string
      - name: until
        description: Show usage metrics until this date. This is a timestamp in [ISO
          8601](https://en.wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:MM:SSZ`)
          and should not preceed the `since` date if it is passed.
        in: query
        required: false
        schema:
          type: string
      - "$ref": "#/components/parameters/page"
      - name: per_page
        description: The number of days of metrics to display per page (max 28). For
          more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)."
        in: query
        schema:
          type: integer
          default: 28
      responses:
        '200':
          description: Response
          content:
            application/json:
              schema:
                type: array
                items:
                  "$ref": "#/components/schemas/copilot-usage-metrics"
              examples:
                default:
                  "$ref": "#/components/examples/copilot-usage-metrics-org"
        '500':
          "$ref": "#/components/responses/internal_error"
        '401':
          "$ref": "#/components/responses/requires_authentication"
        '403':
          "$ref": "#/components/responses/forbidden"
        '404':
          "$ref": "#/components/responses/not_found"
      x-github:
        githubCloudOnly: false
        enabledForGitHubApps: true
        category: copilot
        subcategory: copilot-usage

@wolfy1339
Copy link
Member

That is great to hear

@nickfloyd
Copy link
Contributor

Just to make sure I didn't miss any outstanding concerns - is everyone good with this being merged given the endpoint evidence above?

@wolfy1339
Copy link
Member

I'm all for merging this. The diff needs to be double checked to ensure no breaking changes are introduced and to get a better idea of new features that were added

@wolfy1339 wolfy1339 changed the title feat: new CodeQL variants analysis endpoints, new code scanning repository rule, description updates, removes Copilot usage metrics endpoint feat: new CodeQL variants analysis endpoints, new code scanning repository rule, description updates Nov 6, 2024
@nickfloyd
Copy link
Contributor

The diff needs to be double checked to ensure no breaking changes are introduced and to get a better idea of new features that were added

Doing that now locally. I'll update the description based on what I find. Thanks, as always, for your help on this one @wolfy1339 & @gr2m ❤️

@nickfloyd nickfloyd changed the title feat: new CodeQL variants analysis endpoints, new code scanning repository rule, description updates feat: new CodeQL variants analysis, [GET] user, endpoints, new code scanning repository rule, description updates Nov 6, 2024
@nickfloyd nickfloyd removed the Status: Blocked Some technical or requirement is blocking the issue label Nov 6, 2024
@nickfloyd nickfloyd changed the title feat: new CodeQL variants analysis, [GET] user, endpoints, new code scanning repository rule, description updates feat: new CodeQL variants analysis, [GET] user by accountId, projects v2 status update endpoints, new code scanning repository rule, removed release-released endpoint [post] description updates Nov 6, 2024
@nickfloyd nickfloyd changed the title feat: new CodeQL variants analysis, [GET] user by accountId, projects v2 status update endpoints, new code scanning repository rule, removed release-released endpoint [post] description updates feat: new CodeQL variants analysis, [GET] user by accountId, projects v2 status update endpoints, new code scanning repository rule, BREAKING CHANGE: removed release-released endpoint [post] description updates Nov 6, 2024
@nickfloyd nickfloyd changed the title feat: new CodeQL variants analysis, [GET] user by accountId, projects v2 status update endpoints, new code scanning repository rule, BREAKING CHANGE: removed release-released endpoint [post] description updates feat: new CodeQL variants analysis, [GET] user by accountId, projects v2 status update endpoints, new code scanning repository rule, BREAKING CHANGE: removed release-released webhook, [post] description updates Nov 6, 2024
@nickfloyd nickfloyd changed the title feat: new CodeQL variants analysis, [GET] user by accountId, projects v2 status update endpoints, new code scanning repository rule, BREAKING CHANGE: removed release-released webhook, [post] description updates feat: new CodeQL variants analysis, [GET] user by accountId, projects v2 status update endpoints, new code scanning repository rule, BREAKING CHANGE: removed release-released webhook, description updates Nov 6, 2024
@nickfloyd nickfloyd merged commit f7d3c9c into main Nov 6, 2024
1 check passed
@nickfloyd nickfloyd deleted the update branch November 6, 2024 17:27
@wolfy1339
Copy link
Member

We aren't concerned with webhooks in this repository

@nickfloyd
Copy link
Contributor

We aren't concerned with webhooks in this repository
I completely forgot about that. Hopefully the version bump won't create too much noise. Let me know if you think it's a concern.

@wolfy1339
Copy link
Member

It will be fine

@octokitbot
Copy link
Collaborator Author

🎉 This issue has been resolved in version 17.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@gr2m
Copy link
Contributor

gr2m commented Nov 7, 2024

I'd say it's valid to release a breaking change if the spec itself removed something. The breaking change should not cause more noise than a feature release to all the auto-generated code updates that only care about REST APIs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released Type: Breaking change Used to note any change that requires a major version bump Type: Maintenance Any dependency, housekeeping, and clean up Issue or PR
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

5 participants