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 fallbacks for when workspace/symbol isn't giving us what we need #304

Merged
merged 4 commits into from
Sep 14, 2023

Conversation

fabianvf
Copy link
Contributor

@fabianvf fabianvf commented Aug 22, 2023

  • This is currently failing with Go for... some reason. It can't load packages anymore?
  • This is probably going to be hideously slow on large projects, the directory tree search will need to be parallelized before this is a feasible approach
  • I haven't verified that this works with other providers. We should give the experimental python one another try

@fabianvf fabianvf marked this pull request as draft August 22, 2023 14:48
Signed-off-by: Fabian von Feilitzsch <[email protected]>
@@ -35,4 +35,22 @@ func main() {
s := provider.NewServer(client, *port, log)
ctx := context.TODO()
s.Start(ctx)
// serviceClient, err := client.Init(ctx, log, provider.InitConfig{
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We should remove this, but being able to run the provider directly has been really nice for debugging. Maybe should add a debug subcommand or something for this.

Copy link
Contributor

Choose a reason for hiding this comment

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

make it a hidden subcommand in the main binary?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think it can work in the main binary, would have to be in the provider binaries since the communication between the two is over RPC. Here you can delve debug / see the print statements.

Side note, we really should be capturing the stdout from these providers and presenting them to the users, I don't think we do currently (right?)

Copy link
Contributor

Choose a reason for hiding this comment

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

Not in a real way, There is the plumbing to do it though

We have one set of questions with that, though,

  1. Do we print it out as it happens, or do we bunch them together once a given evaluation is finished
  2. Are there log levels that need to be returned, is this a verbosity thing where we only print on high levels?

Let me know if you want me to take a stab at it. @pranavgaikwad I am out of the loop on what is important now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think we should print them as they happen, I wouldn't necessarily bother with verbosity levels as a first-class thing since a provider can always implement verbosity levels through providerSpecificConfig. So we'd just want to log with an identifier that lets you know which provider name is logging and do it in real time so that hangs/etc can be debugged

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think if you wanted to take a stab at it it would be a huge boon to developing providers. such a PITA right now

Copy link
Contributor

Choose a reason for hiding this comment

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

@shawn-hurley @fabianvf let me know if this sums up the work #312

Copy link
Contributor

Choose a reason for hiding this comment

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

will do then!

@@ -75,29 +79,119 @@ func (p *genericServiceClient) Evaluate(cap string, conditionInfo []byte) (provi
}

func (p *genericServiceClient) GetAllSymbols(query string) []protocol.WorkspaceSymbol {
logger, err := os.OpenFile("golang-provider.log",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should be removed, this was just for debugging when running from analyzer-lsp

@fabianvf fabianvf changed the title [wip] add fallbacks for when workspace/symbol isn't giving us what we need ✨ [wip] add fallbacks for when workspace/symbol isn't giving us what we need Aug 29, 2023
Signed-off-by: Fabian von Feilitzsch <[email protected]>
@fabianvf fabianvf marked this pull request as ready for review August 29, 2023 23:23
Signed-off-by: Fabian von Feilitzsch <[email protected]>
@fabianvf fabianvf changed the title ✨ [wip] add fallbacks for when workspace/symbol isn't giving us what we need ✨ add fallbacks for when workspace/symbol isn't giving us what we need Aug 30, 2023
- message: 'golang apiextensions/v1/customresourcedefinitions found {{file}}:{{lineNumber}}'
ruleID: go-lang-ref-001
when:
go.referenced:
pattern: "v1beta1.CustomResourceDefinition"
pattern: ".*v1beta1.CustomResourceDefinition"
Copy link
Contributor

Choose a reason for hiding this comment

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

why is this needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This should make it trigger the fallback

@shawn-hurley shawn-hurley merged commit ab5343b into konveyor:main Sep 14, 2023
7 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.

3 participants