Dawn of the Final Week (Again)

chrispinkney

Chris Pinkney

Posted on April 17, 2021

Dawn of the Final Week (Again)

The Maintainer

ā€‹ Like most weeks we started with panic, but this time with a little extra gusto as it's finals week.

Alt Text

I started off the week by "reviewing" one of Dave's PRs. I say "reviewing" as the tests for the PR are currently not yet passing, as such I was left to only review the code posted and not test the PR locally. As always, the code seemed fine. I was really excited to see this PR as the users microservice is finally starting to seriously come together.

I also approved a quick-fix PR from Pedro for a clean $20, as it was discovered that our landing page didn't properly display viewport heights. My favourite kind of PRs are always the ones that are <= 10 SLOC.

Alt Text

Also approved a really interesting Docker related PR from Doc Josue! I had never thought about how containers and volumes dispose of unused elements until now. I guess I just magically assumed they would disappear when the container closes.

Reviewed some changes to the frontend made by Royce, I liked where it was heading, just not how the names were duplicated. We discussed it during our Friday meeting as well, and everyone seemed to share a general consensus about the duplicated names but also agreed that the line was an excellent touch.

I approved Tony's PWA PR again since we have a bunch of testing now. I think it's adequate, however, Dave has expressed reluctance to add it as we're currently unsure how the PWA will behave when we deploy an update to prod. Tony has since reached out to the maintainer of next-pwa for answer. As a result, I have removed my approval and apologized to Tony. Hopefully we'll get a reply soon and can get some answers so we can move forward with this. Still one of my favourite PRs.

I added my thoughts to a comment that Tony left on an issue suggesting a share icon feature addition to Telescope. Tony expressed hesitation about working on this feature, but I think working in open source forces collaboration, expression, critique, and commentary, and shared my opinion as such. I'm curious to see what we can do with this. A share button would be cool, especially if it copied the link URL to the clipboard, then a user can just ctrl-v to share it to someone. Might be a nice feature for new comers to the project to tackle!

I also reviewed Royce's new SearchHelp PR which changes how the helpful search instructions are displayed on our search page. I pointed out a bug (that may or may not be related to his PR). Lots of great frontend fixes lately from Royce!

Finally, in other humorous news, I left a really dumb review on something that is either not finished, failing CI, or both. Heh. I'll have to take another look at it when it's ready. GitHub is great but either I'm not great, or the UI is occasionally un-intuitive.

Alt Text


The Microservice

ā€‹ I started working on converting the unit tests inside the Users Microservice to proper e2e type tests tests two days ago but ran into a few snags. For the life of both Josue and I just could not get the microservice to respond properly:

// takes a user object, performs GET using the user's email
const getUser = async (user) => {
  const response = await fetch(`${USERS_URL}/${hash(user.email)}`, {
    headers: {
      Authorization: `bearer ${createServiceToken()}`,
      'Content-Type': 'application/json',
    },
  });

  return response;
};
Enter fullscreen mode Exit fullscreen mode
const response = await getUser(allUsers[0]); <-- array of user objects
Enter fullscreen mode Exit fullscreen mode

response.body simply refused to co-operate with us, and returned a bunch of crap that we didn't want. Give us the user, curse you! Curse you and all the halflings!

The solution ended up being const user = await response.json() which allowed us to parse the JSON returned and make assertions based on the user returned via the GETs body. I'm currently sitting at 6 tests rewritten out of the... who knows, 15 or so that I have to do? I'm hoping to have the rest of them done by Sunday.

With only 1 week left I made it a point to issue a call for a potential roadmap for the Users Microservice. We still have a lot of work to do, but fortunately there's a bunch of us working on this stuff and a few items won't take too long.

Alt Text

After these e2e tests go in to replace the current unit tests I'll be shifting gears to work on how users are declared administrators, followed up by some research, and concluded with adding some quotes. Then finishing up what isn't done by end of week!


In other more personal news:

  • My first final went okay I think... hopefully.
  • Think I might buy a cherry tree for my backyard garden this year. I have no idea how trees work or how to care for them so hopefully I learn a lot...
    • A society grows great when aged people plant trees in whose shade they know they shall never sit. šŸŒ²
  • Continuing with my Rust fascination from the previous blog post, I stumbled upon a Rust cargo library which adds support for various microcontrollers. I have a Circuit Playground Express sitting in my basement. I bought it last year with the hopes of designing an automated garden watering system. Maybe I'll try it in Rust sometime!
  • I've always wanted to get involved in something impactful. I remember a website that I bookmarked for this just occasion! Maybe it will help you, dear reader, too.
šŸ’– šŸ’Ŗ šŸ™… šŸš©
chrispinkney
Chris Pinkney

Posted on April 17, 2021

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

Dawn of the Final Week (Again)
opensource Dawn of the Final Week (Again)

April 17, 2021