Repository navigation
fix: grow the PlanTimer grid and report failures in the settings header push - #1791
Merged
renemadsen merged 2 commits intoNov 13, 2026
Merged
Conversation
Add regression tests for PlanTimerSheetColumns.PlanAppends and ColumnsToAdd, mirroring the ones in eform-backendconfiguration-plugin. A stray cell far out in the header row, or a blank-header column that holds data or a formula, must not decide where a new worker's "- timer"/"- tekst" pair is written, and a full grid must be grown before the write. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Port the header-push fixes from eform-backendconfiguration-plugin to GoogleSheetHelper.PushToGoogleSheet, which the time-planning settings update runs. New worker columns written beyond the sheet's grid were refused by the Sheets API, and the error was only logged, so workers silently got no columns. - Plan appends from the first free pair after the last worker, reading the whole sheet as formulas only when columns must be placed. - Grow the grid with AppendDimension before writing the headers. - Send failures to Sentry; warn when a sheet is configured but the service account key is missing. - Read GoogleSheetId with FirstOrDefault and drop the dead inner try. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified for the worker-header placement, grid expansion, and push-failure reporting changes.
No open issues 🎉
What changed in this PR
This PR makes the time-planning settings push place new worker headers safely in PlanTimer, grow the sheet grid when needed, and report push failures through Sentry.
Changes:
- Find free columns after the last worker while preserving columns containing data or formulas.
- Expand the grid before writing headers, skip unconfigured sheets, and report missing credentials and exceptions.
- Add regression tests for header placement and grid growth.
| File | Description |
|---|---|
| eFormAPI/Plugins/TimePlanning.Pn/TimePlanning.Pn/Infrastructure/Helpers/PlanTimerSheetColumns.cs | Adds data-aware header placement and grid-growth calculation. |
| eFormAPI/Plugins/TimePlanning.Pn/TimePlanning.Pn/Infrastructure/Helpers/GoogleSheetHelper.cs | Reads formulas before placement, expands the grid, and reports failures to Sentry. |
| eFormAPI/Plugins/TimePlanning.Pn/TimePlanning.Pn.Test/PlanTimerSheetColumnsTests.cs | Tests placement around occupied columns and required grid expansion. |
Review effort: Balanced
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.
Bug
Saving the time-planning settings runs
GoogleSheetHelper.PushToGoogleSheet, which appends a- timer/- tekstheader pair to thePlanTimersheet for every active worker that has none. This plugin's copy never got the fixes made to the same push in eform-backendconfiguration-plugin (fd3b5b7, 9a7512a, 628ddd8):existingHeaders.Count, i.e. after the last non-empty cell of row 1, without growing the sheet's grid. A write beyond the grid's last column is refused by the Sheets API.LogError(not sent to Sentry), and the settings save reported success, so a worker silently got no columns.Regression test
TimePlanning.Pn.Test/PlanTimerSheetColumnsTests.cs(already in CI shard b), mirroring the backendconfiguration tests:PlanAppends_TwoWorkersFormulaColumnAndStrayCell_AppendsInTheFirstFreePairAfterTheLastWorker(the scenario: two workers, a formula under a blank header right after them, a stray cell far out; the new pair goes in the first free pair after the last worker andColumnsToAddreports the missing grid column)PlanAppends_StrayCellFarOutInTheHeaderRow_AppendsRightAfterTheLastWorker,PlanAppends_UnsuffixedLabelFarOut_IsNotTakenForTheLastWorker,PlanAppends_BlankHeaderWithDataUnderIt_IsSkipped,PlanAppends_FormulaUnderABlankHeader_IsSkipped,PlanAppends_NoFreePairInsideTheRow_AppendsAfterTheLastUsedColumnColumnsToAdd_GrowsTheGridOnlyWhenTheHeadersDoNotFitWithout the fix these do not compile (
PlanAppendstakes no data rows,ColumnsToAdddoes not exist), and the old placement (existingHeaders.Count) gives the wrong first column.Fix
PlanTimerSheetColumns: portPlanAppends(…, dataRows),LastWorkerColumn,FirstFreeColumnsandColumnsToAddverbatim from backendconfiguration.GoogleSheetHelper.PushToGoogleSheet:FirstOrDefaulton theGoogleSheetIdsetting; return when no sheet is configured.MissingCredentialswarning (log + Sentry) when a sheet is configured butPRIVATE_KEY_IDis not set.FORMULAonly when columns must be placed, and plan with those rows.EnsureColumnsAsyncgrows the grid withAppendDimensionbeforeValues.Update.SentrySdk.CaptureExceptionin the catch; the dead inner try block is removed.Testing
dotnet build eFormAPI/Plugins/TimePlanning.Pn/TimePlanning.Pn.slnsucceeds locally. Tests run only in CI: shard b should show the newPlanTimerSheetColumnsTestspassing.Kanban card #5602
🤖 Generated with Claude Code