Skip to content

Conversation

@DaleSeo
Copy link
Contributor

@DaleSeo DaleSeo commented Sep 8, 2025

This PR adds codecov.yml to set up Codecov with specific coverage targets and quality standards. It helps define clear expectations for code quality. It also includes some documentation about code coverage in CONTRIBUTING.md and adds the Codecov badge to README.md.

@apollo-librarian
Copy link

apollo-librarian bot commented Sep 8, 2025

✅ Docs preview ready

The preview is ready to be viewed. View the preview

File Changes

0 new, 1 changed, 0 removed
* (developer-tools)/apollo-mcp-server/(latest)/limitations.mdx

Build ID: 16251535d9ba8d25327bb1e2
Build Logs: View logs

URL: https://www.apollographql.com/docs/deploy-preview/16251535d9ba8d25327bb1e2

@github-actions
Copy link

github-actions bot commented Sep 8, 2025

Changeset file missing for PR

All changes should include an associated changeset file.
Please refer to README for more information on generating changesets.

@github-actions
Copy link

github-actions bot commented Sep 8, 2025

Changeset file missing for PR

All changes should include an associated changeset file.
Please refer to README for more information on generating changesets.

1 similar comment
@github-actions
Copy link

github-actions bot commented Sep 8, 2025

Changeset file missing for PR

All changes should include an associated changeset file.
Please refer to README for more information on generating changesets.

@github-actions
Copy link

github-actions bot commented Sep 9, 2025

Changeset file missing for PR

All changes should include an associated changeset file.
Please refer to README for more information on generating changesets.

@github-actions
Copy link

github-actions bot commented Sep 9, 2025

Changeset file missing for PR

All changes should include an associated changeset file.
Please refer to README for more information on generating changesets.

@github-actions
Copy link

github-actions bot commented Sep 9, 2025

Changeset file missing for PR

All changes should include an associated changeset file.
Please refer to README for more information on generating changesets.

@DaleSeo DaleSeo changed the title feat: add codecov badge Configure Codecov with coverage targets Sep 9, 2025
}
}

#[cfg(test)]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added tests for untested code to verify that the Codecov configuration is working as expected.

Image

https://app.codecov.io/github/apollographql/apollo-mcp-server/pull/337

patch:
default:
# Require 80% coverage on all new/modified code
target: 80%
Copy link
Contributor Author

@DaleSeo DaleSeo Sep 9, 2025

Choose a reason for hiding this comment

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

I set the patch coverage target at 80% to begin with since that seems to be a reasonable standard in other Apollo projects. If anyone thinks this is too high or not realistic for our codebase, please let me know. Just to clarify, this requirement only applies to new or modified code, not untouched code.

Image

Copy link
Contributor

Choose a reason for hiding this comment

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

80% seems fine to me. Is this possible to be overridden in the case where the SDK makes it near impossible to test, or we are rushing a hotfix?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@swcollard We can use the ‎#[coverage(off)] attribute from ‎llvm-cov to exclude specific functions or modules from coverage reporting.

#![cfg_attr(coverage_nightly, feature(coverage_attribute))]

// function
#[cfg_attr(coverage_nightly, coverage(off))]
fn exclude_fn_from_coverage() {
    // ...
}

// module
#[cfg_attr(coverage_nightly, coverage(off))]
mod exclude_mod_from_coverage {
    // ...
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I made a Confluence page and added this for future reference.

jobs:
verify-changeset:
if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip-changeset') && !startsWith(github.head_ref, 'sync/') && !startsWith(github.head_ref, 'conflict/') }}
if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip-changeset') && !startsWith(github.head_ref, 'sync/') && !startsWith(github.head_ref, 'conflict/') && !github.event.pull_request.draft }}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I often find it difficult to decide what to write when drafting a PR. This will help reduce the comment noises on draft PRs.

Copy link
Contributor

Choose a reason for hiding this comment

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

In this case, should it have flagged this PR once it was moved out of draft status?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for catching this! I'll update the workflow to include the ready_for_review event so it will trigger automatically when a PR is converted from draft to ready for review.

Copy link
Contributor Author

@DaleSeo DaleSeo Sep 9, 2025

Choose a reason for hiding this comment

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

I tested the updated workflow on this PR.

When I removed the changeset and marked the PR as draft, the workflow correctly skipped verifying the changeset.

2025-09-09 at 14 20 28

After marking the PR as ready for review, the verification ran and the expected comment was added.

2025-09-09 at 14 22 46

@DaleSeo DaleSeo marked this pull request as ready for review September 9, 2025 16:31
@DaleSeo DaleSeo requested a review from a team as a code owner September 9, 2025 16:31
@DaleSeo DaleSeo self-assigned this Sep 9, 2025
@DaleSeo DaleSeo requested a review from swcollard September 9, 2025 18:02
@DaleSeo DaleSeo marked this pull request as draft September 9, 2025 18:12
@DaleSeo DaleSeo marked this pull request as ready for review September 9, 2025 18:20
@github-actions
Copy link

github-actions bot commented Sep 9, 2025

Changeset file missing for PR

All changes should include an associated changeset file.
Please refer to README for more information on generating changesets.

@DaleSeo DaleSeo merged commit 18c1bf0 into develop Sep 9, 2025
15 checks passed
@DaleSeo DaleSeo deleted the GT-370-config branch September 9, 2025 19:41
@apollo-bot2 apollo-bot2 mentioned this pull request Sep 12, 2025
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.

3 participants