Repository navigation
Move worklog aggregation into the submission service and report failures by position - #176
Merged
Merged
Conversation
…res by position The submit dialog's orchestrator held the aggregation, so nothing else could use it, and a failure found its row through the identity of the entry object, with a guess by day and ticket when that didn't work. A plugin now reports the position in the list it was handed, and the guess is gone. One SubmissionPeriod replaces the six daily and weekly overloads, so a preview and a submission of a period load the same entries, and the CLI's day and week commands share one flow. SubmissionResult.HasFailures answers what three places worked out on their own.
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.
The submit dialog's orchestrator held the aggregation, so only the GUI could use it. A failure found its row through the identity of the entry object, with a guess by day and ticket when that didn't work, and three places worked out on their own whether a submission had failed.
What changes
PluginBasedWorklogSubmissionService.PreviewAsync(period, mode, ct)returns the rows, and the orchestrator only turns them into dialog items.SubmissionPeriod(Day,WeekOf) replaces the six daily and weekly overloads withPreviewAsyncandSubmitAsync. A preview and a submission of a period now load their entries in one place. The new methods take a requiredCancellationToken.WorklogSubmissionError.WorklogbecomesWorklogIndex, the position in the list the plugin was handed. The service translates it back to the list the caller submitted, which can be longer because invalid rows never reach the plugin.TimesheetDayBatchdoes the same from a day's positions to all of them.SubmissionResultgetsHasFailuresandFailureCountand becomes immutable. UnusedIsSuccess,HasPartialSuccessandEntriesByDatego.SubmissionErrordropsTicketIdandDescription, which only the guess read.sendandsend weekshare one flow. Only the preview and the wording differ, and the output stays the same.Behavior to check
RetryFailedAsyncused to look only at the marked rows.WorklogSubmissionErrorhave to be rebuilt.Not in this PR
The CLI still sends in timed mode. The aggregation is available to it now, but a flag for it would be a new feature.
Testing
TimesheetDayBatch,GoranG3WorklogPluginandTempoWorklogPlugin.sendandsend weekfrom the CLI on a throwaway copy of a real database, with a provider that doesn't exist so nothing could be uploaded: the week previewed 36 entries, and the day failed with "not found or not running".