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

move shared change check to separate workflow with correct permissions #801

Merged
merged 2 commits into from
Sep 5, 2024

Conversation

matt-codecov
Copy link
Contributor

@matt-codecov matt-codecov commented Sep 5, 2024

codecov/gha-workflows#32 will change this to use main before merging

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.

Copy link
Contributor

github-actions bot commented Sep 5, 2024

@matt-codecov matt-codecov requested a review from a team September 5, 2024 18:54
@matt-codecov matt-codecov marked this pull request as ready for review September 5, 2024 18:54
@codecov-staging
Copy link

codecov-staging bot commented Sep 5, 2024

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!

@codecov-qa
Copy link

codecov-qa bot commented Sep 5, 2024

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
2271 1 2270 6
View the top 1 failed tests by shortest run time
graphql_api.tests.test_commit.TestCommit test_bundle_analysis_report
Stack Traces | 0.505s run time
self = <graphql_api.tests.test_commit.TestCommit testMethod=test_bundle_analysis_report>
get_storage_service = <MagicMock name='get_appropriate_storage_service' id='140666898906528'>

    @patch("graphql_api.dataloader.bundle_analysis.get_appropriate_storage_service")
    def test_bundle_analysis_report(self, get_storage_service):
        storage = MemoryStorageService({})
        get_storage_service.return_value = storage
    
        head_commit_report = CommitReportFactory(
            commit=self.commit, report_type=CommitReport.ReportType.BUNDLE_ANALYSIS
        )
    
        with open("..../tests/samples/head_bundle_report.sqlite", "rb") as f:
            storage_path = StoragePaths.bundle_report.path(
                repo_key=ArchiveService.get_archive_hash(self.repo),
                report_key=head_commit_report.external_id,
            )
            storage.write_file(get_bucket_name(), storage_path, f)
    
        query = """
            query FetchCommit($org: String!, $repo: String!, $commit: String!) {
                owner(username: $org) {
                    repository(name: $repo) {
                        ... on Repository {
                            commit(id: $commit) {
                                bundleAnalysisReport {
                                    __typename
                                    ... on BundleAnalysisReport {
                                        bundles {
                                            name
                                            assets {
                                                normalizedName
                                            }
                                            asset(name: "not_exist") {
                                                normalizedName
                                            }
                                            bundleData {
                                                loadTime {
                                                    threeG
                                                    highSpeed
                                                }
                                                size {
                                                    gzip
                                                    uncompress
                                                }
                                            }
                                            isCached
                                        }
                                        bundleData {
                                            loadTime {
                                                threeG
                                                highSpeed
                                            }
                                            size {
                                                gzip
                                                uncompress
                                            }
                                        }
                                        bundle(name: "not_exist") {
                                            name
                                            isCached
                                        }
                                        isCached
                                    }
                                    ... on MissingHeadReport {
                                        message
                                    }
                                }
                            }
                        }
                    }
                }
            }
        """
    
        variables = {
            "org": self.org.username,
            "repo": self.repo.name,
            "commit": self.commit.commitid,
        }
        data = self.gql_request(query, variables=variables)
        commit = data["owner"]["repository"]["commit"]
    
>       assert commit["bundleAnalysisReport"] == {
            "__typename": "BundleAnalysisReport",
            "bundles": [
                {
                    "name": "b1",
                    "assets": [
                        {"normalizedName": "assets/react-*.svg"},
                        {"normalizedName": "assets/index-*.css"},
                        {"normalizedName": "assets/LazyComponent-*.js"},
                        {"normalizedName": "assets/index-*.js"},
                        {"normalizedName": "assets/index-*.js"},
                    ],
                    "asset": None,
                    "bundleData": {
                        "loadTime": {
                            "threeG": 0,
                            "highSpeed": 0,
                        },
                        "size": {
                            "gzip": 0,
                            "uncompress": 20,
                        },
                    },
                    "isCached": False,
                },
                {
                    "name": "b2",
                    "assets": [
                        {"normalizedName": "assets/react-*.svg"},
                        {"normalizedName": "assets/index-*.css"},
                        {"normalizedName": "assets/LazyComponent-*.js"},
                        {"normalizedName": "assets/index-*.js"},
                        {"normalizedName": "assets/index-*.js"},
                    ],
                    "asset": None,
                    "bundleData": {
                        "loadTime": {
                            "threeG": 2,
                            "highSpeed": 0,
                        },
                        "size": {
                            "gzip": 0,
                            "uncompress": 200,
                        },
                    },
                    "isCached": False,
                },
                {
                    "name": "b3",
                    "assets": [
                        {"normalizedName": "assets/react-*.svg"},
                        {"normalizedName": "assets/index-*.css"},
                        {"normalizedName": "assets/LazyComponent-*.js"},
                        {"normalizedName": "assets/index-*.js"},
                        {"normalizedName": "assets/index-*.js"},
                    ],
                    "asset": None,
                    "bundleData": {
                        "loadTime": {
                            "threeG": 16,
                            "highSpeed": 0,
                        },
                        "size": {
                            "gzip": 1,
                            "uncompress": 1500,
                        },
                    },
                    "isCached": False,
                },
                {
                    "name": "b5",
                    "assets": [
                        {"normalizedName": "assets/react-*.svg"},
                        {"normalizedName": "assets/index-*.css"},
                        {"normalizedName": "assets/LazyComponent-*.js"},
                        {"normalizedName": "assets/index-*.js"},
                        {"normalizedName": "assets/index-*.js"},
                    ],
                    "asset": None,
                    "bundleData": {
                        "loadTime": {
                            "threeG": 2133,
                            "highSpeed": 53,
                        },
                        "size": {
                            "gzip": 200,
                            "uncompress": 200000,
                        },
                    },
                    "isCached": False,
                },
            ],
            "bundleData": {
                "loadTime": {
                    "threeG": 2151,
                    "highSpeed": 53,
                },
                "size": {
                    "gzip": 201,
                    "uncompress": 201720,
                },
            },
            "bundle": None,
            "isCached": False,
        }
E       AssertionError: assert {'__typename'...e, ...}], ...} == {'__typename'...e, ...}], ...}
E         
E         Omitting 4 identical items, use -vv to show
E         Differing items:
E         {'bundles': [{'asset': None, 'assets': [{'normalizedName': 'assets/index-*.js'}, {'normalizedName': 'assets/index-*.js...{'loadTime': {'highSpeed': 53, 'threeG': 2133}, 'size': {'gzip': 200, 'uncompress': 200000}}, 'isCached': False, ...}]} != {'bundles': [{'asset': None, 'assets': [{'normalizedName': 'assets/react-*.svg'}, {'normalizedName': 'assets/index-*.c...{'loadTime': {'highSpeed': 53, 'threeG': 2133}, 'size': {'gzip': 200, 'uncompress': 200000}}, 'isCached': False, ...}]}
E         Use -v to get more diff

graphql_api/tests/test_commit.py:1216: AssertionError

To view individual test run time comparison to the main branch, go to the Test Analytics Dashboard

Copy link

codecov-public-qa bot commented Sep 5, 2024

Test Failures Detected: Due to failing tests, we cannot provide coverage reports at this time.

❌ Failed Test Results:

Completed 2277 tests with 1 failed, 2270 passed and 6 skipped.

View the full list of failed tests

pytest

  • Class name: graphql_api.tests.test_commit.TestCommit
    Test name: test_bundle_analysis_report

    self = <graphql_api.tests.test_commit.TestCommit testMethod=test_bundle_analysis_report>
    get_storage_service = <MagicMock name='get_appropriate_storage_service' id='140666898906528'>

    @patch("graphql_api.dataloader.bundle_analysis.get_appropriate_storage_service")
    def test_bundle_analysis_report(self, get_storage_service):
    storage = MemoryStorageService({})
    get_storage_service.return_value = storage

    head_commit_report = CommitReportFactory(
    commit=self.commit, report_type=CommitReport.ReportType.BUNDLE_ANALYSIS
    )

    with open("..../tests/samples/head_bundle_report.sqlite", "rb") as f:
    storage_path = StoragePaths.bundle_report.path(
    repo_key=ArchiveService.get_archive_hash(self.repo),
    report_key=head_commit_report.external_id,
    )
    storage.write_file(get_bucket_name(), storage_path, f)

    query = """
    query FetchCommit($org: String!, $repo: String!, $commit: String!) {
    owner(username: $org) {
    repository(name: $repo) {
    ... on Repository {
    commit(id: $commit) {
    bundleAnalysisReport {
    __typename
    ... on BundleAnalysisReport {
    bundles {
    name
    assets {
    normalizedName
    }
    asset(name: "not_exist") {
    normalizedName
    }
    bundleData {
    loadTime {
    threeG
    highSpeed
    }
    size {
    gzip
    uncompress
    }
    }
    isCached
    }
    bundleData {
    loadTime {
    threeG
    highSpeed
    }
    size {
    gzip
    uncompress
    }
    }
    bundle(name: "not_exist") {
    name
    isCached
    }
    isCached
    }
    ... on MissingHeadReport {
    message
    }
    }
    }
    }
    }
    }
    }
    """

    variables = {
    "org": self.org.username,
    "repo": self.repo.name,
    "commit": self.commit.commitid,
    }
    data = self.gql_request(query, variables=variables)
    commit = data["owner"]["repository"]["commit"]

    > assert commit["bundleAnalysisReport"] == {
    "__typename": "BundleAnalysisReport",
    "bundles": [
    {
    "name": "b1",
    "assets": [
    {"normalizedName": "assets/react-*.svg"},
    {"normalizedName": "assets/index-*.css"},
    {"normalizedName": "assets/LazyComponent-*.js"},
    {"normalizedName": "assets/index-*.js"},
    {"normalizedName": "assets/index-*.js"},
    ],
    "asset": None,
    "bundleData": {
    "loadTime": {
    "threeG": 0,
    "highSpeed": 0,
    },
    "size": {
    "gzip": 0,
    "uncompress": 20,
    },
    },
    "isCached": False,
    },
    {
    "name": "b2",
    "assets": [
    {"normalizedName": "assets/react-*.svg"},
    {"normalizedName": "assets/index-*.css"},
    {"normalizedName": "assets/LazyComponent-*.js"},
    {"normalizedName": "assets/index-*.js"},
    {"normalizedName": "assets/index-*.js"},
    ],
    "asset": None,
    "bundleData": {
    "loadTime": {
    "threeG": 2,
    "highSpeed": 0,
    },
    "size": {
    "gzip": 0,
    "uncompress": 200,
    },
    },
    "isCached": False,
    },
    {
    "name": "b3",
    "assets": [
    {"normalizedName": "assets/react-*.svg"},
    {"normalizedName": "assets/index-*.css"},
    {"normalizedName": "assets/LazyComponent-*.js"},
    {"normalizedName": "assets/index-*.js"},
    {"normalizedName": "assets/index-*.js"},
    ],
    "asset": None,
    "bundleData": {
    "loadTime": {
    "threeG": 16,
    "highSpeed": 0,
    },
    "size": {
    "gzip": 1,
    "uncompress": 1500,
    },
    },
    "isCached": False,
    },
    {
    "name": "b5",
    "assets": [
    {"normalizedName": "assets/react-*.svg"},
    {"normalizedName": "assets/index-*.css"},
    {"normalizedName": "assets/LazyComponent-*.js"},
    {"normalizedName": "assets/index-*.js"},
    {"normalizedName": "assets/index-*.js"},
    ],
    "asset": None,
    "bundleData": {
    "loadTime": {
    "threeG": 2133,
    "highSpeed": 53,
    },
    "size": {
    "gzip": 200,
    "uncompress": 200000,
    },
    },
    "isCached": False,
    },
    ],
    "bundleData": {
    "loadTime": {
    "threeG": 2151,
    "highSpeed": 53,
    },
    "size": {
    "gzip": 201,
    "uncompress": 201720,
    },
    },
    "bundle": None,
    "isCached": False,
    }
    E AssertionError: assert {'__typename'...e, ...}], ...} == {'__typename'...e, ...}], ...}
    E
    E Omitting 4 identical items, use -vv to show
    E Differing items:
    E {'bundles': [{'asset': None, 'assets': [{'normalizedName': 'assets/index-*.js'}, {'normalizedName': 'assets/index-*.js...{'loadTime': {'highSpeed': 53, 'threeG': 2133}, 'size': {'gzip': 200, 'uncompress': 200000}}, 'isCached': False, ...}]} != {'bundles': [{'asset': None, 'assets': [{'normalizedName': 'assets/react-*.svg'}, {'normalizedName': 'assets/index-*.c...{'loadTime': {'highSpeed': 53, 'threeG': 2133}, 'size': {'gzip': 200, 'uncompress': 200000}}, 'isCached': False, ...}]}
    E Use -v to get more diff

    graphql_api/tests/test_commit.py:1216: AssertionError

Copy link

codecov bot commented Sep 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.14%. Comparing base (6a7b595) to head (3aeffba).
Report is 2 commits behind head on main.

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@             Coverage Diff             @@
##               main       #801   +/-   ##
===========================================
  Coverage   96.14000   96.14000           
===========================================
  Files           812        812           
  Lines         18503      18503           
===========================================
  Hits          17790      17790           
  Misses          713        713           
Flag Coverage Δ
unit 91.99% <ø> (ø)
unit-latest-uploader 91.99% <ø> (ø)

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.

@matt-codecov matt-codecov force-pushed the matt/fix-shared-change-check branch from c641883 to 200d5fc Compare September 5, 2024 19:57
@matt-codecov matt-codecov added this pull request to the merge queue Sep 5, 2024
Merged via the queue into main with commit a39ae25 Sep 5, 2024
19 checks passed
@matt-codecov matt-codecov deleted the matt/fix-shared-change-check branch September 5, 2024 20:31
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.

2 participants