-
Notifications
You must be signed in to change notification settings - Fork 8
Con 1896 jobs progress #95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
az-smartling
wants to merge
11
commits into
master
Choose a base branch
from
CON-1896_jobs_progress
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
1400fbc
CON-1896 jobs progress
az-smartling 33a8474
go mod tidy
az-smartling a01e411
updated md docs
az-smartling 9385101
CR changes
az-smartling 041b889
tests
az-smartling 217a008
CR changes
az-smartling a5b6a01
added job test to Makefile
az-smartling e7d6c3c
CON-1896 Update command descriptions.
dimitrystd df90e7c
Enhanced CLAUDE.md. Updated Makefile for module vendoring and improve…
dimitrystd 8d3c4e3
Fix cmd_locates_test.
dimitrystd bf5a566
Add 'Run Tests' stage to Jenkins pipeline with JUnit reporting
dimitrystd File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
File renamed without changes.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| package resolve | ||
|
|
||
| import ( | ||
| "github.com/Smartling/smartling-cli/output" | ||
| clierror "github.com/Smartling/smartling-cli/services/helpers/cli_error" | ||
|
|
||
| "github.com/spf13/cobra" | ||
| ) | ||
|
|
||
| // OutputParams resolve OutputParams for subcommands | ||
| func OutputParams(cmd *cobra.Command, fileConfigMTFileFormat *string) (output.Params, error) { | ||
| const outputTemplateFlag = "format" | ||
| format, err := cmd.Parent().PersistentFlags().GetString("output") | ||
| if err != nil { | ||
| return output.Params{}, clierror.UIError{ | ||
| Operation: "get output", | ||
| Err: err, | ||
| Description: "unable to get output param", | ||
| } | ||
| } | ||
| template := FallbackString(cmd.Flags().Lookup(outputTemplateFlag), StringParam{ | ||
| FlagName: outputTemplateFlag, | ||
| Config: fileConfigMTFileFormat, | ||
| }) | ||
|
|
||
| mode, err := cmd.Parent().PersistentFlags().GetString("output-mode") | ||
| if err != nil { | ||
| return output.Params{}, clierror.UIError{ | ||
| Operation: "get output mode", | ||
| Err: err, | ||
| Description: "unable to get output mode param", | ||
| } | ||
| } | ||
| return output.Params{ | ||
| Mode: mode, | ||
| Format: format, | ||
| Template: template, | ||
| }, nil | ||
| } |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| package jobs | ||
|
|
||
| import ( | ||
| "fmt" | ||
| "slices" | ||
| "strings" | ||
|
|
||
| "github.com/spf13/cobra" | ||
| ) | ||
|
|
||
| const ( | ||
| outputFormatFlag = "output" | ||
| ) | ||
|
|
||
| var ( | ||
| outputFormat string | ||
| allowedOutputs = []string{ | ||
| "json", | ||
| "simple", | ||
| } | ||
| joinedAllowedOutputs = strings.Join(allowedOutputs, ", ") | ||
| ) | ||
|
|
||
| // NewJobsCmd returns new jobs command | ||
| func NewJobsCmd() *cobra.Command { | ||
| jobsCmd := &cobra.Command{ | ||
| Use: "jobs", | ||
| Short: "Manage translation jobs and monitor their progress.", | ||
| Long: `Translation jobs are the fundamental unit of work in Smartling TMS that organize | ||
| content for translation and track it through the translation workflow. | ||
|
|
||
| The jobs command group provides tools to interact with translation jobs, including | ||
| monitoring translation progress, viewing job details, and managing job workflows. | ||
|
|
||
| Each job contains one or more files targeted for translation into specific locales, | ||
| with defined due dates and workflow steps. Jobs help coordinate translation work between | ||
| content owners, project managers, and translators. | ||
|
|
||
| Available options: | ||
| --output string Output format: ` + joinedAllowedOutputs + ` (default "simple") | ||
| - simple: Human-readable format optimized for terminal display | ||
| - json: Raw API response for programmatic processing and automation`, | ||
| Example: ` | ||
| # View job progress in human-readable format | ||
|
|
||
| smartling-cli jobs progress "Website Q1 2026" | ||
|
|
||
| # Get detailed progress data for automation | ||
|
|
||
| smartling-cli jobs progress aabbccdd --output json | ||
|
|
||
| `, | ||
| PreRunE: func(cmd *cobra.Command, args []string) error { | ||
| if !slices.Contains(allowedOutputs, outputFormat) { | ||
| return fmt.Errorf("invalid output: %s (allowed: %s)", outputFormat, joinedAllowedOutputs) | ||
| } | ||
| return nil | ||
| }, | ||
| RunE: func(cmd *cobra.Command, args []string) error { | ||
| if len(args) == 0 && cmd.Flags().NFlag() == 0 { | ||
| return cmd.Help() | ||
| } | ||
| return nil | ||
| }, | ||
| } | ||
|
|
||
| jobsCmd.PersistentFlags().StringVar(&outputFormat, outputFormatFlag, "simple", "Output format: "+joinedAllowedOutputs) | ||
|
|
||
| return jobsCmd | ||
| } |
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@az-smartling I updated the
Makefilebecause I keep having the same issue when I try to build something. Please let me know if this fix is not correct.