Repository navigation
do not pass config and user between cmd functions - #35
Merged
Merged
Conversation
individual-it
requested review from
PrajwolAmatya,
ishabaral and
saw-jan
and
a balanced review from Copilot
and removed request for
Copilot
November 16, 2026 08:51
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The initialization hook blocks local-only commands when configuration is missing or the Tmetric API is unavailable, preventing guidance and shell completion from working without credentials or network access.
1 open issue
What changed in this PR
Centralizes configuration and Tmetric user initialization in the CLI, reducing parameter passing between command helpers. This refactor builds on the Jira diff integration from #33.
Changes:
- Adds shared command state initialized through the root pre-run hook.
- Updates check, copy, diff, and export commands to use that shared state.
- Removes unused Cobra boilerplate comments.
| File | Description |
|---|---|
jira/jira.go |
Adds Jira worklog retrieval and filtering from #33. |
jira/issue.go |
Adds Jira project metadata from #33. |
cmd/tmetric.go |
Uses shared state in validation helpers. |
cmd/root.go |
Centralizes configuration and user initialization. |
cmd/export.go |
Uses shared state in export template helpers. |
cmd/diff.go |
Uses shared state alongside #33’s Jira comparison support. |
cmd/copy.go |
Calls shared initialization and simplifies entry checks. |
cmd/copy-openproject.go |
Removes configuration and user parameters from transfer helpers. |
cmd/copy-jira.go |
Removes configuration and user parameters from transfer helpers. |
cmd/check.go |
Removes unused flag-example comments. |
Review effort: Balanced
individual-it
force-pushed
the
globalVar
branch
from
November 16, 2026 09:00
ff5ebba to
7d73b62
Compare
individual-it
force-pushed
the
globalVar
branch
from
November 16, 2026 09:41
7d73b62 to
020e2a7
Compare
PrajwolAmatya
approved these changes
Nov 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

this is on top of #33, so only review the last commit
Initializing and passing around the
configandtmetricUservariables around thecmdpackage does not really make sense as they never change. Specially because initializingtmeztricUserresults in API requests.So better to initialize them once and reuse wherever needed.