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

Remove token enforcement for true tokenless endpoints #533

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

Conversation

nora-codecov
Copy link

Went through the upload endpoints on API:

  • endpoints where we want to allow tokenless: I've made sure the method uses get_token_header() which allows None for the token, which will allow tokenless requests through to the api.

  • endpoints where we don't want to allow tokenless: I've made sure they use get_token_header_or_fail() which does not allow None, so the request will be kicked out before it gets to api. This is not required for the tokenless logic to work, but is nice to have since it prevents junk requests from clogging api.

Copy link

codecov bot commented Oct 15, 2024

❌ 5 Tests Failed:

Tests completed Failed Passed Skipped
3525 5 3520 0
View the top 3 failed tests by shortest run time
api.temp.calculator.test_calculator test_divide
Stack Traces | 0.001s run time
def
                test_divide():
                > assert Calculator.divide(1, 2) == 0.5
                E assert 1.0 == 0.5
                E + where 1.0 = <function Calculator.divide at 0x104c9eb90>(1, 2)
                E + where <function Calculator.divide at 0x104c9eb90> = Calculator.divide
                .../temp/calculator/test_calculator.py:30: AssertionError
api.temp.calculator.test_calculator test_divide
Stack Traces | 0.001s run time
def
                test_divide():
                > assert Calculator.divide(1, 2) == 0.5
                E assert 1.0 == 0.5
                E + where 1.0 = <function Calculator.divide at 0x104c9eb90>(1, 2)
                E + where <function Calculator.divide at 0x104c9eb90> = Calculator.divide
                .../temp/calculator/test_calculator.py:30: AssertionError
api.temp.calculator.test_calculator test_divide
Stack Traces | 0.001s run time
def
                test_divide():
                > assert Calculator.divide(1, 2) == 0.5
                E assert 1.0 == 0.5
                E + where 1.0 = <function Calculator.divide at 0x104c9eb90>(1, 2)
                E + where <function Calculator.divide at 0x104c9eb90> = Calculator.divide
                .../temp/calculator/test_calculator.py:30: AssertionError

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

Copy link

github-actions bot commented Oct 15, 2024

✅ All tests successful. No failed tests were found.

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

setup.py Outdated
@@ -26,6 +26,7 @@
"tree-sitter==0.20.*",
"test-results-parser==0.5.*",
"regex",
"pytest-mock"
Copy link
Contributor

Choose a reason for hiding this comment

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

does this need to be an install requirement?

Copy link
Author

Choose a reason for hiding this comment

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

ah yes this change does look random 😅 on my local, tests wouldn't run because of ImportError, ModuleNotFoundError: No module named 'pytest_mock'
The error was coming from this test which was fairly recently added.
Rather than changing the test, I added the missing import to the requirements list. pytest-mock is already in tests/requirements so it's not entirely new. I'm not sure why my local wasn't installing and using the package from tests/requirements when running pytest.
I can remove it if you want, but I included it on my pr since it was required to make my tests run 😄

Copy link
Contributor

@michelletran-codecov michelletran-codecov left a comment

Choose a reason for hiding this comment

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

Generally LGTM. Just a few comments about the type annotation.

codecov_cli/services/commit/__init__.py Outdated Show resolved Hide resolved
codecov_cli/services/report/__init__.py Show resolved Hide resolved
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