Week 3 (June 5-9)

Hello and Welcome to Week 3 of my HPCC Systems 2023 internship blog journal! My journey so far has been great, and I continue to make progress on this project.

This Week’s Tasks

My goals for this week shifted as the week went on. Initially, I was intending on finishing the 2to3 conversion process for every Python file in the Smoketest repository. Indeed, at the start, I worked on showSchedulerStatus and showStatus. I ran 2to3, analyzed the differences it produced and removed/documented commented code for both of these files.

However, attention then shifted back to one of the first files I worked on, ProcessPullRequests because it went under review. What was caught were several errors which I didn’t initially find on my end due to the way I was running my copy of the file.

ProcessPullRequests Situation

When ProcessPullRequests is ran, it checks for a file known as “token.dat”, containing a GitHub token. This token is required to complete the bulk of the program, opening, processing and closing available pull requests.

Since my environment did not have a GitHub token file in the directory, this section was skipped entirely. Upon analysis using the token, there were several errors found corresponding to issues not caught by 2to3. These issues were the following:

  • A lack of the decode function on stderr and stdout, thus causing an inaccessibility between bytes and strings
  • An extra parameter with the value of 0 in the file open function, invalid in Python 3
  • Unneeded type checking due to the automatic conversion to unicode in Python 3

An additional modification was to reduce code that already exists in a function. Specifically, the formatResult function was under-utilized, as multiple code segments did the same action of returning strings representing the results of running a command line operation. I modified this by setting the results variable to the return value of formatResult and printing it afterwards.

Finally, all of these issues are present in SchedulePullRequests due to the files’ shared structure. I applied those changes to it as well and I anticipate it being reviewed.

Plan For Next Week

Since it appears I am at the very tail-end of any work to do with GistLogHandler, ProcessPullRequests and SchedulePullRequests, I anticipate those being merged into repository very soon with the addition of a pull request. Beyond that, I am excited to have my other files being worked on (WatchDog, showSchedulerStatus) to be tested in the same way.

Once that is done, I will begin the bash portion of the Smoketest section of my project.

Leave a comment