DEV Community

Cover image for GSoC Week 8
Chiemezuo
Chiemezuo

Posted on

GSoC Week 8

I initially lacked the zeal to write about this week, but decided I had to, because I promised myself I'd write about my GSoC on a weekly experience. Also, I'd be annoyed with myself if I chickened out. My lack of zeal was reflected in the fact that this blog post was overdue for several days. The week didn't quite go as I had planned, but it was good, and afterward, I spent the weekend away from my computer. This was the week my mentors and I finally decided to change some parts of the new functionality we'd spent weeks working on.

Weekly Check-in

This wasn't like our regular weekly check-in meetings. It started about an hour later than usual because we had to accommodate Thibaud's schedule so he could walk Storm through the changes and they could deliberate on them. It was a somewhat lengthy session because we all had valid concerns. On the one hand, Thibaud wanted upgrades with the least friction for users, even if it meant compromising the initial goal. On the other hand, Storm and I wanted to do things the "right" way: making sure that the usability of alt text was not left to the chance that editors would modify their image title fields.

At the same time, it would be fair to say that we all had our biases. Thibaud was speaking as a developer and editor who already had accessibility in mind in his daily work, while also working in a company where other people followed best practices. Storm was speaking as a developer who frequently worked with editors and had seen lots of people not bother to follow best practices. On my end, I was speaking as a developer from the perspective of a newcomer, who could easily see all the ways to do things "faster" without any extra overhead (even if the overhead would be a better way to do things).

After going through the flowchart together and looking for what was best for our existing users, we decided to leave the defaults as they initially were. This would mean I would spend the week undoing changes I made in a previous week. It didn't sound exciting, but the work had to be done, nonetheless.

This reminds me of Matthew Wescott's (Lead Wagtail Dev) video on the impossible art of pleasing everyone. The compromise wasn't exactly something I was absolutely sold on, but sometimes these things are out of our control, and the consequences of our actions would mean a good or bad experience for editors who use Wagtail.

Challenges

I could write an entire book about all the challenges I faced, but for now I'll write a couple of paragraphs instead. I had an absolute nightmare with git. I also learned about a misconception I'd had about git reverts.

Before I started the GSoC project, Wagtail's default to fallback to the title field in the absence of any alt text mechanism. There were also a series of tests to ensure this behaviour. However, because my mentors agreed earlier on that this would change, I edited all the pertinent tests to remove this behaviour. Several weeks later, I would have to bring them back. There were two ways I could do this:

  1. I could look at the git diff from the current state of things and manually edit things.
  2. I could just "go back in time" and "stop myself" from making those changes (but to appear as an activity done in the future)

Believe it or not, the first process was easier, but I felt there would be a lot to learn from step 2 so I opted for that instead. This is where the chaos started. All along, I'd always thought that git revert would alter things in the commit history so I deliberately avoided doing that. I had the very bright idea(you probably understand the sarcasm) of checking out to the older commit hash and manipulating things from there. This was uncharted territory for me so I decided to do all of this in a copy branch of the branch I was working on. That sole activity saved me.

I checked out to the branch and then to the particular commit hash. I tried to undo a few changes and commit, but then I somehow messed with the history. I'm not even sure I can entirely explain what went wrong, but I kept getting a series of merge conflicts. At some point I made a mistake in one of the merges and had to undo that. Then I tried rebasing to fix that issue. At this point, I went from trying to get a small change done, to tirelessly bombarding ChatGPT with prompts, because I could no longer understand what I was doing. I ended up with about 13 commits for one simple task, and several merge conflicts that would always pop up any time I did a git pull. After hours on that hamster wheel, I decided to start afresh because I had made such an inexplicable mess of things.

This time around, I started by outrightly asking ChatGPT what to do. It mentioned "reverting". This put me on high alert, but I decided to do some extra study and read more about git reverts. After reading a bunch of articles, it looked very okay (much to my surprise), and I decided to try it in a different branch. I deleted the one I had messed up and started again. I can tell you for a fact that I was surprised at how smooth everything went. It worked well, and I had zero issues. This, however, was only one part of the equation. The other part was to merge it to the actual branch I needed it to be on. I said a quiet prayer with the hopes that nothing would go wrong (because that was essentially several weeks of progress). Again, things worked, and I finally pushed.

What I Learned

In a nutshell, I learned a lot about how reverts, soft resets, and hard resets work. Let's just say I won't forget when to use them in a hurry. Experience really is the best teacher.

I also learned the importance of always opening different branches to try out new things. There's a good chance I could have damaged my commit history if I didn't create that sandbox-like environment for myself. In a sense, that's the whole point of git: the power to break things to your heart's content without actually damaging anything.

Finally, I'd say I learned to question my preconceived notions more often. Why did I feel so strongly about reverts when my knowledge was wrong? I can't quite say, but going forward, I'll be more open-minded about things.

Conclusion

It was a chaotic week, but some level of chaos is required for some level of growth. Apologies if you religiously follow-up with this series and expected this to drop sooner. I'll do a much better job next time.

Thank you for reading it this far.

Till next time.
Cheers. 🥂

Top comments (0)