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

feat: migrate topics and subscriptions #2064

Merged
merged 1 commit into from
Jul 12, 2024

Conversation

worstell
Copy link
Contributor

No description provided.

@worstell worstell requested a review from alecthomas as a code owner July 12, 2024 16:02
@worstell worstell requested review from a team and deniseli and removed request for a team July 12, 2024 16:02
@ftl-robot ftl-robot mentioned this pull request Jul 12, 2024
Copy link
Collaborator

@wesbillman wesbillman left a comment

Choose a reason for hiding this comment

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

Niiiiiiice

return optional.Some(callExpr)
}

func FuncPathEquals(pass *analysis.Pass, callExpr *ast.CallExpr, path string) bool {
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: should we add comments to this func and the one above since they're public?

if _, ok = md.Type.(*schema.Data); !ok && md.Type != nil {
return optional.None[*schema.Data]()
}
common.ApplyMetadata[*schema.Data](pass, named.Obj(), func(md *common.ExtractedMetadata) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nice!

varName := topicSelExp.Sel.Name
topicRef = &schema.Ref{
Module: moduleIdent.Name,
Name: strcase.ToLowerCamel(string(varName[0]) + varName[1:]),
Copy link
Collaborator

Choose a reason for hiding this comment

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

is it safe to index into varName here without checking len?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ah nice catch- i'm not sure, this logic is directly ported. i'll add a check to be safe

@worstell worstell force-pushed the worstell/20240712-migrate-topics-subscriptions branch from 66a3782 to 73ff666 Compare July 12, 2024 16:32
@worstell worstell merged commit ddeb24e into main Jul 12, 2024
50 checks passed
@worstell worstell deleted the worstell/20240712-migrate-topics-subscriptions branch July 12, 2024 16:47
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