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

Update _appengine_environ.py #1471

Closed
wants to merge 53 commits into from
Closed

Update _appengine_environ.py #1471

wants to merge 53 commits into from

Conversation

wittfabian
Copy link

Fixed Bug #1470

@codecov-io
Copy link

codecov-io commented Nov 3, 2018

Codecov Report

Merging #1471 into master will decrease coverage by 1.87%.
The diff coverage is 25%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1471      +/-   ##
==========================================
- Coverage     100%   98.12%   -1.88%     
==========================================
  Files          22       22              
  Lines        1824     1863      +39     
==========================================
+ Hits         1824     1828       +4     
- Misses          0       35      +35
Impacted Files Coverage Δ
src/urllib3/contrib/_appengine_environ.py 63.63% <25%> (-36.37%) ⬇️
src/urllib3/util/wait.py 64.06% <0%> (-35.94%) ⬇️
src/urllib3/connection.py 97.03% <0%> (-2.97%) ⬇️
src/urllib3/util/url.py 97.93% <0%> (-2.07%) ⬇️
src/urllib3/response.py 99.43% <0%> (-0.57%) ⬇️
src/urllib3/util/ssl_.py 100% <0%> (ø) ⬆️
src/urllib3/contrib/socks.py 100% <0%> (ø) ⬆️
src/urllib3/util/timeout.py 100% <0%> (ø) ⬆️
src/urllib3/connectionpool.py 100% <0%> (ø) ⬆️
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cbe558b...d98e631. Read the comment docs.

@wittfabian
Copy link
Author

@pquentin
Copy link
Member

The tests failures don't seem related to the changes, so maybe retrying will fix the failures?

@wittfabian
Copy link
Author

Who can restart the tests?

@pquentin
Copy link
Member

Members/owners can do it. You can also do it by closing/reopening the pull request!

@wittfabian
Copy link
Author

Let's give it a try

@wittfabian wittfabian closed this Nov 17, 2018
@wittfabian wittfabian reopened this Nov 17, 2018
@wittfabian wittfabian closed this Nov 22, 2018
@wittfabian wittfabian reopened this Nov 22, 2018
@sethmlarson
Copy link
Member

So we're getting some really strange behavior on both CIs. Travis is borking out on some IPv6 availability and AppVeyor is timing out after an hour of execution on each build. From this PR I can't see why either of those things are happening? Can you try rebasing your branch and pushing that?

@pquentin
Copy link
Member

Maybe the issue is that is_prod_appengine is now returning True in situations where it returned False in the past?

@sethmlarson
Copy link
Member

That's totally it, thanks for the sanity check @pquentin :)

@wittfabian
Copy link
Author

Maybe APPENGINE_RUNTIME is the solution.

Copy link
Member

@sethmlarson sethmlarson left a comment

Choose a reason for hiding this comment

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

Just some comments to keep the outputs of these functions consistent in non-AppEngine environments.

src/urllib3/contrib/_appengine_environ.py Outdated Show resolved Hide resolved
src/urllib3/contrib/_appengine_environ.py Outdated Show resolved Hide resolved
@sethmlarson
Copy link
Member

@sethmlarson
Copy link
Member

I'll wait for @theacodes for final review of this. Thanks! :)



def is_appengine_sandbox():
return is_appengine() and not is_prod_appengine_mvms()


def is_local_appengine():
return ('APPENGINE_RUNTIME' in os.environ and
'Development/' in os.environ['SERVER_SOFTWARE'])
return is_appengine() and \
Copy link
Member

Choose a reason for hiding this comment

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

This isn't going to work right. This will return True for Flex as SERVER_SOFTWARE won't be set but APPENGINE_RUNTIME will be. We either need to require SERVER_SOFTWARE as part of the local check or find a more reliable way to determine whether or not you're in the local environment.

Copy link
Author

Choose a reason for hiding this comment

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

Why is_local_appengine needs to know weather it is an flex environment or not?
For this distinction we use is_prod_appengine_mvms.

Copy link
Author

Choose a reason for hiding this comment

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

The alternative is to add not is_prod_appengine_mvms to is_prod_appengine and is_local_appengine

Copy link
Member

Choose a reason for hiding this comment

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

Basically each of these checks needs to be definitive:

is_local_appengine should return True if and only if you're on the local app engine dev server.

is_prod_appenegine should return Tue if and only if you're in the production app engine (standard or flex).

and so on. Does that make sense?

Copy link
Author

Choose a reason for hiding this comment

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

What about the import check?

theacodes and others added 29 commits April 24, 2019 10:32

* Fix appveyor config escaping (I think, ugh yaml)

* Attempt to fix appveyor run script and help mac find nox

* Really, AppVeyor?

* Another attempt to get mac and appveyor working.

* Comb in brotli changes from #1579

* Comb in pypy changes from #1576
# Conflicts:
#	src/urllib3/contrib/_appengine_environ.py
@wittfabian wittfabian closed this May 4, 2019
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.

None yet

7 participants