Skip to content

go generate support for oss/public modules #112

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

Merged
merged 1 commit into from
Jul 30, 2024
Merged

go generate support for oss/public modules #112

merged 1 commit into from
Jul 30, 2024

Conversation

dengsh12
Copy link
Contributor

@dengsh12 dengsh12 commented Jul 25, 2024

Proposed changes

We plan to provide a tool to update supporting files(analyze_*_directives.go) by go generate. This MR is to provide go generate update for oss and public modules(oss/lua/otel//njs/headersmore).

go generate only targets for dynamic modules(or OSS, NPlus) we want to provide long-lasting supports for. To provide temporary support for a module, please refer to #101

Here are the detailed changes:

  • Add a shell script(./scripts/public_source_gen.sh) to fetch code from github and generate corresponding support files. It would make adding new dynamic modules or updating current existing support files easy.
  • Add .gen.go suffix to generated files and ignore them in golangci-lint
  • Add go:generate comments for oss and public modules in analyze.go
  • ./cmd/generate can read from json file now
  • Renaming of MatchFunc and directives map in .gen.go files.

Checklist

Before creating a PR, run through this checklist and mark each as complete.

  • I have read the CONTRIBUTING document
  • If applicable, I have added tests that prove my fix is effective or that my feature works
  • If applicable, I have checked that any relevant tests pass after adding my changes
  • I have updated any relevant documentation (README.md)

@dengsh12 dengsh12 requested a review from a team as a code owner July 25, 2024 23:04
Copy link

codecov bot commented Jul 25, 2024

Codecov Report

Attention: Patch coverage is 19.04762% with 68 lines in your changes missing coverage. Please review.

Project coverage is 76.57%. Comparing base (82990a0) to head (7873352).
Report is 6 commits behind head on main.

Files Patch % Lines
cmd/generate/main.go 0.00% 46 Missing ⚠️
internal/generator/generator.go 0.00% 9 Missing ⚠️
analyze_oss_124_directives.gen.go 0.00% 3 Missing ⚠️
analyze_oss_126_directives.gen.go 0.00% 3 Missing ⚠️
analyze_otel_directives.gen.go 0.00% 3 Missing ⚠️
analyze_nplus_R30_directives.go 0.00% 2 Missing ⚠️
analyze_nplus_R31_directives.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #112      +/-   ##
==========================================
- Coverage   78.82%   76.57%   -2.26%     
==========================================
  Files          26       26              
  Lines        1124     1161      +37     
==========================================
+ Hits          886      889       +3     
- Misses        182      216      +34     
  Partials       56       56              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dengsh12 dengsh12 merged commit 9c47563 into nginxinc:main Jul 30, 2024
2 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