Skip to content

4 | GitHub Status Badge Pathfinding - #39

Draft
ReedClanton wants to merge 122 commits into
mainfrom
feature/4-github-status-badge-pathfinding
Draft

ReedClanton wants to merge 122 commits into
mainfrom
feature/4-github-status-badge-pathfinding

Conversation

@ReedClanton

@ReedClanton ReedClanton commented Oct 1, 2026 •

Copy link
Copy Markdown
Owner

Description of Changes

Split up runs of unit tests that include profiling and code coverage calculation out into a separate workflow that's not run as often. This speeds up the workflow that's run more often.

Reduced what gets run when so the pipeline takes less time. For example, if you touch some code, the the pipeline for that portion of code will run, but not the entire pipeline.

Fixed some style guide issues after adding style guide checks to more of the code base. Note that the backUp() function doesn't pass the style guide check. I may end up removing the check if I can't get it to pass and writing a GitHub issue to cover the work.

Finally, I added badges to tell a user looking at the documentation if the code runs on the shell they are using.

The Basics

These should be checked immediately upon PR (Peer Review) creation:

  • The name of the branch is:
    • <feature/bug>/<issueId>-<issue-title-with-dashes-between-and-no-capitalization>
  • The title of this PR is:
    • <issueId> | <Issue Title>
  • Changes are being merged into the correct branch (normally main).
  • PR has been assigned to you.
  • Labels have been filled out:
    • Normally, they reflect the labels of the issue the PR is for, but verify this, and if different, update the issue's labels.
  • Description of Changes section has been filled out.
  • @ReedClanton has been added as a reviewer.
  • PR has been marked as Draft when not ready for review.

Check Before Moving Out of Draft

  • For the GitHub issue associated with this work:
    • Everything from the Details section has been addressed.
    • All artifact(s) listed in the Artifact(s) section exist.
    • The Scope section has been adhered to:
    • Checked for new GitHub issue comments and addressed.
    • Verified existing GitHub issue comments have been addressed.
  • All code changes, including unit tests:
    • Adhere to the style guide:
      • Code style guide is located in the Shell Style Guide section of README.md at the root of the project.
      • Test style guide is located in the README.md at the root of the unit testing directory.
    • Executes successfully locally.
    • Style checker executes successfully by the GitHub runner (pipeline).
  • Documentation:
    • README.md of all code touched, including unit tests:
      • Has been read to asses what additions and updates should be made.
      • Has been updated.
    • Script/Function/Help doc of all code touched (if you touch the file, you own all documentation updates):
      • Has been read to asses what additions and updates should be made.
      • Has been updated.
  • Testing:
    • New code:
      • Has 100% Unit test coverage (other than main.sh files).
      • Is run by a GitHub workflow (the pipeline).
      • Runs successfully by GitHub runner (the pipeline).
      • New unit tests are being run by GitHub actions (pipeline).
      • New code's dependency tree has been added to <repoRoot>/.github/badge-dependencies.
    • Coverage:
      • Unit test coverage of all code touched has not dropped.
      • 100% coverage exists for all added code.
      • Checked if unit test coverage has increased, if so:
    • All tests (unit, functional, or otherwise) run successfully:
      • By GitHub runner (the pipeline).
      • Locally.
    • If new environment variable(s) were added:
      • Environment variables are unset by the spec_helper_precheck() function in <repoRoot>/spec/spec_helper.sh.
      • All unit tests of the code that uses them set or unset them at the top or within the test.
      • 100% Unit test coverage of environment variable(s).

Check Before Each Push

  • For the GitHub issue associated with this work:
    • The Scope section is being adhered to.
  • Documentation:
    • README.md of all code touched, including unit tests:
      • Has been read to asses what additions and updates should be made.
      • Has been updated.
    • Script/Function/Help doc of all code touched (if you touch the file, you own all documentation updates):
      • Has been read to asses what additions and updates should be made.
      • Has been updated.
  • Testing:
    • New code:
      • Has 100% Unit test coverage (other than main.sh files).
      • Is run by a GitHub workflow (the pipeline).
      • Runs successfully by GitHub runner (the pipeline).
      • New unit tests are being run by GitHub actions (pipeline).
    • Coverage:
      • Unit test coverage of all code touched has not dropped.
      • 100% coverage exists for all added code.
      • Checked if unit test coverage has increased, if so:
        • Update GitHub workflows .yml files that run the unit tests in the pipeline to increase the minimum coverage level required for pipeline success.
    • All tests (unit, functional, or otherwise) run successfully:
      • By GitHub runner (the pipeline).
      • Locally.
    • If new environment variable(s) were added:
      • Environment variables are unset by the spec_helper_precheck() function in <repoRoot>/spec/spec_helper.sh.
      • All unit tests of the code that uses them set or unset them at the top or within the test.
      • 100% Unit test coverage of environment variable(s).

Check After Final Push

  • For the GitHub issue associated with this work:
    • Everything from the Details section has been addressed.
    • All artifact(s) listed in the Artifact(s) section exist.
    • The Scope section has been adhered to:
    • Checked for new GitHub issue comments and addressed.
    • Verified existing GitHub issue comments have been addressed.
  • All code changes, including unit tests:
  • Documentation:
    • README.md of all code touched, including unit tests:
      • Has been read to asses what additions and updates should be made.
      • Has been updated.
    • Script/Function/Help doc of all code touched (if you touch the file, you own all documentation updates):
      • Has been read to asses what additions and updates should be made.
      • Has been updated.
  • Testing:
    • New code:
      • Has 100% Unit test coverage (other than main.sh files).
      • Is run by a GitHub workflow (the pipeline).
      • Runs successfully by GitHub runner (the pipeline).
      • New unit tests are being run by GitHub actions (pipeline).
    • Coverage:
      • Unit test coverage of all code touched has not dropped.
      • 100% coverage exists for all added code.
      • Checked if unit test coverage has increased, if so:
        • Update GitHub workflows .yml files that run the unit tests in the pipeline to increase the minimum coverage level required for pipeline success.
    • All tests (unit, functional, or otherwise) run successfully:
      • By GitHub runner (the pipeline).
      • Locally.
    • If new environment variable(s) were added:
      • Environment variables are unset by the spec_helper_precheck() function in <repoRoot>/spec/spec_helper.sh.
      • All unit tests of the code that uses them set or unset them at the top or within the test.
      • 100% Unit test coverage of environment variable(s).
  • PR is not marked as Draft.

Splitting runs of unit tests that include profiling and code
coverage calculation out into a separate workflow that's not run
as often. This speeds up the workflow that's run more often.
@ReedClanton ReedClanton self-assigned this Oct 1, 2026
@ReedClanton ReedClanton added documentation Improvements or additions to documentation pathfinding Subset of total changes needed. Worked first to learn before rest of work is started. labels Oct 1, 2026
Renamed workflwo that runs code coverage so I don't have two
workflows with the same name.
Probably not the problem.
Testing out fix. Also removed debugging code.
Line comment mid-command broke Dockerfile.
The shell is not packaged.
Changed how shfmt (style checking tool) is installed. Rather than
using a snap, I just download the binaries directly. This is a lot
faster and allows me to pin the version so updates to shfmt in the
future don't break my pipeline.

I created actions for installing shells to both Ubuntu and MacOS.
I liked this more than including the install of everything in one
action. It makes the workflow files easier to read, while still
allowing for a lot of re-use. In addition to the re-use, it allows
for error checking so missing shell installs don't show up as
failing tests.

I updated all workflows to utilize the new actions and removed
the old workflows and actions.

Also made minor updates to the style checking workflows so they
are less wordy.
The path to the CUT should be reflected by the path to the tests.

This will also fix the pipeline running of those tests.
ShellSpec is now profiling tests, kcov is in use, and zsh is found,
however, code coverage is reporting at 0%. Gotta figure out why
that's happening.
I think it's just failing because of #20. Need to work that.
Also renamed badge to reflect what it really represents.
Now that I've tested that the failure badge works, I've removed
the failing test.
ReedClanton and others added 22 commits October 9, 2026 18:39
The shell does some strange stuff were it doesn't have POSIX
stuff builtin any more. Instead, it outsources them to programs
that it adds to the path.

This is an issue because ShellSpec clears out `PATH` when testing
if a shell is POSIX compliant. Because of this, newer versions of
yash no longer work with ShellSpec.

There's an issue relating to this on ShellSpec's project, and
there are things that I could do to bypass this, but I've never
heard of yash, so I don't really care to support it. Especially
given how much work it would be.

I did test out yash version 2.53. That was before the yash change
that broke compatibility with ShellSpec. There were test failures,
so I would have to *also* update my code... just not worth it.
Rather than each file controlling when it's run, I'm attempting to
switch to a single workflow that controls when every other workflow
is run. I'm doing this to centralize this logic so it's not
spread out across dozens of files. Also, given what I want, it's
kinda complicated. GitHub doesn't allow me to do exactly what I
want out of the box.

Note that I've documented what I want and how it *should* work in
the `README.md` files.
Badge creation is now handled by `ci.yml`, so it shouldn't be
called from each file.
Added more stuff I noticed that must be done to PR template.
When a file or directory is renamed, it will ultimately still break
the pipeline if the pipeline is not updated, but this is, arguably
an improvement.
Code coverage will now be triggered in in the same way as other tests are. Code coverage takes longer to run, and runs the same tests that are already run, however, I think it's important to know when code coverage drops.

I intend on marking the code coverage portions as depending on the non code coverage workflows. This way we don't bother running test that are known to fail.
@ReedClanton ReedClanton linked an issue Oct 14, 2026 that may be closed by this pull request
ReedClanton and others added 7 commits October 14, 2026 09:50
After thinking about this yesterday, I think that only changes to the CUT should trigger unit tests rather than also including changes to the dependencies of the CUT.

Long term, I'd like to create a basic set of functional tests that verify the interfaces between..
There's no sense in calculating code coverage when tests are
failing.
The shell I'm primarily targeting is zsh. So if tests fail on
dash, I still want to know what level of code coverage I have.

If tests fail on zsh, the sky is falling, so I don't give a shit
about code coverage.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation pathfinding Subset of total changes needed. Worked first to learn before rest of work is started.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GitHub Status Badge Pathfinding

1 participant