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 hack script to generare reference docs for the Antrea API #1507

Conversation

antoninbas
Copy link
Contributor

Generated documentation is then included on the Antrea website.
The script relies on a slightly modified version of
https://github.com/ahmetb/gen-crd-api-reference-docs. It doesn't require
running an actual apiserver, instead it uses the Go source files
directly.

@antrea-bot
Copy link
Collaborator

Thanks for your PR.
Unit tests and code linters are run automatically every time the PR is updated.
E2e, conformance and network policy tests can only be triggered by a member of the vmware-tanzu organization. Regular contributors to the project should join the org.

The following commands are available:

  • /test-e2e: to trigger e2e tests.
  • /skip-e2e: to skip e2e tests.
  • /test-conformance: to trigger conformance tests.
  • /skip-conformance: to skip conformance tests.
  • /test-all-features-conformance: to trigger conformance tests with all alpha features enabled.
  • /skip-all-features-conformance: to skip conformance tests with all alpha features enabled.
  • /test-whole-conformance: to trigger all conformance tests on linux.
  • /skip-whole-conformance: to skip all conformance tests on linux.
  • /test-networkpolicy: to trigger networkpolicy tests.
  • /skip-networkpolicy: to skip networkpolicy tests.
  • /test-windows-conformance: to trigger windows conformance tests.
  • /skip-windows-conformance: to skip windows conformance tests.
  • /test-windows-networkpolicy: to trigger windows networkpolicy tests.
  • /skip-windows-networkpolicy: to skip windows networkpolicy tests.
  • /test-hw-offload: to trigger ovs hardware offload test.
  • /skip-hw-offload: to skip ovs hardware offload test.
  • /test-all: to trigger all tests (except whole conformance).
  • /skip-all: to skip all tests (except whole conformance).

jianjuns
jianjuns previously approved these changes Nov 10, 2020
Copy link
Contributor

@jianjuns jianjuns left a comment

Choose a reason for hiding this comment

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

LGTM. I do not know much about the tool though.

# limitations under the License.

# This script is used to generate the reference docs for the Antrea API, which
# is included in the Antrea website.
Copy link
Contributor

Choose a reason for hiding this comment

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

"antrea.io website"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

abhiraut
abhiraut previously approved these changes Nov 10, 2020
{{ safe (renderComments .CommentLines) }}

{{ if and (eq (.Type.Name.Name) "ObjectMeta") }}
Refer to the Kubernetes API documentation for the fields of the
Copy link
Contributor

Choose a reason for hiding this comment

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

this text looks like something that is K8s API doc related.. im not sure how and where this is used though

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sorry for the delay, what's your question?

I didn't write this file, I copied it from https://github.com/ahmetb/gen-crd-api-reference-docs as it seems to be how it's meant to be used. My understanding is that this specific part generates a generic description for the ObjectMeta fields in API resources. See https://antrea.io/docs/master/api-reference/.

Generated documentation is then included on the Antrea website.
The script relies on a slightly modified version of
https://github.com/ahmetb/gen-crd-api-reference-docs. It doesn't require
running an actual apiserver, instead it uses the Go source files
directly.
@antoninbas antoninbas dismissed stale reviews from abhiraut and jianjuns via 50d6ad7 December 3, 2020 21:36
@antoninbas antoninbas force-pushed the add-script-to-generate-api-reference-docs branch from 1b9275a to 50d6ad7 Compare December 3, 2020 21:36
@codecov-io
Copy link

codecov-io commented Dec 3, 2020

Codecov Report

Merging #1507 (50d6ad7) into master (9d3d10b) will decrease coverage by 1.28%.
The diff coverage is 56.44%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1507      +/-   ##
==========================================
- Coverage   63.31%   62.03%   -1.29%     
==========================================
  Files         170      181      +11     
  Lines       14250    15300    +1050     
==========================================
+ Hits         9023     9492     +469     
- Misses       4292     4790     +498     
- Partials      935     1018      +83     
Flag Coverage Δ
kind-e2e-tests 52.44% <54.10%> (-2.95%) ⬇️
unit-tests 40.50% <17.13%> (-0.78%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
cmd/antrea-agent/agent.go 0.00% <0.00%> (ø)
cmd/antrea-agent/options.go 21.69% <0.00%> (+0.97%) ⬆️
...gent/controller/noderoute/node_route_controller.go 46.06% <ø> (-0.41%) ⬇️
.../agent/flowexporter/connections/conntrack_linux.go 28.37% <0.00%> (-0.79%) ⬇️
pkg/agent/stats/collector.go 92.04% <ø> (-5.69%) ⬇️
pkg/controller/networkpolicy/tier.go 90.00% <ø> (ø)
pkg/features/antrea_features.go 16.66% <ø> (ø)
pkg/ovs/openflow/ofctrl_builder.go 60.58% <0.00%> (-1.59%) ⬇️
pkg/ovs/openflow/ofctrl_group.go 48.57% <0.00%> (-4.56%) ⬇️
pkg/ovs/openflow/ofctrl_action.go 51.26% <5.71%> (-10.10%) ⬇️
... and 62 more

@antoninbas
Copy link
Contributor Author

/skip-all

@antoninbas antoninbas merged commit 6a03e80 into antrea-io:master Dec 4, 2020
@antoninbas antoninbas deleted the add-script-to-generate-api-reference-docs branch December 4, 2020 22:48
antoninbas added a commit that referenced this pull request Dec 23, 2020
Generated documentation is then included on the Antrea website.
The script relies on a slightly modified version of
https://github.com/ahmetb/gen-crd-api-reference-docs. It doesn't require
running an actual apiserver, instead it uses the Go source files
directly.
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.

6 participants