Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: trailblazer/trailblazer-operation
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.7.5
Choose a base ref
...
head repository: trailblazer/trailblazer-operation
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Loading
Showing with 2,860 additions and 1,323 deletions.
  1. +3 −4 .github/workflows/ci.yml
  2. +0 −8 .rubocop.yml
  3. +0 −223 .rubocop_todo.yml
  4. +32 −0 CHANGES.md
  5. +5 −12 Gemfile
  6. +12 −13 lib/trailblazer/operation.rb
  7. +0 −42 lib/trailblazer/operation/callable.rb
  8. +8 −5 lib/trailblazer/operation/class_dependencies.rb
  9. +33 −18 lib/trailblazer/operation/public_call.rb
  10. +13 −7 lib/trailblazer/operation/railway.rb
  11. +0 −23 lib/trailblazer/operation/railway/macaroni.rb
  12. +0 −51 lib/trailblazer/operation/trace.rb
  13. +1 −1 lib/trailblazer/operation/version.rb
  14. +11 −0 lib/trailblazer/operation/wtf.rb
  15. +32 −10 test/call_test.rb
  16. +0 −147 test/callable_test.rb
  17. +33 −2 test/class_dependencies_test.rb
  18. +72 −0 test/docs/autogenerated/activity_basics_test.rb
  19. +880 −0 test/docs/autogenerated/composable_variable_mapping_test.rb
  20. +76 −0 test/docs/autogenerated/fast_track_layout_test.rb
  21. +382 −0 test/docs/autogenerated/mechanics_test.rb
  22. +202 −0 test/docs/autogenerated/sequence_options_test.rb
  23. +257 −0 test/docs/autogenerated/subprocess_test.rb
  24. +435 −0 test/docs/autogenerated/wiring_api_test.rb
  25. +27 −0 test/docs/developer_test.rb
  26. +0 −190 test/docs/doormat_test.rb
  27. +0 −31 test/docs/macaroni_test.rb
  28. +96 −0 test/docs/public_call_monkeypatching_test.rb
  29. +38 −0 test/docs/result_test.rb
  30. +93 −0 test/docs/step_dsl_test.rb
  31. +54 −14 test/operation_test.rb
  32. +1 −1 test/result_test.rb
  33. +0 −66 test/skill_test.rb
  34. +14 −25 test/step_test.rb
  35. +17 −5 test/test_helper.rb
  36. +27 −43 test/trace_test.rb
  37. +0 −113 test/wire_test.rb
  38. +0 −193 test/wiring/defaults_test.rb
  39. +0 −70 test/wiring/subprocess_test.rb
  40. +6 −6 trailblazer-operation.gemspec
7 changes: 3 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -5,13 +5,12 @@ jobs:
strategy:
fail-fast: false
matrix:
# Due to https://github.com/actions/runner/issues/849, we have to use quotes for '3.0'
ruby: [2.5, 2.6, 2.7, '3.0', head, jruby, jruby-head]
ruby: [2.5, 2.6, 2.7, '3.0', '3.1', '3.2', "3.3", 'jruby']
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
bundler-cache: true
- run: bundle exec rake
8 changes: 0 additions & 8 deletions .rubocop.yml

This file was deleted.

223 changes: 0 additions & 223 deletions .rubocop_todo.yml

This file was deleted.

32 changes: 32 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,35 @@
## 0.11.0

* Introduce `Operation.call_with_public_interface_from_call` which merges `ctx` and `circuit_options`
accordingly, so the overrider of `Operation.call_with_public_interface` gets correct args.
* Removing `Operation.trace`, you've been warned! Use `Operation.wtf?`. This also removes `Result#wtf`.
See [https://github.com/trailblazer/trailblazer-operation/blob/3f821c7d576e7ccccf580fbd8c9305501fdc5d2c/test/trace_test.rb#L22](this sample test case)
if you need a more low-level interface to tracing.
* No need to pass `:exec_context` in `#call_with_public_interface`. This is done in `Strategy.call`.
* Rename `Result#event` to `Result#terminus` for consistency. Deprecate `Result#event`.

## 0.10.1

* Deprecate `Operation.trace` and `Result#wtf?` in favor of `Operation.wtf?`.
* Use `trailblazer-developer-0.1.0`.

## 0.10.0

* Require `trailblazer-activity-dsl-linear-1.2.0`.
* Remove `Railway::Macaroni`.
* Remove `Operation::Callable`.
* Introduce `Operation::INITIAL_WRAP_STATIC` that is computed once at compile-time, not
with every `#call`.

## 0.9.0

* Use `trailblazer-activity-dsl-linear` 1.1.0.
* Pass `:container_activity` to `TaskWrap.invoke` instead of the superseded `:static_wrap` option.

## 0.8.0

* Use `trailblazer-activity-dsl-linear` 1.0.0.

## 0.7.5

* Upgrade `trailblazer-activity` & `trailblazer-activity-dsl-linear` patch versions.
17 changes: 5 additions & 12 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -3,16 +3,9 @@ source 'https://rubygems.org'
# Specify your gem's dependencies in trailblazer.gemspec
gemspec

gem "multi_json"
# gem "trailblazer-developer", path: "../trailblazer-developer"
# gem "trailblazer-activity", path: "../trailblazer-activity"
# gem "trailblazer-activity-dsl-linear", path: "../trailblazer-activity-dsl-linear"

gem "dry-auto_inject"

gem "benchmark-ips"
gem "minitest-line"

# gem "trailblazer-developer", path: "../trailblazer-developer"
# gem "trailblazer-developer", git: "https://github.com/trailblazer/trailblazer-developer"
# gem "trailblazer-activity", path: "../trailblazer-activity"
# gem "trailblazer-context", path: "../trailblazer-context"
# gem "trailblazer-activity-dsl-linear", path: "../trailblazer-activity-dsl-linear"
# gem "trailblazer-activity", github: "trailblazer/trailblazer-activity"
# gem "trailblazer-activity", github: "trailblazer/trailblazer-activity"
# gem "trailblazer-developer", github: "trailblazer/trailblazer-developer"
25 changes: 12 additions & 13 deletions lib/trailblazer/operation.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
require "trailblazer/activity/dsl/linear"
require 'forwardable'
require 'trailblazer/operation/version'
require "trailblazer/option"
require "trailblazer/context"

require "trailblazer/activity/dsl/linear"

#
# Developer's docs: https://trailblazer.to/2.1/docs/internals.html#internals-operation
#
module Trailblazer
# DISCUSS: I don't know where else to put this. It's not part of the {Activity} concept
# As opposed to {Activity::Railway} and {Activity::FastTrack} an operation
# maintains different terminus subclasses.
# DISCUSS: remove this, at some point in time!
class Activity
class Railway
module End
@@ -31,26 +33,25 @@ def self.OptionsForState()
end
end

# DISCUSS: where do we need this?
def self.Operation(options)
Class.new(Activity::FastTrack( Activity::Operation.OptionsForState.merge(options) )) do
extend Operation::PublicCall
end
end

# The Trailblazer-style operation.
# Note that you don't have to use our "opinionated" version with result object, skills, etc.
class Operation < Activity::FastTrack(Activity::Operation.OptionsForState)
# extend Skill::Accessors # ::[] and ::[]= # TODO: fade out this usage.

# Note that you don't have to use our "opinionated" version with result object, etc.
class Operation < Activity::FastTrack(**Activity::Operation.OptionsForState)
class << self
alias_method :strategy_call, :call
end

require "trailblazer/operation/public_call" # TODO: Remove in 3.0.
extend PublicCall # ::call(params: .., current_user: ..)

require "trailblazer/operation/trace"
extend Trace # ::trace
require "trailblazer/operation/wtf"
extend Wtf # ::trace
end
end

@@ -59,5 +60,3 @@ class << self

require "trailblazer/operation/result"
require "trailblazer/operation/railway"

require "trailblazer/operation/railway/macaroni"
Loading