Skip to content

refactor: isolate logging group state by task instance (#670) - #728

Closed
Jamie-BitFlight wants to merge 1 commit into
fix/670-logger-environment-detectionfrom
refactor/670-logger-instance-group-state
Closed

Jamie-BitFlight wants to merge 1 commit into
fix/670-logger-environment-detectionfrom
refactor/670-logger-instance-group-state

Conversation

@Jamie-BitFlight

Copy link
Copy Markdown
Contributor

Stacked on #723. The existing static map keys group state by task name, so separate instances sharing a name can interfere. Store group state per instance instead. Preserve global indentation width and existing output formatting.

Draft pending tests for same-name concurrent loggers, nested group semantics, and CI. Note that group start/close behaviour must be reviewed before merge; this PR intentionally does not redesign the GitHub Actions global group stack. Related #670.

@coderabbitai

coderabbitai Bot commented Oct 10, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Jamie-BitFlight Jamie-BitFlight left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Holistic review of PRs #717–#728

Reviewed 3e62b8fe12e89dd047ce7ea122aaad32bfd724c3 against #723 at 0bf72354280e64a8cc9ff8b77d2c493ef42eea58.

Assessment: close the current storage-only PR, or replace its scope with an actual ownership correction — architectural warning (P2).

I reviewed only the map-to-instance changes against #723. The field changes test-setter isolation, but production start() never sets it true and completion does not consult it before closing groups. Actual logger and real caller probes produce the same command stream before and after this PR. This is an unresolved pre-existing lifecycle problem, not a newly introduced regression.

Two concrete reproductions are described inline: a missing-file editor closes a group it did not open, and duplicate async usage sections overlap start/completion commands on the shared Actions stream. The latter remains accepted by #726. A section updater and its editor also use separate logger instances for one logical operation, so instance identity is not sufficient ownership.

Prefer deleting dormant state if the goal is cleanup. If grouped output is to be repaired here, choose the operation that owns open/close, ensure exception cleanup, prevent helpers from closing caller-owned groups, and define grouping behavior for overlapping work. Test emitted commands through real callers rather than manually setting the private lifecycle state. This does not require a new global registry or serializing unrelated work by default.

The current two failing logger tests are inherited from #723. This stacked base also receives no real-repository integration/lint runs. Keep the sound #723 environment fix independent; restack any replacement after its test correction.

Comment thread src/logtask/index.ts
@Jamie-BitFlight

Copy link
Copy Markdown
Contributor Author

🎉 This PR is included in version 2.0.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

@Jamie-BitFlight Jamie-BitFlight added the released This issue/pull request has been released. label Oct 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released This issue/pull request has been released.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant