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

Bundle Analysis: Add mutation for toggling bundle caching configuration #1084

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

JerrySentry
Copy link
Contributor

@JerrySentry JerrySentry commented Jan 7, 2025

closes codecov/engineering-team#3073

Add a mutation to update the bundle analysis cache config table.

Schema:

input BundleCacheConfigInput {
  bundleName: String!
  toggleCaching: Boolean!
}

input UpdateBundleCacheConfigInput {
  owner: String!
  repoName: String!
  bundles: [BundleCacheConfigInput!]!
}

union UpdateBundleCacheConfigError = UnauthenticatedError | ValidationError

type UpdateBundleCacheConfigResult {
  bundleName: String
  isCached: Boolean
}

type UpdateBundleCacheConfigPayload {
  results: [UpdateBundleCacheConfigResult!]
  error: UpdateBundleCacheConfigError
}


type Mutation {
  updateBundleCacheConfig(input: UpdateBundleCacheConfigInput!): UpdateBundleCacheConfigPayload
}

Example usage:

{
    "owner":"Owens",
    "repoName":"Ropert",
    "bundles": [{
        "bundleName": "pr_bundle1",
        "toggleCaching": true
    },{
        "bundleName": "pr_bundle2",
        "toggleCaching": false
    }]
}

mutation UpdateBundleCacheConfig(
    $owner: String!
    $repoName: String!
    $bundles: [BundleCacheConfigInput!]!
) {
    updateBundleCacheConfig(input: {
        owner: $owner,
        repoName: $repoName,
        bundles: $bundles 
    }) {
        results {
            bundleName
            isCached
        }
        error {
            __typename
            ... on UnauthenticatedError {
                message
            }
            ... on ValidationError {
                message
            }
        }
    }
}


Response
{
    "data": {
        "updateBundleCacheConfig": {
            "results": [
                {
                    "bundleName": "pr_bundle1",
                    "isCached": true
                },
                {
                    "bundleName": "pr_bundle2",
                    "isCached": false
                }
            ],
            "error": null
        }
    }
}

Legal Boilerplate

Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. In 2022 this entity acquired Codecov and as result Sentry is going to need some rights from me in order to utilize my contributions in this PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.

@codecov-notifications
Copy link

codecov-notifications bot commented Jan 7, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

Copy link
Contributor

github-actions bot commented Jan 7, 2025

✅ All tests successful. No failed tests were found.

📣 Thoughts on this report? Let Codecov know! | Powered by Codecov

Copy link

codecov bot commented Jan 7, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.03%. Comparing base (d501c77) to head (63f9ac9).

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1084      +/-   ##
==========================================
+ Coverage   96.02%   96.03%   +0.01%     
==========================================
  Files         828      831       +3     
  Lines       19476    19528      +52     
==========================================
+ Hits        18702    18754      +52     
  Misses        774      774              
Flag Coverage Δ
unit 92.33% <100.00%> (+0.02%) ⬆️
unit-latest-uploader 92.33% <100.00%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@JerrySentry JerrySentry marked this pull request as ready for review January 8, 2025 00:22
@JerrySentry JerrySentry requested a review from a team as a code owner January 8, 2025 00:22
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

Successfully merging this pull request may close these issues.

[API] Make GQL mutation to enable/disable bundles
1 participant