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

Export utils for import tracking and refs #247

Merged
merged 4 commits into from
Aug 23, 2023

Conversation

alexzielenski
Copy link
Contributor

@alexzielenski alexzielenski commented Aug 18, 2023

Avoids duplication of default tag parsing to be used in OpenAPI-gen

  • Exports the function used by defaulter-gen to parse symbols for use with OpenAPI.
  • Refactors the same function to take the source comment package path as input to avoid bugs with local symbols

Also includes some cleanup around the ImportTracker since OpenAPI-gen also needs to use AddSymbol:

  • Adds NewImportTrackerForPackage so that local package can be provided to DefaultImportTracker
  • Exposes AddSymbol on ImportTracker to be used by OpenAPI-gen and defaulter-gen
  • Removes defaulter-gen's local symbolTracker interface since it is no longer necessary

required by kubernetes/kube-openapi#419

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Aug 18, 2023
@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Aug 18, 2023
@alexzielenski
Copy link
Contributor Author

/cc @apelisse

@k8s-ci-robot k8s-ci-robot requested a review from apelisse August 18, 2023 21:51
Copy link
Member

@apelisse apelisse left a comment

Choose a reason for hiding this comment

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

I don't see a test being updated, shouldn't we have a test if this becomes a public method?

generator/import_tracker.go Show resolved Hide resolved
@alexzielenski
Copy link
Contributor Author

added local package test

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Aug 21, 2023
Copy link
Member

@apelisse apelisse left a comment

Choose a reason for hiding this comment

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

Thanks
/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 22, 2023
@alexzielenski alexzielenski changed the title Export default symbol reference parsing Export utils for import tracking and refs Aug 23, 2023
@sttts
Copy link
Contributor

sttts commented Aug 23, 2023

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: alexzielenski, apelisse, sttts

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 23, 2023
@k8s-ci-robot k8s-ci-robot merged commit 036e7fc into kubernetes:master Aug 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants