I came back yesterday at home from Berlin All Hands at noon. Today will be probably tough on jetlag. Almost all Japanese from Narita Airport to home were wearing a mask (as I did). The coronavirus is in the mind: "deaths at 361 and confirmed infections in China at 17,238".
Cleaning up emails. And let's restart coding for issue #3140 (PR #3167). Last week, I discussed with mike, if I should rebase the messy commits so we have a cleaner version. On one hand, the rebase would create a clean history with commits by specific sections, but the history of my commits also document the thought process. For now I think I will keep the "messy informative" commits.
Unit tests dependency
When unit tests are not failing locally but failing on CircleCI, it smells a dependency on the environment. Indeed, here the list of labels returned behaved differently on CircleCI because locally, in my dev environment, I had a populated
data/topsites.db. This issue would not have been detected if my local
topsites.db was empty like on circleCI. A unittest which depends on an external variability is bad. For now I decided to mock the priority in the test and I opened an issue to create a more controlled environment.
Finishing the big pull request for the new workflow. I don't like usually to create huge pull request. I prefer a series of smaller ones, tied to specific issues. The circumstances pushed me to do that. But I think it's an interesting lesson. How much do we bend our guidelines and process rules in an emergency situation.
23:00 to midnight, we had a webcompat team video-meeting.
I wonder if there is a client with a pythonic api for GraphQL, the same way that SQLAlchemy does for SQL.
I need to
- finish the week notes from the All Hands while it is still fresh in my head. Probably today.
- publish the meeting notes from last night. The meat is in the okr issues
- publish the official minutes of our discussions.
Such a big pull request created obviously more bugs. Anonymous reporting is activated with a flag and our flag didn't work as expected. So that was strange.
environment variables are always strings
After investigating a bit, we were using an environment variable for the activation with the value
False in bash environment.
ANONYMOUS_REPORTING = True
and importing it in python with
ANONYMOUS_REPORTING = os.environ.get('ANONYMOUS_REPORTING') or False
then later on in the code it would be simple enough to do:
if ANONYMOUS_REPORTING: # do something clever here
Two mistakes here. Assumming that:
Truein bash will carry the same meaning than
Trueonce read in python
Trueis not a boolean (and never was) but a string, which means that
ANONYMOUS_REPORTINGwill always be
True(in python boolean sense) because a string is true compared to the absence of a string.
>>> not '' True >>> not 'foo' False
So to make it more explicit, we switched to
ANONYMOUS_REPORTING = ON
So we are almost there but not yet.
By the end of this week, the epidemy is now close to 1000 deaths of Coronavirus. This is getting really serious.