Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create execution context with id #6947

Merged
merged 3 commits into from
Jun 6, 2023
Merged

Conversation

4e6
Copy link
Contributor

@4e6 4e6 commented Jun 5, 2023

Pull Request Description

executionContext/create method has an optional context_id parameter. Supplying this argument makes the user's session more reproducible. I.e. this way the language server can recreate the user's session by recording the requests.

Important Notes

Checklist

Please ensure that the following checklist has been satisfied before submitting the PR:

  • The documentation has been updated, if necessary.
  • All code follows the
    Scala,
    Java,
    and
    Rust
    style guides. In case you are using a language not listed above, follow the Rust style guide.
  • All code has been tested:
    • Unit tests have been written where possible.

@4e6 4e6 added the CI: No changelog needed Do not require a changelog entry for this PR. label Jun 5, 2023
@4e6 4e6 requested a review from MichaelMauderer as a code owner June 5, 2023 12:43
@4e6 4e6 self-assigned this Jun 5, 2023
@@ -707,7 +707,9 @@ impl model::project::API for Project {
) -> BoxFuture<FallibleResult<model::ExecutionContext>> {
async move {
let ls_rpc = self.language_server_rpc.clone_ref();
let context = execution_context::Synchronized::create(ls_rpc, root_definition);
let context_id = Uuid::new_v4();
Copy link
Member

@JaroslavTulach JaroslavTulach Jun 5, 2023

Choose a reason for hiding this comment

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

Random UUID is created on the IDE side and send to the LS+engine to use it. That's a change to current behavior when no UUID is send and the LS+engine thinks one up. As a result the randomness is on the IDE side and the engine behaves (more) deterministically when fed with the same stream of messages.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this is slightly related to #6718

Copy link
Contributor

@farmaazon farmaazon left a comment

Choose a reason for hiding this comment

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

Please change the UUID generation place and it's good to go.

Comment on lines 100 to 106
pub async fn new(
project: model::Project,
method: MethodPointer,
context_id: model::execution_context::Id,
) -> FallibleResult<Self> {
let graph = controller::Graph::new_method(&project, &method).await?;
let execution = project.create_execution_context(method.clone()).await?;
let execution = project.create_execution_context(method.clone(), context_id).await?;
Copy link
Contributor

Choose a reason for hiding this comment

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

I would generate context ID here instead of https://github.com/enso-org/enso/pull/6947/files#diff-43cfb2975b079bdc838c391f870ff5150a1eb5807e912f5d1230432b76a5fc46R134

This is graph controller, and controller should have API "for the view". The view have no interest in generating context IDs.

@4e6 4e6 added the CI: Ready to merge This PR is eligible for automatic merge label Jun 6, 2023
@mergify mergify bot merged commit 76a9a95 into develop Jun 6, 2023
@mergify mergify bot deleted the wip/db/0-create-execution-context branch June 6, 2023 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI: No changelog needed Do not require a changelog entry for this PR. CI: Ready to merge This PR is eligible for automatic merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants