-
Notifications
You must be signed in to change notification settings - Fork 46
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 preliminary python support #348
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
f6e0d36
Updated protocol to more recent version
JonahSussman 6584079
Update types for robustness
JonahSussman 8448e49
Merge branch 'konveyor:main' into update-protocol
JonahSussman 6982513
Resolve merge conflicts
JonahSussman 6681eeb
Merge branch 'main' into update-protocol
JonahSussman f55d500
Added python support via generic-external-provider
JonahSussman 44af4d8
Merge branch 'main' into python-exploration
JonahSussman d48a9d5
Fixed Python venv example and demo-testing.yml
JonahSussman eb032bc
Fixed issue where nonconforming notification responses gummed up the …
JonahSussman 024f778
Fixed requested changes
JonahSussman 1ddb892
Fixed nits and added more robust jsonrpc2 debugger
JonahSussman File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,9 @@ FROM jaegertracing/all-in-one:latest AS jaeger-builder | |
# The unofficial base image w/ jdtls and gopls installed | ||
FROM quay.io/konveyor/jdtls-server-base | ||
|
||
RUN python3 -m ensurepip --upgrade | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note to selves, we need to eventually find a way to have these broken up and use some shared filesystem while running. Probably something for Kantra to figure out. Do we have an issue for this? |
||
RUN python3 -m pip install python-lsp-server | ||
|
||
COPY --from=jaeger-builder /go/bin/all-in-one-linux /usr/bin/ | ||
|
||
COPY --from=builder /analyzer-lsp/konveyor-analyzer /usr/bin/konveyor-analyzer | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what sorcery is this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the incidents in a violation can be returned in any order,
git diff
kept failing. i.e.git diff
would compareand fail. This is because diff only compares the textual differences between the files. It has no knowledge of the YAML structure. To fix this, I installed
yq
which allows us to examine the actual structure of the input YAML. My whole goal was to still usediff
to compare the two files, but make the position of each incident in the array irrelevant.Moving from right to left, I first get the different versions of
demo-output.yaml
. I then pipe that intoyq
, with the-o=props
flag .-P 'sort_keys(..)'
is actually unnecessary due to what I do later. If we piped the YAML files I showed into that, it would return:I then pipe that output into
sed
, replacing everyincidents.<number>
withincidents.x
to erase which index each element is in. Finally, I sort the result anddiff
the two streams. Both files would returnWhich is the same thing. No error, ta-da!
There might be a better way than cobbling together some shell commands for this. I wouldn't even be surprised if there was a way you could do all of this in
yq
! At least one of the advantages of having it installed is that we can investigate the actual structure of the YAML now in our tests.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JonahSussman lovely, I think this is a much better version of what we are doing in Kantra now, would love to copy it there
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would consider it a great honor, copy away! I would remove the
-P 'sort_keys(..)'
part as I'm almost positive it's redundant.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we sort these in the engine then?