Skip to content
This repository was archived by the owner on Jun 13, 2025. It is now read-only.

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!

@github-actions
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

@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 (a0c8267) to head (3ac41b8).
Report is 1 commits behind head on main.

✅ 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       19504    19557      +53     
==========================================
+ Hits        18729    18782      +53     
  Misses        775      775              
Flag Coverage Δ
unit 92.34% <100.00%> (+0.02%) ⬆️
unit-latest-uploader 92.34% <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
"bundles": [{"bundleName": "pr_bundle1", "toggleCaching": True}],
},
)
assert data == {"updateBundleCacheConfig": {"results": [], "error": None}}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this return the bundles that were updated?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nah this test is just to test the mutation, the UpdateBundleCacheConfigInteractor is being mocked, and that is being tested in the other test class.

@JerrySentry JerrySentry added this pull request to the merge queue Jan 10, 2025
Merged via the queue into main with commit e3a2467 Jan 10, 2025
19 checks passed
@JerrySentry JerrySentry deleted the jan_06_cache_config branch January 10, 2025 22:28
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[API] Make GQL mutation to enable/disable bundles

3 participants