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

True Tokenless for BA and TA #882

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

True Tokenless for BA and TA #882

wants to merge 9 commits into from

Conversation

nora-codecov
Copy link
Contributor

@nora-codecov nora-codecov commented Oct 10, 2024

Purpose/Motivation

TT requires certain identifiers, BA and TA don't have the identifiers in their path, so I make custom methods to get the identifiers so that BA and TA can use TT.

Links to relevant tickets

codecov/engineering-team#2877

@nora-codecov nora-codecov requested a review from a team October 10, 2024 23:23
@codecov-notifications
Copy link

codecov-notifications bot commented Oct 10, 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!

Copy link

codecov bot commented Oct 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.26%. Comparing base (b62fc87) to head (56f613b).

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #882   +/-   ##
=======================================
  Coverage   96.25%   96.26%           
=======================================
  Files         827      827           
  Lines       19090    19113   +23     
=======================================
+ Hits        18376    18399   +23     
  Misses        714      714           
Flag Coverage Δ
unit 92.53% <100.00%> (+<0.01%) ⬆️
unit-latest-uploader 92.53% <100.00%> (+<0.01%) ⬆️

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.

Copy link
Contributor

@joseph-sentry joseph-sentry left a comment

Choose a reason for hiding this comment

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

left a couple of comments on the test results stuff that may also apply to BA

codecov_auth/authentication/repo_auth.py Outdated Show resolved Hide resolved
upload/views/helpers.py Outdated Show resolved Hide resolved
Copy link

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

❌ Failed Test Results:

Completed 2749 tests with 1 failed, 2742 passed and 6 skipped.

View the full list of failed tests

pytest

  • Class name: api.internal.tests.test_charts.TestChartQueryRunnerQuery
    Test name: test_query_aggregates_multiple_repository_totals

    self = <tests.test_charts.TestChartQueryRunnerQuery testMethod=test_query_aggregates_multiple_repository_totals>

    @override_settings(GITHUB_CLIENT_ID="3d44be0e772666136a13")
    def test_query_aggregates_multiple_repository_totals(self):
    query_runner = ChartQueryRunner(
    user=self.user,
    request_params={
    "owner_username": self.org.username,
    "service": self.org.service,
    "end_date": str(timezone.now()),
    "grouping_unit": "day",
    },
    )

    results = query_runner.run_query()

    assert len(results) == 1
    > assert results[0]["total_hits"] == 114
    E AssertionError: assert Decimal('14') == 114

    .../internal/tests/test_charts.py:564: AssertionError

@codecov-qa
Copy link

codecov-qa bot commented Oct 12, 2024

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
2743 1 2742 6
View the top 1 failed tests by shortest run time
api.internal.tests.test_charts.TestChartQueryRunnerQuery test_query_aggregates_multiple_repository_totals
Stack Traces | 0.072s run time
self = &lt;tests.test_charts.TestChartQueryRunnerQuery testMethod=test_query_aggregates_multiple_repository_totals&gt;

    @override_settings(GITHUB_CLIENT_ID="3d44be0e772666136a13")
    def test_query_aggregates_multiple_repository_totals(self):
        query_runner = ChartQueryRunner(
            user=self.user,
            request_params={
                "owner_username": self.org.username,
                "service": self.org.service,
                "end_date": str(timezone.now()),
                "grouping_unit": "day",
            },
        )
    
        results = query_runner.run_query()
    
        assert len(results) == 1
&gt;       assert results[0]["total_hits"] == 114
E       AssertionError: assert Decimal('14') == 114

.../internal/tests/test_charts.py:564: AssertionError

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

codecov_auth/authentication/repo_auth.py Show resolved Hide resolved
@@ -39,13 +39,13 @@ def has_permission(self, request, view):
class UploadSerializer(serializers.Serializer):
commit = serializers.CharField(required=True)
slug = serializers.CharField(required=True)
service = serializers.CharField(required=False) # git_service
Copy link
Contributor

Choose a reason for hiding this comment

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

How come TA can't use git_service?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since it's already live in prod I figured it would be a whole thing to switch over to a different var name - what do you think @joseph-sentry ?

upload/views/helpers.py Outdated Show resolved Hide resolved
Copy link
Contributor

github-actions bot commented Nov 9, 2024

✅ All tests successful. No failed tests were found.

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

@@ -156,7 +158,7 @@ def post(self, request):
"build_url": data.get("buildURL"), # build_url
"job": data.get("job"), # job_code
"flags": data.get("flags"),
"service": data.get("ci_service"), # provider
"service": data.get("service"), # git provider
"url": storage_path, # storage_path
# these are used for dispatching the task below
"commit": commit.commitid,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@joseph-sentry can you double check the changes I made to the TA fields? Is this still the design we're going with?

Copy link
Contributor

@JerrySentry JerrySentry left a comment

Choose a reason for hiding this comment

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

looks good on bundle analysis side of things.

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