Skip to content
This repository has been archived by the owner on Jun 15, 2024. It is now read-only.

Commit

Permalink
Remove check for nil state-atoms: Meant for tests constructing incomp…
Browse files Browse the repository at this point in the history
…lete pipeline-state-components that have already been fixed
  • Loading branch information
flosell committed Oct 16, 2016
1 parent 411431b commit 2fc0ee9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ The official release will have a defined and more stable API. If you are already
* Breaking Changes:
* Moved pipeline-state-updater from `lambdacd.internal.pipeline-state` to `lambdacd.state.internal.pipeline-state-updater` and refactored interface. As this is an internal namespace, it should not affect users unless they customized LambdaCDs startup procedure to a large degree.
* The fix for #135 changes the behavior of step result inheritance by introducing a sliding window that compresses several step result update events into one: Steps inheriting their childens results via the `:unify-status-fn` or `:unify-results-fn` (e.g. chaining steps) might not pass on intermediate update events; the ultimately resulting unified step result will remain the same.
* Removed `nil`-check from `DefaultPipelineState/{update,consume-step-result-update}`: This was meant as a convenience for internal tests that set up incomplete components. Tests have since been fixed so this is no longer necessary. If you are impacted by this issue, make sure you create `DefaultPipelineState` with `new-default-pipeline-state`

## 0.10.0

Expand Down
9 changes: 4 additions & 5 deletions src/clj/lambdacd/internal/default_pipeline_state.clj
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,10 @@

protocols/StepResultUpdateConsumer
(consume-step-result-update [self build-number step-id step-result]
(if (not (nil? state-atom)) ; convenience for tests: if no state exists we just do nothing
(let [new-state (swap! state-atom #(->> %
(update-step-result-in-state build-number step-id step-result)
(truncate-build-history home-dir max-builds)))]
(persistence/write-build-history home-dir build-number new-state))))
(let [new-state (swap! state-atom #(->> %
(update-step-result-in-state build-number step-id step-result)
(truncate-build-history home-dir max-builds)))]
(persistence/write-build-history home-dir build-number new-state)))
protocols/QueryStepResultsSource
(get-step-results [self build-number]
(get @state-atom build-number)))
Expand Down

0 comments on commit 2fc0ee9

Please sign in to comment.