Org Web Adapter

journals/2020_09_25.org

ID
f745d8c8-190b-44f4-af29-6289a1aed1b3

2020-09-25 - Friday

DONE Journal

CLOSED:

- Note taken on

Oof, today kind of blew up on me. We went for our Friday hike at Caterpillar Hill and Cooper Farm trail in Sedgwick and had a great time, though the trail was quite different from other trails we've been on. But on our way home Emma asked if we could just continue on to Ellsworth. We figured we were already half way there and Emma was hoping to shop for some clothes for J. Ultimately we ended up spending hours in parking lots while I tried to work.

DONE [[id:010e5c72-3d51-45f3-bc3d-d4ac07fe11b8][Weekly Review]] with [[id:10b14f49-b275-45f5-b76b-fea159f0a75a][Andrii]]

CLOSED:

<2020-09-25 Fri 9:00-9:15>

DONE Pair programming with [[id:f94825ec-0493-446c-9632-ee579ad6be3b][João Guerreiro]] on [[id:d224b9a1-d0df-415d-aab2-0e0cf01459dc][ENG-12495]]

CLOSED:

ID
ccf453c5-e9a4-40d1-8acb-73f2890d57ab

- Note taken on

Okay! João Guerreiro and I had a productive co-working session this morning (his afternoon) and we walked through the thread where James offered some thoughts on what he saw in S3 and knocked out all the various places in the code that this S3 key (filename) of the file could be getting “encoded” with + for spaces.

As I said above, I was able to verify that the sFTP transfer of files to S3 did not cause string replacement. After that, I THOUGHT the next opportunity was when our lambda function receives the S3 event notification of a new object and we pass that along as a POST response to the 15Five app. I verified via manually encoding a dictionary of into JSON that the filename does not get modified there either. At that point I was out of ideas.

BUT! Yesterday Eric Hamiter posted a [[https://stackoverflow.com/questions/44779042/aws-how-to-fix-s3-event-replacing-space-with-sign-in-object-key-names-in-js][SO answer about S3 event munging filenames]]. I had come across this answer and others in the past, but dismissed them because the way the other folks were accessing the objects was via file paths, and in our code we are accessing them via the boto library.

What I hadn't considered, was that the S3 event notification itself was corrupting the key name! Turns out, the S3 key name with spaces is somehow being converted to a string with '+' instead of spaces. So the fix should be simple, but because it's fixing an hard-to-find bug in how S3 event notifications are generated, testing it is going to be a bear.

I think I’ll be able to spoof the event information to include a bad file path and verify that decoding of the key name happens successfully, but the only true test will be pushing it up to preview or staging and having AppDirect try again.

DONE Fix decode error in [[id:d224b9a1-d0df-415d-aab2-0e0cf01459dc][ENG-12495]]

CLOSED:

DONE [[id:7b5c0db6-16c7-447c-bd45-ace0f5ae1cdc][Friday Nature Hike]]

CLOSED:

DONE Find a ticket from the backlog

CLOSED:

ENG-12371

- Involves Read-only fields for attributes that are read-only on the user profile page

- Pretty easy

ENG-12315 is a BambooHR bug ... perhaps not the best task

- User is in three Departments

- BambooHR sync only allows one department

DONE Initial research of [[id:13c615bf-c3b3-4434-ab55-c8d71cfa4f75][ENG-12315]]

CLOSED:

ID
e775e909-bb0c-44f8-9aad-3c7fd70b92e1

- Note taken on

Just pulled this into our current sprint. It seems like the issue is related to how we treat Departments in the BambooHR sync as special groups where a user only belongs to one, and, as @Joao Guerreiro noted above, if the department changes, we re-assign the user to the new department.

Also as João pointed out, it seems like these groups were not set via BambooHR. I checked whether the relationship between the 15Five user and the BambooHR user had been broken and saw no evidence of it (doesn’t mean it didn’t happen :) )

My next step will be to create a similar situation locally with a user in multiple departments, and then another user with multiple departments assigned outside of BambooHR and see how far I get. I likely wont get to this until Monday.

This is the code that checks for departments (not, it only checks for one :thinking:): [[file:~/src/github.com/15five/fifteen5/ff/mods/hris/bamboo_hr/data_import/groups.py::def add_to_group_based_on_department(user, department_name):][code for replacing one department with another in BambooHR]] or via [[https://github.com/15five/fifteen5/blob/f8c186e206d707281850ddaf54e2e1d0a4fa1796/ff/mods/hris/bamboo_hr/data_import/groups.py#L30][git]]

DONE Setup local BambooHR company test script for [[id:13c615bf-c3b3-4434-ab55-c8d71cfa4f75][ENG-12315]]

CLOSED:

DONE Make sweet potato latkes for dinner

CLOSED:

ID
e74cf399-5936-47c7-af26-cc36a468073c