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

Add additional ":lineage" command and message #915

Merged
merged 20 commits into from
Aug 30, 2024

Conversation

LukasPietzschmann
Copy link
Collaborator

@LukasPietzschmann LukasPietzschmann commented Aug 28, 2024

The new command requires a criterion and will provide the object's lineage.
Imagine the following code:

c <- x
b <- c
a <- b

and the following request:

:lineage 3@a

This will result in [<id of b>, <id of c>, <id of x>]

Basically, we just walk def and read edges in the dfg and remember the nodes we visited.


Note that the PR differs a bit from what was promised in the linked issue. Upsi :)


TODOs:

@LukasPietzschmann LukasPietzschmann added enhancement New feature or request cli Refers to a Command Line Interface labels Aug 28, 2024
@LukasPietzschmann LukasPietzschmann self-assigned this Aug 28, 2024
@LukasPietzschmann LukasPietzschmann linked an issue Aug 28, 2024 that may be closed by this pull request
@EagleoutIce
Copy link
Member

After the functionality and API is completed, the message should be added to the Interface wiki page

@EagleoutIce
Copy link
Member

If the features as they are given here suffice for your purpose we may want to unlink the issue or outsource the rest into a new one.

@LukasPietzschmann LukasPietzschmann marked this pull request as ready for review August 30, 2024 10:58
src/cli/repl/commands/lineage.ts Outdated Show resolved Hide resolved
src/cli/repl/commands/lineage.ts Outdated Show resolved Hide resolved
src/cli/repl/commands/lineage.ts Show resolved Hide resolved
src/cli/repl/server/connection.ts Outdated Show resolved Hide resolved
src/cli/repl/server/messages/lineage.ts Outdated Show resolved Hide resolved
@EagleoutIce
Copy link
Member

I'll check asap

@EagleoutIce
Copy link
Member

@LukasPietzschmann are you fine with the changes?

@LukasPietzschmann
Copy link
Collaborator Author

LukasPietzschmann commented Aug 30, 2024

Year I'm fine with that. An hour ago I also thought about writing some tests, but looks like I forgotten about it seconds later. So thanks a lot for writing them!

@EagleoutIce EagleoutIce merged commit 429eef3 into main Aug 30, 2024
14 checks passed
@EagleoutIce EagleoutIce deleted the 903-add-additional-get_origin-command branch August 30, 2024 13:24
@EagleoutIce
Copy link
Member

This pull request is included in v2.0.17 (see Release v2.0.17 (Forcing Arguments, Improved Side-Effect Detection, and Lineage Command)).

LukasPietzschmann added a commit that referenced this pull request Sep 12, 2024
* feat: first attempt at the new getLineage command

* feat: walk additional edges for determining the lineage

* feat: store lineage IDs in a set

* feat: prevent infinite recursion when determining the lineage IDs

* feat-fix: fixed lineage network request

* feat-fix: get the dfg and ast from the pipeline in the correct way

* doc: added lineage request doc

* feat-fix: add filetoken to error messages

Co-authored-by: Florian Sihler <florian.sihler@uni-ulm.de>

* feat-fix: updated comment for better clarity

* feat-fix: more guards, more better

* feat-fix: clearer function interface

* feat-fix: removed unused import

No I didn't push with --no-verify

* feat-fix: removed console.log

Co-authored-by: Florian Sihler <florian.sihler@uni-ulm.de>

* feat-fix: criteria resolve now only requires an idmap

* test(lineage): basic test setup

* lint-fix: handle linter issues and empty test labels

* refactor(lineage): remove redundant promise

* doc(lineage): refine wiki entries

---------

Co-authored-by: Florian Sihler <florian.sihler@uni-ulm.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli Refers to a Command Line Interface enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add additional "get_origin" command
2 participants