Follow-up: finish the goos refactor and harden callLog's zero-arg case
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 65/100
Research direction
Look at cmd_service.go for the functions serviceIsCurrent and reportInstallSuccess to see where they still branch on goos internally. Also examine cmd_service_systemd_test.go's callLog helper to understand its current echo "$@" behavior. The goal is to refactor the goos branching to use the passed parameter and change callLog to output a distinguishable string even for zero arguments. Run the existing service tests to ensure changes don't break anything.
Written by the indexing model from the issue text.
Description
Context
Two follow-up items surfaced during review of #1080 (the fakeSystemctl/fakeLoginctl test harness), both explicitly noted by the reviewer as out of scope for that PR:
Items
-
serviceIsCurrent(cmd_service.go) andreportInstallSuccess(cmd_service.go:498) already receivegoos/runtime.GOOSas a parameter but still branch on it internally in places, the same patternloadService/controlService/supervisorRunning/unloadServicehad before #1080's refactor. Their darwin-only and linux-only logic still can't be exercised from the other host. Second half of the same refactor #1080 did for the other four functions. -
cmd_service_systemd_test.go'scallLoghelper writesecho "$@"to the log file; a zero-argument invocation would append a blank line, whichreadCallLogfilters out as empty — making a real (bugged) zero-argument call indistinguishable from a genuine "never called" outcome. Latent only: no real call site in the current code passes zero arguments, so nothing exercises this today. Worth hardening (e.g.echo "argv: $@") before it silently matters.
Additional Context
Both found during the #1076/#1080 review cycle for #945 (Linux install and systemd service lifecycle verification). Neither blocks anything currently shipped; low priority.
- Dominant language
- Go
- Stars
- 13
- Forks
- 40
- Avg merge
- 12h 17m
- Merged PRs (30d)
- 187
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from rossoctl/cortex
-
Bob Shell support Openenhancement
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
nice to have
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
santhosh-tekuri/jsonschema#276 ·
-
stage-fail
Difficulty 1/5 Under an hour Newbie friendliness 75/100
siyuan-note/bazaar#2270 ·