Skip to content

Conversation

@dersam
Copy link
Contributor

@dersam dersam commented Oct 3, 2025

More context rebinding shenanigans. Inside of a cog level execution block, cmd(:ls) returns the output object from executing that cog.

If the cog has not yet run, it will error, preventing access of cog output before you could possibly have it.

Added a CogExecutionContext to provide the execution environment for this purpose, and renamed the previous ExecutionContext to WorkflowExecutionContext to reflect its higher level purpose.

@dersam dersam mentioned this pull request Oct 3, 2025
Copy link
Contributor Author

dersam commented Oct 3, 2025

This stack of pull requests is managed by Graphite. Learn more about stacking.

@dersam dersam changed the base branch from 10-03-set_up_cog_executor_with_dsl to graphite-base/418 October 4, 2025 17:13
@dersam dersam force-pushed the 10-03-dsl_passing_output_data_between_steps branch from 0a61e05 to 11a9669 Compare October 4, 2025 17:13
@dersam dersam changed the base branch from graphite-base/418 to 10-04-set_up_typechecking_for_dsl_blocks October 4, 2025 17:13
@dersam dersam force-pushed the 10-03-dsl_passing_output_data_between_steps branch from 11a9669 to c7669a4 Compare October 4, 2025 17:48
@dersam dersam force-pushed the 10-04-set_up_typechecking_for_dsl_blocks branch from c3a6f64 to ddbeaf3 Compare October 4, 2025 17:48
@dersam dersam force-pushed the 10-03-dsl_passing_output_data_between_steps branch from c7669a4 to 4446c22 Compare October 5, 2025 16:54
@dersam dersam force-pushed the 10-04-set_up_typechecking_for_dsl_blocks branch 2 times, most recently from 6e28202 to 9449467 Compare October 5, 2025 17:22
@dersam dersam force-pushed the 10-03-dsl_passing_output_data_between_steps branch from 4446c22 to 59c5cf7 Compare October 5, 2025 17:22
@dersam dersam changed the base branch from 10-04-set_up_typechecking_for_dsl_blocks to graphite-base/418 October 7, 2025 19:19
@dersam dersam force-pushed the graphite-base/418 branch from 9449467 to e7c33fe Compare October 8, 2025 23:13
@dersam dersam force-pushed the 10-03-dsl_passing_output_data_between_steps branch from 59c5cf7 to 6fbcf85 Compare October 8, 2025 23:13
@dersam dersam changed the base branch from graphite-base/418 to main October 8, 2025 23:13
@dersam dersam changed the base branch from main to graphite-base/418 October 8, 2025 23:39
@dersam dersam force-pushed the 10-03-dsl_passing_output_data_between_steps branch from 6fbcf85 to 991368a Compare October 8, 2025 23:39
@dersam dersam changed the base branch from graphite-base/418 to 10-08-automatically_use_namespaced_config_class_if_present October 8, 2025 23:39
@dersam dersam force-pushed the 10-03-dsl_passing_output_data_between_steps branch from 991368a to 835c58e Compare October 9, 2025 00:26
@dersam dersam marked this pull request as ready for review October 9, 2025 00:29
@dersam dersam force-pushed the 10-03-dsl_passing_output_data_between_steps branch from 835c58e to 9969561 Compare October 9, 2025 00:31
@dersam dersam changed the base branch from 10-08-automatically_use_namespaced_config_class_if_present to graphite-base/418 October 9, 2025 18:05
cmd(:ls) { "ls -al" }
cmd(:echo) do
# TODO: this is a bespoke output object for cmd, is there a generic one we can offer
first_line = cmd(:ls).command_output.split("\n").second
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i love this!

end

attr_reader :output
attr_reader :name, :output
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes pls

module Roast
module DSL
# Contains the cogs already executed in this run.
class CogExecutionContext
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be called something like CogInputContext, because the proc running in this context is just generating the input for the cog's actual work, which will be done by the cog itself not in a user's proc at all

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll drop a rename PR on top of this

@juniper-shopify juniper-shopify force-pushed the 10-03-dsl_passing_output_data_between_steps branch from 9969561 to 342cb79 Compare October 9, 2025 18:06
@graphite-app graphite-app bot changed the base branch from graphite-base/418 to main October 9, 2025 18:06
@graphite-app
Copy link

graphite-app bot commented Oct 9, 2025

Merge activity

  • Oct 9, 6:06 PM UTC: Graphite rebased this pull request, because this pull request is set to merge when ready.
  • Oct 9, 6:07 PM UTC: @juniper-shopify merged this pull request with Graphite.

@juniper-shopify juniper-shopify merged commit a7d29a0 into main Oct 9, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants