Coding Notebook

What is This?

This is a public-facing notebook about what I’m doing, what I’m struggling to do, and what mistakes I’ve been making.

Week 1 (May 29 to June 4)

Learned

  • Learned more about the pkgdown R package:
  • Learned more about git:
  • Looked up some tips on how to write code comments better. Tips from: Antonin Januska and Ellen Spertus.
  • Learned that the string GITHUB_PAT can be found in the .github/workflows directory.
  • Learned about documentation managers. There’s: Zeal and DevDocs.
  • Learned that there are, like, eight test suites. And they automatically run when you make a pull request to the animint2 repository. That’s nice. I’m also learning that the tests take a long time to run—about 45 minutes.
  • Turns out that ripgrep-all doesn’t look through YAML files. I need something like yq instead. Why?

Created

  • Created README.md from the README.org file via the magic of pandoc.
  • Created a preliminary website and documented how I generated it:
    • For the documentation and code, see website_setup.Rmd. Currently have information about building the website.
    • Put the site up online.
  • Accidentally made a pull request in tdhock/animint2. Should’ve been ampurr/animint2 instead. I closed it—be more careful.
  • Made a pull request in ampurr/animint2 but did not initially succeed in closing it due to a test failing. Later, I pushed it anyway, which then threw the website online.
  • Successfully set up the website. But there are some errors. Most noticeably: it includes some functions that don’t seem to be part of animint2. Will need to investigate further.

Confused

One of the tests—“Test Suite compiler”—failed. Here’s the error message:

Code
══ Failed tests ════════════════════════════════════════════════════════════════
── Error ('test-compiler-gist.R:4:3'): animint2gist() returns an object of class 'gist' ──
Error: Error: In non-interactive environments, please set GITHUB_PAT env to a GitHub access token (https://help.github.com/articles/creating-an-access-token-for-command-line-use)
Backtrace:

 1. └─animint2::animint2gist(list(p = qplot(1:10)), browse = FALSE) at test-compiler-gist.R:4:2
 2.   └─gistr::gist_create(...)
 3.     ├─gistr:::gist_POST(...)
 4.     │ └─gistr:::cVERB(...)
 5.     │   └─crul::HttpClient$new(url, headers = c(auth, headers), opts = list(...))
 6.     │     └─crul (local) initialize(...)
 7.     └─gistr::gist_auth()

[ FAIL 1 | WARN 0 | SKIP 5 | PASS 756 ]
Error: Error: Test failures
Execution halted
Error: Process completed with exit code 1.

This is confusing, since I thought GITHUB_PAT was already set with a GitHub Access Token. I was also unaware of the large array of tests that activate when you try to push something. Quite frankly, I’m not sure what they do or what they prevent. It feels different than using testthat.

I also don’t understand the GitHub workflow stuff. What exactly is GitHub doing?

Week 2 (June 5 to June 11)

Learned

  • Learned that the roxygen2 package generates both the .Rd files and the DESCRIPTION for packages.
  • Learned that devtools has so so so many dependencies. The AUR package does, anyway.
  • This is real basic, but I re-learned that bash foo.sh runs shell scripts. I haven’t run one since September of 2022.

Created

  • Well… Technically it’s the opposite of creation. I deleted the fortify.foo files in the R/ directory.

Confused

  • yay -S r-plyr r-reshape2 isn’t working and requires “manual intervention.” Why?